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
LEit
Novice


Joined: 27 Jul 2002
Posts: 38
Location: USA

PostPosted: Thu Aug 08, 2002 5:29 pm   

Action on Zone load
 
Is it possible to perform some action when a map Zone is loaded (and hopefully when it is unloaded).

I've got a bunch of triggers for suppressing output of room descriptions that indicate time, but there is no need to check them for every zone, just one.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Aug 08, 2002 6:48 pm   
 
What do you mean, when you walk into a zone, or when you display a zone in the mapper (without necessarily having to walk to the zone)? You might want to check out zone scripts.

Kjata
Reply with quote
LEit
Novice


Joined: 27 Jul 2002
Posts: 38
Location: USA

PostPosted: Thu Aug 08, 2002 7:35 pm   
 
I ment when I load the zone. The mud has outdoor areas that don't map easily (and don't really need to be mapped). This means when I leave one city and go to the next I have to manually switch zones.

Hmm, I could put triggers for the start rooms of each zone to load it, that could also let me turn on zone specific triggers. Now how to turn them off again? I'll have to see if I can grab something from the outdoor travel perhaps.

How do I load a map to be current, #TELEPORT seems like it would work. Is there something better?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Aug 08, 2002 7:43 pm   
 
Any settings that appear in a room script are created when you enter the room and estroyed once you leave the room. Thus, you could put aliases in the room scripts of the rooms that connect to another zone like these:
#ALIAS east {#TELEPORT roomNum zone}

Kjata
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Aug 08, 2002 10:33 pm   
 
Yes this is quite simple.

In each of your zones put in the Zone Script:
#ALARM {+1} {ZoneLoader}
#VAR ZoneLoad "stuff|stuff2" "_nodef" {ZoneScripter}
#VAR ZonePend "stuff|stuff2"

Now for the meat:
#CLASS ZoneScripter {enable}
#VAR ZoneLoad {}
#VAR ZoneUnload {}
#ALIAS ZoneLoaded {#FORALL @ZoneUnload {#EXEC {%i}};#FORALL @ZoneLoad {#EXEC {%i}};ZoneUnload=ZonePend}
#CLASS 0

That will likely activate before you even connect to the mud if your map opens with your char. The script is capable of doing just about everything you could want. If you desire to use lists anywhere in it you will either have to leave them as permenant variables or tweak a lot to get them to seperate properly from the whole script.

You might also be able to remove the #ALARM and just use the the alias command by itself, but I could not test it thoroughly to be sure.
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Fri Aug 09, 2002 2:47 am   
 
A slight modification to Kjata's alias:

#ALIAS east {~east;#TELEPORT roomNum zone}



 - Charbal
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Aug 09, 2002 11:45 am   
 
Heh, thanks for catching that Charbal.

Kjata
Reply with quote
LEit
Novice


Joined: 27 Jul 2002
Posts: 38
Location: USA

PostPosted: Mon Aug 12, 2002 4:56 pm   
 
Actually it's much easier then that.
Right click on a zone, and bring up the zone properties, then you can enter in any script. It's active only when that zone is active, and goes away when the zone goes away.

I should have done more exploring before posting here, sorry.
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