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
Murdlih
Beginner


Joined: 17 Dec 2001
Posts: 24
Location: USA

PostPosted: Mon Dec 17, 2001 9:19 pm   

Variable help
 
I can't get any of my variables to work. One of the main things I am trying to do is to set variables for my health / concentration values. I get my input as such:

HP: [393/393] CONC: [542/542]

and while trying to figure out how do do this, I came up with this unsuccessful trigger

HP: &{curhp}/&{maxhp} CONC: &{curcp}/&{maxcp}

to try and set the values every time my status bar comes up. it hasn't worked. Also, I would like to have other variables that could be set and tested within triggers, but have not been able to figure it out.

thanks a lot
Reply with quote
Murdlih
Beginner


Joined: 17 Dec 2001
Posts: 24
Location: USA

PostPosted: Mon Dec 17, 2001 10:12 pm   
 
not that anyone has responded, but I was going through old posts and found this trigger for exactly what I am trying to do

#trigger {HP: ~[(%d)/(%d)~] CONC: ~[(%d)/(%d)~]} {#VAR hp %1;#VAR maxhp %2;#VAR conc %3;#var maxconc %4}

but it still does not seem to be working...
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Mon Dec 17, 2001 10:49 pm   
 
Do you have the trigger set to prompt if it's a prompt? Also, what about it doesn't work? The whole thing? Have you verified that it even fires the trigger? Throw in a couple of #show lines in there to see if anything comes up.

Iljhar
Reply with quote
Murdlih
Beginner


Joined: 17 Dec 2001
Posts: 24
Location: USA

PostPosted: Mon Dec 17, 2001 10:49 pm   
 
HP: ~[&%d{curhp}/&%d{maxhp}] CONC: ~[&%d{curcp}/&%d{maxcp}]

worked for me, and it set up variables under my variable menu that appear to be set and can be accessed from other triggers, etc. my next question is, if a variable is not under the variable menu, can it exist? I am trying to set up other variables to keep track of my states, (i.e. hidden, monster flagged, lowcp) but am not quite sure how to do so

thanks
Reply with quote
Amaranth
Newbie


Joined: 17 Dec 2001
Posts: 1
Location: USA

PostPosted: Mon Dec 17, 2001 10:58 pm   
 
Murdlih, the trigger you found works perfectly. I was able to test it with exactly what you provided in your previous post and it set the variables up fine.

However, there is one thing you need to do.

Go to your pull down menu, under View > Preferences > General > Script Parser

Uncheck the box that says, "Allow [] for eval"

This should free up your [] for use with Triggers and the like.

Good luck.

-Amaranth
Reply with quote
Murdlih
Beginner


Joined: 17 Dec 2001
Posts: 24
Location: USA

PostPosted: Wed Dec 19, 2001 12:32 am   
 
Perhaps I am an idiot, it is very probable that that is the case, but when I use the

HP: ~[%d/%d~] CONC: ~[%d/%d~]
#VAR curhp %1
#VAR maxhp %2
#VAR curcp %3
#var maxcp %4

trigger I get a message showing my variable names and the word variable, but no numbers set. I manually set one of the variables and it showed up when my triggger fired, but did not set the new value.

If anyone knows what I am doing wrong, I would appreciate it. Also, if anyone could tell me how to not get that "curhp variable" to show up I would appreciate it. It is cool when I try to get things to work, but clutters my screen (assuming I ever get it to work)

If not, oh well, I will just play my game.
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Wed Dec 19, 2001 1:32 am   
 
quote:

Perhaps I am an idiot, it is very probable that that is the case, but when I use the

HP: ~[%d/%d~] CONC: ~[%d/%d~]
#VAR curhp %1
#VAR maxhp %2
#VAR curcp %3
#var maxcp %4

trigger I get a message showing my variable names and the word variable, but no numbers set.


To capture the data you must enclose the pattern matching symbols in parentheses:

HP: ~[(%d)/(%d)~] CONC: ~[(%d)/(%d)~]
#VAR curhp %1
#VAR maxhp %2
#VAR curcp %3
#var maxcp %4


Troubadour
Reply with quote
Murdlih
Beginner


Joined: 17 Dec 2001
Posts: 24
Location: USA

PostPosted: Wed Dec 19, 2001 8:52 pm   
 
thanks so much! YAY
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Dec 20, 2001 8:22 pm   
 
Of course, you could have just changed the variable names in that old trigger to the ones you preferred, it already had the parentheses.

#trigger {HP: ~[(%d)/(%d)~] CONC: ~[(%d)/(%d)~]} {#VAR curhp %1;#VAR maxhp %2;#VAR curcp %3;#var maxcp %4}

LightBulb
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