Welcome to the Builder Academy

Question dg_script question

More
13 Jul 2012 21:26 - 13 Jul 2012 21:40 #363 by bakarus
Replied by bakarus on topic Re: dg_script question
Something like this? How do I 'remote the global variable?'
Code:
set original_vnum = %actor.vnum% if %actor.vnum% != 7798 if %cmd.mudcommand% == enter && %arg% /= gateway %send% %actor% You enter the gateway. %echoaround% %actor% %actor.name% bravely enters the gateway. %teleport% %actor% 7798 %force% %actor% look %echoaround% %actor% %actor.name% just stepped through the gateway. else %send% %actor% %cmd% what?! end else %teleport% %actor% original_vnum end
Last edit: 13 Jul 2012 21:40 by bakarus.

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

More
13 Jul 2012 23:32 - 14 Jul 2012 03:07 #365 by Rumble
Replied by Rumble on topic Re: dg_script question
remote and global are two different things. Help files for each.
Code:
eval original_vnum %actor.room.vnum% remote original_vnum %actor.id%

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com
Last edit: 14 Jul 2012 03:07 by Rumble.

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

More
13 Jul 2012 23:51 #366 by bakarus
Replied by bakarus on topic Re: dg_script question
Can I then call %actor.original_vnum% to teleport like:


%teleport% %actor% %actor.original_vnum%


?

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

More
14 Jul 2012 00:35 #367 by Rumble
Replied by Rumble on topic Re: dg_script question
yup, that is it.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

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

More
14 Jul 2012 00:43 #368 by bakarus
Replied by bakarus on topic Re: dg_script question
My final script is below:

1) Name : Gateway trigger
2) Intended for : Objects
3) Trigger types: Command
4) Numeric Arg : 7
5) Arguments : enter
6) Commands:
Code:
if %actor.room.vnum% != 7798 set original_vnum = %actor.room.vnum% remote original_vnum %actor.id% if %cmd.mudcommand% == enter && %arg% /= gateway %send% %actor% You enter the gateway. %echoaround% %actor% %actor.name% bravely enters the gateway. %teleport% %actor% 7798 %force% %actor% look %echoaround% %actor% %actor.name% just stepped through the gateway. else %send% %actor% %cmd% what?! end else %echoaround% %actor% %actor.name% leaves and heads back to reality. %teleport% %actor% %actor.original_vnum% %force% %actor% look %echoaround% %actor% %actor.name% appears out of a magical gateway. end
W) Copy Trigger
Q) Quit


It works and teleports the player to the room 7798, but when the player types 'enter gateway' the 2nd time teleports them to 7798 again and gives this error:

oteleport target is an invalid room

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

More
14 Jul 2012 02:10 #369 by Vatiken
Replied by Vatiken on topic Re: dg_script question
"set original_vnum = %actor.room.vnum%"
to
"eval original_vnum %actor.room.vnum%"

tbaMUD developer/programmer

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

Time to create page: 0.267 seconds