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
patryn
Apprentice


Joined: 26 Sep 2001
Posts: 124

PostPosted: Wed Dec 12, 2001 1:19 pm   

simple flag check
 
hey all :)

the mud i play has areas that use a different set of directions other then the standard n,s,e,w directions.
In some areas the fw,bw,lt,rt directions are used.
Now ive created a routine which converts my directions to and from these two direction standards, but my problem comes in when i try to implement a way of switching the routine on and off.

what i would like to do is have a flag in each room that i want the routine to be turned on with the value of 'secondary_direction'
then i simply to a flag check and use #t- or #t+ for the switch.

now, i thought that putting the following code into the Zone/Map Script in the map configuration settings would do the trick:

#if %roomflags()="secondary_direction" {#t+ convert_directions} {#t- convert_directions}

unfortunetely that code is only executed once when the map is first loaded, and not while i move thru rooms in follow mode.

i took this a step further then by turning it into a command input trigger as follows:

#oninput {%t} {#if %roomflags()="secondary_direction" {#t+ convert_directions} {#t- convert_directions}}

Now this does exactly what i wanted except for one small yet amazingly irritating glitch. the trigger goes off 'before' the mapper moves into the queued room. so the check is actually for the room i just left, not the one im currently in.

I could remedy this, by forcing the mapper to move into queued room 'before' the flag check code is executed, and then (once the flag check has been executed) force the mapper to move back to where i originally was, so that the mapper can then resume where it left off and move me back (yet again) into the room i just did a flag check on.

i know this method works, but it seems such a tedious method for such a simple idea. what im asking is, does anyone know of a simpler way to check flags in a room when you enter them?

i thought that's what the Map/Zone Scripting was for, but it doesnt seem to work without actually useing a trigger.

thanks in advance :)


That which does not kill us, makes us stronger.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Dec 12, 2001 4:35 pm   
 
There is another field like Map/Zone Scripting but it is for specific rooms only. It is called a Room Script and you can set it when you look at the Properties for one room.

Kjata
Reply with quote
patryn
Apprentice


Joined: 26 Sep 2001
Posts: 124

PostPosted: Wed Dec 12, 2001 11:32 pm   
 
yeah, putting the code in the room script of a room would work, but id have to put it in every room ive mapped. Problem is my map is over 8000+ rooms :)

is there some sort of global script i could use instead? so i just have to type out the code once, and it'll execute for every room

or if this isnt possible, is there anyway to make a trigger so that it goes off once a new room is entered?
Preferably directly from the automapper, because i use FastWalk, my mapper doesnt wait for the Mud Confirmation to move :)

thanks :)
btw, im using Zmud 6.16 :)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Fri Dec 14, 2001 1:27 am   
 
The only way I see to do it is to write your own entire fastwalk routine. I had to do that for my mud since exits for rooms sometimes require commands to be issued in other rooms, and sometimes require commands to be issued repeatedly in that room before they are usable. So I would say you should make an alias to go through you whole route and produce a new walk string. It ends up being a pretty big section of script but is very satisfying.
Reply with quote
patryn
Apprentice


Joined: 26 Sep 2001
Posts: 124

PostPosted: Fri Dec 14, 2001 2:12 am   
 
yeah i was planning to do that anyway, a little bit down the track when i have a bit of time :)

thanks for the help with the above problem, ive fixed it by changing the routine around a bit, so that 'it' checks the room flags.


oh, an idea maby for the beta versions:
the only reason i use fastwalk is because slow/medium walking waits for confirmation before the map centers where i should be. This for me is too slow because i look at the map as i queue my directions, so thats why i prefer the fastwalk, you dont have to look ahead of the blue dot to know where you (virtually) are.
if a new option is put in, like 'track queued commands', which simply centers and colours the room you're virtually in, while at the same time on the map the blue dot is slowly moving along, confirming all the directions from the mud output.

i dont think i explained that very well. sort of like a fastwalk and a slow walk in one. where the blue dot is slow walking, while a different dot (red maby, or the room select outline) is doing a fast walk.

so if you queue, 10e, the red dot moves 10east on the map right away, and centers there, showing you where you are, in the meantime, the blue dot is slowly making it's way towards the red dot as it confirms each step from the mud output.

in short the blue dot shows where you are on the mud. and the red shows where you will be if all the commands go through successfully.

tell me what you think :)


That which does not kill us, makes us stronger.
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