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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Wed Dec 24, 2008 11:02 pm   

[3.03a] Curvy brackets, db vars, and variable triggers.
 
Trigger pattern:
^\e[33m@{room.title}
fails unless I manually refresh the trigger in the package editor so that it realizes the variable has been updated.
^\e[33m@room.title
works perfectly.
For what it's worth, something like @{roomtitle} (not a db var) works fine, too.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Dec 25, 2008 12:15 am   
 
This is because the @{} syntax is used for indirect variable references - you shouldn't really be using them in trigger patterns. For example, if you were doing some kind of complex expression that resulted in a name of a variable - say, @{%%concat("stuff_",%%time(yyyy-mm-dd))}, there's no way for CMUD to know when it should be updating this trigger pattern, because it can't monitor that kind of complex return in the same way it can the value in a variable.

If all you're using it for is referring to simple variables like the two examples in your first post, just leave out the {} and it'll work. If you're doing something more complex, you should probably do the expression somewhere else and store the result in a variable that you use in the pattern. If your trouble is that characters after the (now removed) } are becoming part of the variable name, you can try using the octal \000 code for whatever comes after it, or you could use a single-character range like [e].
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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