| 
 
 |  Re: RELEASE: Pet system [tutorial] 
15 years, 20 weeks agoit works but how can i put more items?
 | 
 
		| 
fruity  
Joined: 12th Jun 2010Posts: 569
 
  Re: RELEASE: Pet system [tutorial] 
15 years, 20 weeks agoI getan error on line 181 idk what to edit? 
 
 
 
 error: call of overloaded 'NPC(Map*&, short int&, unsigned char&, unsignedchar&,unsi...
 |  
		| 
 
 |  Re: RELEASE: Pet system [tutorial] 
15 years, 19 weeks ago$sp doesn't work.. How do i spawn pet? 
 {Fixed} $sp Debug 171
 |   
		| 
		|  Re: RELEASE: Pet system [tutorial] 
15 years, 18 weeks agoIs this class constructor? Character::~Character <--- nvm i found in Character.cpp
 
 
 The pets i added attack owner.....any idea how to make them work properly?
 |  
		| 
Addison  
Joined: 24th Mar 2009Posts: 1380
 
  Re: RELEASE: Pet system [tutorial] 
15 years, 18 weeks agoCharacter::~Character is the destructor Character::Character is the constructor
 ---
http://www.addipop.com |  
		| 
		|  Re: RELEASE: Pet system [tutorial] 
15 years, 18 weeks agoCan anyone give an idea how to make pets attack other npcs? Or just a general idea how to? |  
		| 
		|  Re: RELEASE: Pet system [tutorial] 
15 years, 18 weeks agoHow do i Set what Npc i want to be spawned using the item i choose?
 |  
		| 
gustavo  
Joined: 13th Jul 2010Posts: 126
 
  Re: RELEASE: Pet system [tutorial] 
15 years, 18 weeks agoTo me dont works. I say $sn and EOServ Closes! |  
		| 
		|  Re: RELEASE: Pet system [tutorial] 
15 years, 18 weeks agoHow do i make it so i can add more that 1 item to give out pets..
 Example.. item id 61 = npc 88 item id 62 = npcid 255,etc
 
 |  
		| 
AustinB  
Joined: 9th Jul 2010Posts: 1400
 
  Re: RELEASE: Pet system [tutorial] 
15 years, 18 weeks ago
Charizard posted: (14th Jul 2010 12:04 pm)
 
 How do i make it so i can add more that 1 item to give out pets..
 Example.. item id 61 = npc 88 item id 62 = npcid 255,etc
 
 
Add the code again below it?!?! Seriously? This isn't rocket science.
 ---
Create your own destiny, don't let someone else do it for you. |  
		| 
Miksu  
Joined: 4th Jun 2009Posts: 1457
 
  Re: RELEASE: Pet system [tutorial] 
15 years, 17 weeks agoif(id == 45){
 this->player->character->Save(); //this may be unnessasary
 this->player->character->AddItem(id, 45);//adds back the item after it's use
 this->player->character->Save();
 
 if(!this->player->character->has_pet)
 {
 
 unsigned char index = this->player->character->map->GenerateNPCIndex();
 if (index > 250)
 
 {
 break;
 }
 
 this->player->character->pet = new NPC(this->player->character->map, 225, this->player->character->x + 1,this->player->character->y, 1, 1, index, true, true);
 this->player->character->pet->Spawn();
 this->player->character->pet->SetOwner(this->player->character);
 this->player->character->has_pet = true;
 this->player->character->AddItem(45, 1);
 this->player->character->map->npcs.push_back(this->player->character->pet);
 this->player->character->Save();
 }
 
 else if(this->player->character->has_pet = true)
 {
 UTIL_PTR_LIST_FOREACH(this->player->character->map->characters, Character, character)
 {
 if (this->player->character->InRange(*character))
 {
 this->player->character->pet->RemoveFromView(*character);
 }
 }
 erase_first(this->player->character->map->npcs, this->player->character->pet);
 this->player->character->pet->Release();
 this->player->character->has_pet = false;
 }
 }
 
 
 it compiled without errors and without any warnings but still when I spawn item 45 (Train Ticker) and double click it, nothing? Why? Pet system is working right :o ---
Eoserv classes: Forum ghost, test player, ex-server owner, TOP 50, mapper & an
oldbie |  
		| 
AustinB  
Joined: 9th Jul 2010Posts: 1400
 
  Re: RELEASE: Pet system [tutorial] 
15 years, 17 weeks ago
sephiroth posted: (21st Jul 2010 08:37 pm)
 
 if(id == 45){
 this->player->character->Save(); //this may be unnessasary
 this->player->character->AddItem(id, 45);//adds back the item after it's use
 this->player->character->Save();
 
 if(!this->player->character->has_pet)
 {
 
 unsigned char index = this->player->character->map->GenerateNPCIndex();
 if (index > 250)
 
 {
 break;
 }
 
 this->player->character->pet = new NPC(this->player->character->map, 225, this->player->character->x + 1,this->player->character->y, 1, 1, index, true, true);
 this->player->character->pet->Spawn();
 this->player->character->pet->SetOwner(this->player->character);
 this->player->character->has_pet = true;
 this->player->character->AddItem(45, 1);
 this->player->character->map->npcs.push_back(this->player->character->pet);
 this->player->character->Save();
 }
 
 else if(this->player->character->has_pet = true)
 {
 UTIL_PTR_LIST_FOREACH(this->player->character->map->characters, Character, character)
 {
 if (this->player->character->InRange(*character))
 {
 this->player->character->pet->RemoveFromView(*character);
 }
 }
 erase_first(this->player->character->map->npcs, this->player->character->pet);
 this->player->character->pet->Release();
 this->player->character->has_pet = false;
 }
 }
 
 
 it compiled without errors and without any warnings but still when I spawn item 45 (Train Ticker) and double click it, nothing? Why? Pet system is working right :o 
Make sure item 45 is set to item type 3 (potion) or it prob wont work
 ---
Create your own destiny, don't let someone else do it for you. |  
		| 
Miksu  
Joined: 4th Jun 2009Posts: 1457
 
  Re: RELEASE: Pet system [tutorial] 
15 years, 17 weeks ago
AustinB posted: (21st Jul 2010 09:21 pm)
 
 
sephiroth posted: (21st Jul 2010 08:37 pm)
 
 if(id == 45){
 this->player->character->Save(); //this may be unnessasary
 this->player->character->AddItem(id, 45);//adds back the item after it's use
 this->player->character->Save();
 
 if(!this->player->character->has_pet)
 {
 
 unsigned char index = this->player->character->map->GenerateNPCIndex();
 if (index > 250)
 
 {
 break;
 }
 
 this->player->character->pet = new NPC(this->player->character->map, 225, this->player->character->x + 1,this->player->character->y, 1, 1, index, true, true);
 this->player->character->pet->Spawn();
 this->player->character->pet->SetOwner(this->player->character);
 this->player->character->has_pet = true;
 this->player->character->AddItem(45, 1);
 this->player->character->map->npcs.push_back(this->player->character->pet);
 this->player->character->Save();
 }
 
 else if(this->player->character->has_pet = true)
 {
 UTIL_PTR_LIST_FOREACH(this->player->character->map->characters, Character, character)
 {
 if (this->player->character->InRange(*character))
 {
 this->player->character->pet->RemoveFromView(*character);
 }
 }
 erase_first(this->player->character->map->npcs, this->player->character->pet);
 this->player->character->pet->Release();
 this->player->character->has_pet = false;
 }
 }
 
 
 it compiled without errors and without any warnings but still when I spawn item 45 (Train Ticker) and double click it, nothing? Why? Pet system is working right :o Make sure item 45 is set to item type 3 (potion) or it prob wont work
 
 
 
Thank you very much, I didn't know that it should be potion :D
 ---
Eoserv classes: Forum ghost, test player, ex-server owner, TOP 50, mapper & an
oldbie |  
		| 
Evildark  
Joined: 31st Jul 2009Posts: 485
 
  Re: RELEASE: Pet system [tutorial] 
15 years, 16 weeks agoeverytime i put that code in and compile it it says ..\src\packet.hpp|73|error: expected '}' before 'PACKET_PLAYER'|
 ..\src\packet.hpp|73|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|74|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|75|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|76|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|77|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|78|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|79|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|80|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|81|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|82|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|83|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|84|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|85|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|86|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|87|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|88|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|89|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|90|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|91|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|92|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|93|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|94|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|95|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|96|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|98|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|99|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|100|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|101|error: invalid conversion from 'int' to 'PacketAction'|
 ..\src\packet.hpp|102|error: expected ',' or ';' before '}' token|
 ..\src\packet.hpp|102|error: expected declaration before '}' token|
 ||=== Build finished: 31 errors, 0 warnings ===|
 
 ---
My skins dying because you're under it-
I’m done lying to myself for this.
For all the wonder in believing man it’s making me weak-
I’ll fade away & classify myself as Obsolete! |  
		| 
Ananas
 Moderator 
Joined: 22nd Apr 2009Posts: 2190
 
  Re: RELEASE: Pet system [tutorial] 
15 years, 16 weeks agoSeems like you forgot to close the code somewhere "}"
 ---
"Pineapples and shit." |  |  |  |  |  |  |  |  |  |  |  |  |  |