Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
parrotslave
Wanderer


Joined: 01 Jul 2002
Posts: 81
Location: USA

PostPosted: Wed Jul 07, 2004 3:31 pm   

trigger help please
 
How do I create a trigger to move me to the next room if there are no mobs in the room I just entered?

Is there some sort of command to execute a script upon entering a room? I couldn't find anything in the help files.

I tried using the timer to move that would be deactivated if there was a mob in the room, but if a lag burst hit things got messed up.

The room description when a mob is in the room looks something like this:

You are wandering on a foggy moor.
There are two obvious exits: north, south
There is a dog standing here.

The room description when there is no mob in the room looks like this:

You are wandering on a foggy moor.
There are two obvious exits: north, south

Thanks!
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Jul 07, 2004 4:24 pm   
 
1. Use the #TRIGGER command, the Settings Editor, or the Command Wizard. Think about the information you receive when entering or looking at a room, and how you tell whether or not there is a mob present, then make triggers to duplicate your thinking.

In this case, I'm assuming you know there's not a mob when you get a blank line before you see one.

#TR {There are * obvious exit} {#VAR nomob 1}
#COND {^$} {#IF (@nomob) {move to the next room}}
#TR {standing here.$} {#VAR nomob 0}

2. There are several different ways of executing scripts when entering a room. Most of them are pretty obvious. Use the onroomenter alias. Make aliases for your movement commands. Use a trigger based on the text you receive when entering a room, such as the Exits line. Modify your movement macros to include the script.
Reply with quote
parrotslave
Wanderer


Joined: 01 Jul 2002
Posts: 81
Location: USA

PostPosted: Wed Jul 07, 2004 6:15 pm   
 
Thanks!

That helped a lot.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net