Evildark

Joined: 31st Jul 2009
Posts: 485
Re: RELEASE: Pet system [tutorial]
Ive posted my packet.hpp on paste if someone can take a look and see whats wrong and tell me thatll be greatly appreciated
http://pastebin.com/VMZF81tY
---
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!
14 years, 41 weeks ago
|
Re: RELEASE: Pet system [tutorial]
Has anyone figured out how to make the pets attack NPCs yet?
14 years, 41 weeks ago
|
Evildark

Joined: 31st Jul 2009
Posts: 485
Re: RELEASE: Pet system [tutorial]
cool cool when i put it in it says C:\Documents and Settings\Administrator\Desktop\R189\trunk\src\handlers\Item.cpp|32|error: #include expects "FILENAME" or <FILENAME>|
C:\Documents and Settings\Administrator\Desktop\R189\trunk\src\handlers\Item.cpp||In member function 'bool EOClient::Handle_Item(PacketFamily, PacketAction, PacketReader&, int)':|
C:\Documents and Settings\Administrator\Desktop\R189\trunk\src\handlers\Item.cpp|67|error: 'NpcID' was not declared in this scope|
C:\Documents and Settings\Administrator\Desktop\R189\trunk\src\handlers\Item.cpp|67|error: invalid use of incomplete type 'struct NPC'|
..\src\fwd\npc.hpp|10|error: forward declaration of 'struct NPC'|
C:\Documents and Settings\Administrator\Desktop\R189\trunk\src\handlers\Item.cpp|68|error: invalid use of incomplete type 'struct NPC'|
..\src\fwd\npc.hpp|10|error: forward declaration of 'struct NPC'|
C:\Documents and Settings\Administrator\Desktop\R189\trunk\src\handlers\Item.cpp|69|error: invalid use of incomplete type 'struct NPC'|
..\src\fwd\npc.hpp|10|error: forward declaration of 'struct NPC'|
..\src\container\ptr_vector.hpp||In member function 'void PtrVector<T>::push_back(T*) [with T = NPC]':|
C:\Documents and Settings\Administrator\Desktop\R189\trunk\src\handlers\Item.cpp|72|instantiated from here|
..\src\container\ptr_vector.hpp|360|error: no matching function for call to 'PtrVector<NPC>::push_back(NPC*&)'|
..\src\container\ptr_vector.hpp|237|note: candidates are: virtual void GenericPtrVector::push_back(Shared*)|
||=== Build finished: 9 errors, 0 warnings ===|
Heres the pastebin of my item.cpp
http://pastebin.com/giaZKXRR
thats so i can make an item spawn a pet
---
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!
14 years, 41 weeks ago
|
memo

Joined: 2nd Nov 2009
Posts: 21
Re: RELEASE: Pet system [tutorial]
but as the removal of the pet in the game?
14 years, 40 weeks ago
|
DanScott

Joined: 19th Aug 2010
Posts: 1212
Re: RELEASE: Pet system [tutorial]
has anyone fixed the pets walking through npc walls yet? ---
If money doesn't grow on trees, then why do banks have branches?
14 years, 36 weeks ago
|
Re: RELEASE: Pet system [tutorial]
Yeah I'm pretty sure if you look back a little you will see that Ananas posted a code that gets a pet to walk through NPC walls.
14 years, 36 weeks ago
|
Blade

Joined: 24th Nov 2009
Posts: 87
Re: RELEASE: Pet system [tutorial]
Pretty sure doing what Ananas mentioned on page 7 disables NPC Walls entirely.
14 years, 36 weeks ago
|
DanScott

Joined: 19th Aug 2010
Posts: 1212
Re: RELEASE: Pet system [tutorial]
what ananas said on page 6 does not do anything its just pointing out what could/should be edited :) ---
If money doesn't grow on trees, then why do banks have branches?
14 years, 35 weeks ago
|
Re: RELEASE: Pet system [tutorial]
heres the fix now can walk to each map now just need attack/.fallow to work
void Character::PetTransfer() {
if(this->has_pet && !this->pet_transfer) {
UTIL_PTR_LIST_FOREACH(this->map->characters, Character, character) {
if (this->InRange(*character)) {
this->pet->RemoveFromView(*character);
this->pet->Release();
erase_first(this->player->character->pet->map->npcs, this->player->character->pet);
this->has_pet = false;
this->pet_transfer = true; } }
if(this->pet_transfer) {
unsigned char index = this->map->GenerateNPCIndex();
if (index > 250) { return; }
this->pet = new NPC(this->map, this->pet->id, this->x, this->y, 1, 1, index, true, true);
this->pet->SetOwner(this);
this->map->npcs.push_back(this->pet);
this->pet->Spawn();
this->has_pet = true;
this->pet_transfer = false; }
} }
here a delete pet code usefull for testing lol #dpet
else if (command.length() >= 4 && command.compare(0,4,"dpet") == 0 && this->player->character->has_pet) {
this->player->character->pet->RemoveFromView(this->player->character);
this->player->character->pet->Release();
this->player->character->has_pet = false; }
14 years, 35 weeks ago
|
Balo996

Joined: 25th Aug 2010
Posts: 81
Re: RELEASE: Pet system [tutorial]
i dont know how to made it :(
Hey i not speak english
---
-Nu-
14 years, 33 weeks ago
|
Dough

Joined: 21st Oct 2010
Posts: 535
Re: RELEASE: Pet system [tutorial]
-------------- Build: MYSQL+SQLITE in EOServ ---------------
Compiling: ..\src\character.cpp
In file included from K:\Doug\EOServ\src\character.cpp:15:0:
K:\Doug\EOServ\src\npc.hpp:203:9: error: extra qualification 'NPC::' on member 'NPC'
K:\Doug\EOServ\src\npc.hpp: In static member function 'static NPC* NPC::ScriptFactory(Map*, short int, unsigned char, unsigned char, unsigned char, short int, unsigned char, bool)':
K:\Doug\EOServ\src\npc.hpp:264:235: error: no matching function for call to 'NPC::NPC(Map*&, short int&, unsigned char&, unsigned char&, unsigned char&, short int&, unsigned char&, bool&)'
K:\Doug\EOServ\src\npc.hpp:203:9: note: candidates are: NPC::NPC(Map*, short int, unsigned char, unsigned char, unsigned char, short int, unsigned char, bool, bool)
K:\Doug\EOServ\src\npc.hpp:165:1: note: NPC::NPC(const NPC&)
Process terminated with status 1 (0 minutes, 5 seconds)
4 errors, 0 warnings
14 years, 15 weeks ago
| | | | | | | | | | | |