Welcome to the Builder Academy

Question %actor.vnum%

More
30 Jul 2012 19:04 #480 by Papaya Pete
%actor.vnum% was created by Papaya Pete
So I'm trying to have a guard keep goblins within a forest, and it works well on them... and everyone else as well. Am I using %actor.vnum% correctly?
Code:
1) Name : Keep Goblins In Forest 2) Intended for : Mobiles 3) Trigger types: Greet 4) Numeric Arg : 100 5) Arguments : 6) Commands: emote keeps an eye to the south, his hand on the hilt of his blade. if %actor.vnum(1015)% %force% %actor% emote starts to emerge from the forest, but sees the lone guardsman and quickly darts back in. %force% %actor% south else end

Please Log in or Create an account to join the conversation.

More
30 Jul 2012 19:39 #481 by Liko
Replied by Liko on topic Re: %actor.vnum%

Papaya Pete wrote: So I'm trying to have a guard keep goblins within a forest, and it works well on them... and everyone else as well. Am I using %actor.vnum% correctly?

Code:
1) Name : Keep Goblins In Forest 2) Intended for : Mobiles 3) Trigger types: Greet 4) Numeric Arg : 100 5) Arguments : 6) Commands: emote keeps an eye to the south, his hand on the hilt of his blade. if %actor.vnum(1015)% %force% %actor% emote starts to emerge from the forest, but sees the lone guardsman and quickly darts back in. %force% %actor% south else end


Why not use %findmob.roomvnum(mobvnum)% instead?

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
30 Jul 2012 19:49 #482 by Papaya Pete
Replied by Papaya Pete on topic Re: %actor.vnum%
Very nice! That did the trick, thanks!

Please Log in or Create an account to join the conversation.

More
01 Aug 2012 02:25 #503 by Vatiken
Replied by Vatiken on topic Re: %actor.vnum%
Code:
if %actor.vnum(1015)%
Should be...
Code:
if %actor.vnum% == 1015
You don't need the "else" either.

I'd recommend doing it your original way too as "findmob" is far more intensive (and unneccessary) then just checking the actor's vnum. There is really no reason to ever use "findmob" or "findobj" for any room in which you already have the rnum of.

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

More
01 Aug 2012 16:03 #506 by Papaya Pete
Replied by Papaya Pete on topic Re: %actor.vnum%
Ah thanks, that works out perfectly too. I figured that I was misusing %actor.vnum% in some way or something. :oops:

Thank you once again for all the help! :)

Please Log in or Create an account to join the conversation.

More
04 Aug 2012 07:19 #528 by Fizban
Replied by Fizban on topic Re: %actor.vnum%

Vatiken wrote:

Code:
if %actor.vnum(1015)%
Should be...
Code:
if %actor.vnum% == 1015
You don't need the "else" either.

I'd recommend doing it your original way too as "findmob" is far more intensive (and unneccessary) then just checking the actor's vnum. There is really no reason to ever use "findmob" or "findobj" for any room in which you already have the rnum of.


Not to mention using findmob wouldn't actually check if the correct mob entered the room, only if it was in the room. It'd trigger when anything else entered the room while the specified mob was already in the room which was clearly not the intention.

Please Log in or Create an account to join the conversation.

Time to create page: 0.202 seconds