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


Joined: 10 Oct 2000
Posts: 38
Location: USA

PostPosted: Thu Jun 27, 2002 7:56 pm   

changing room colors with triggers
 
I trigger off of room descriptions such as "An Ancient Forest [Outdoors Forest]" and "A Road Through the Forest [Outdoors City]" and was hoping there was a way to trigger on the text where "Forest" would make a green room on the map, and "City" would be the traditional grey. Someone mentioned "%roomcol( room, [color])" as a way to do it, but i get "^ syntax error" at the first [ symbol. I don’t know if this is supported or not supported in 6.16 or if I’m doing something wrong.

any help would be much appreciated.


www.modmud.com
modmud.com:7500

"There is not one shred of evidence that life is supposed to be serious."
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Jun 27, 2002 10:10 pm   
 
In practice that kind of function is called like:

Red:

#NOOP %roomcol( %roomname(),$FF0000)

Usually the result which %roomcol() sends back is not of interest so
it can be sent to a no operation command #NOOP.



Ton Diening
Providing untested answers that tend to be
more complicated than others.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Jun 27, 2002 10:19 pm   
 
Also it takes a room number for its first parameter.

In help files it is standard practice to enclose optional parameters in []'s. Hence the brackets should not be there in actual usage.

For some examples:
#SHOW %roomcol (1)
Will display the current color of room 1.
#SHOW %roomcol (%roomnum())
Will display the current color of whatever room your are in.
#NOOP %roomcol (1,"red")
Would set the room color of room 1 to red.

If you would like a list of colors that have predefined RGB values look up %colorname in the help files.
Reply with quote
zero
Novice


Joined: 10 Oct 2000
Posts: 38
Location: USA

PostPosted: Fri Jun 28, 2002 5:36 pm   
 
Well, that's closer. It does color the rooms, but it doesn't color the room I move into. Here's what's happening.

I'm in [city]. I move into [Forest]. The room [city] is then colored green after I move out.

sigh.


www.modmud.com
modmud.com:7500

"There is not one shred of evidence that life is supposed to be serious."
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jun 28, 2002 10:09 pm   
 
Solunds to be a timing issue with your trigger. We would need to know if you are attempting to do this while mapping, what some output from your mud is, and what you are triggering off of to preform the room color. Perhaps then we can suggest something or some other way to do it.
Reply with quote
zero
Novice


Joined: 10 Oct 2000
Posts: 38
Location: USA

PostPosted: Sat Jun 29, 2002 7:35 am   
 
Here's some output for you. My trigger is this ~[Outdoors Field~] and seems to work correctly, just 1 move behind :)


[H:8462/9000 V:900/900 M:906/906] [VNUM:60102] > e
You walk east.
The Great Grasslands [Outdoors Field]
You hear a loud noise in the distance, almost like a laugh. There it is
again! It is a monkey in the forest, yelling. It sounds more like a cry, a
death cry. The sound starts to diminish, as the creature dies. This is the
law of the jungle, and you must also follow this law.
[Exits: north east west]

[H:8462/9000 V:899/900 M:906/906] [VNUM:60199] > e
You walk east.
The Great Grasslands [Outdoors Field]
This section of the grasslands leads to an ancient forest which has
existed for centuries. The grass is getting more and more alive as you
approach the nature which is of the forest. You see many more animals and
different types of plants as you get closer to the forest.
[Exits: north east west]

[H:8462/9000 V:898/900 M:906/906] [VNUM:60198] > e
You walk east.
The Great Grasslands [Outdoors Field]
You hear a loud noise in the distance, almost like a laugh. There it is
again! It is a monkey in the forest, yelling. It sounds more like a cry, a
death cry. The sound starts to diminish, as the creature dies. This is the
law of the jungle, and you must also follow this law.
[Exits: north east west]

[H:8462/9000 V:897/900 M:906/906] [VNUM:60197] >


hope this helps!



www.modmud.com
modmud.com:7500

"There is not one shred of evidence that life is supposed to be serious."
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Jun 29, 2002 11:46 am   
 
Pretty much what I expected. The mapper only completes a move when it detects the prompt. In order to do the coloring you will have to trigger as you are and store the category. Then trigger on your prompt to color the room.
Reply with quote
appleeater
Beginner


Joined: 05 Apr 2003
Posts: 19

PostPosted: Mon Apr 07, 2003 11:24 am   
 
Hey ZMud Guru's

Looks like exactly my issue here too.

It colors the room after ive moved out of a room - and then colors the previous room.


Re the final reply above Viji, forgive my ignorance, but how do i do the above?


Cheers and Thanks
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Apr 07, 2003 2:21 pm   
 
Your prompt trigger most likely is set to Trigger on Newline and not on Prompt.

Also, when the new public version comes out soon, it will have an onroomcreate alias that is callled whenever the mapper finishes creating a room. This alias is perfect for this.

Kjata
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Apr 08, 2003 1:54 am   
 
I would suggest waiting for the next public version as well. If you can not wait for full automation then use a macro key to preform any post room creation events. I used NUM5 for years for this purpose. While in map mode it would do cleanup, and when in follow mode it would preform the normal look. The way map mode is detected is by the state of the Automapper class, read the help on the %trigger function if you want to go this route.
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