|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days. |
09-12-2004, 01:07 PM
|
Fire Beetle
|
|
Join Date: Sep 2004
Posts: 12
|
|
movenpc function
i couldnt find a function to move an npc so i decided to make one
there may be a few errors since i only know the basics of C++
parser.cpp
Code:
else if (!strcmp(strlwr(command),"movenpc")) {
if (other) other->MovePc((atoi(arglist[0])),(atof(arglist[1])),
(atof(arglist[2])),(atof(arglist[3])));
embparser.cpp
Code:
"sub movenpc{push(@cmd_queue,{func=>'movenpc',args=>join(',',@_)});}"
if there are any errors please post here with a fix. i dont have a server so i dont have a way to test it.
|
09-12-2004, 01:09 PM
|
Demi-God
|
|
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
|
|
Um. MovePC moves the Player not an NPC I believe.........
And this is already quest::movepc();
Thats why theres a fourth arg, zoneid.
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
|
09-12-2004, 01:10 PM
|
Fire Beetle
|
|
Join Date: Sep 2004
Posts: 12
|
|
yes.....thats why i made move NPC
|
09-12-2004, 01:11 PM
|
Demi-God
|
|
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
|
|
Quote:
Originally Posted by 8ball
yes.....thats why i made move NPC
|
Um.
I believe thats the same command used in movepc(). Let me check...
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
|
09-12-2004, 01:12 PM
|
Fire Beetle
|
|
Join Date: Sep 2004
Posts: 12
|
|
ya sry i just noticed that
like i said i dont know c++ that well hehe...
i changed it to other->movenpc
not sure if that will work tho
|
09-12-2004, 01:13 PM
|
Demi-God
|
|
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
|
|
Nevermind, My bad. But will this work crossing over a zone?
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
|
09-12-2004, 01:16 PM
|
Fire Beetle
|
|
Join Date: Sep 2004
Posts: 12
|
|
not sure.
i have no way of testing it so if someone who has a server wants to test it go ahead :P
|
09-12-2004, 01:20 PM
|
Demi-God
|
|
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
|
|
other. Hmm. Im not sure if its MovePC that targets the PC or CastToClient() that does. So I'm not sure if this will work.
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
|
09-12-2004, 01:38 PM
|
Demi-God
|
|
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
|
|
Err, other->MoveNPC would have to be defined. It wont just 'know' that.
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
|
09-12-2004, 02:27 PM
|
Fire Beetle
|
|
Join Date: Sep 2004
Posts: 12
|
|
how would i go about defining it?
|
09-12-2004, 04:38 PM
|
Dragon
|
|
Join Date: Jun 2002
Posts: 776
|
|
Well you could always try quest::moveto()...I think that starts the NPC on a path to the loc, but it will at least move them there(if it's working...haven't really tested it). There's no MoveNPC that I know of...you'd also have to take into account the fact that by simply "moving" them, you pretty much summon them. Summoned NPCs return to their spawn point as far as I know.
You'd have to alter their x/y/z above just moving them to the new location, or create a flag that disables the "return to spawn" code for special cases like this.
|
09-13-2004, 03:17 AM
|
Fire Beetle
|
|
Join Date: Sep 2004
Posts: 12
|
|
the reason i decided to make this was so i could temorarily move an npc somewhere.
on live there was a monk quest where you had to fight Grand Master Glock. the quest moved you to an enclosed room that couldnt be accessed except by hailing master glock and then you'd get teleported to a new room. i think it was just an entirely different mob in there tho.
still, i think this could come in handy with certain things.
|
09-13-2004, 07:12 AM
|
Demi-God
|
|
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
|
|
Well, it probably didn't move the NPC but it actually did
quest::spawn(samenpcnumber,x,y,z);
quest::movepc($zoneid,x,y,z);
quest::depop();
(but it would be in the format of however Sony does quests )
it just appeared like the npc moved.
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
|
09-13-2004, 10:57 AM
|
Fire Beetle
|
|
Join Date: Sep 2004
Posts: 12
|
|
ya, i realized that when i was spacing out in math class about 3 hours ago lol
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 09:24 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|