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
Tulio
Newbie


Joined: 16 Jan 2004
Posts: 2
Location: Mexico

PostPosted: Fri Jan 16, 2004 9:04 am   

Triggers and Variables
 
Hello I'm pretty sure it will be a silly mistake but I can't find it

I have a trigger and I want that trigger to modify a variable (actually I have several triggers that modify several variables but I'll just show one). I did some testing in an offline screen of other mud and worked fine, but when I imported it to the actual mud it doesn't work.

#CLASS {Healing|Variables|Cohosh}
#TRIGGER {and you feel sleepy.} {vcohosh=1}
#CLASS 0

#CLASS {Healing|Variables|Kelp}
#TRIGGER {You lash out clumsily} {#add vkelp 1}
#CLASS 0

#CLASS {Healing|Variables}
#VAR {vcohosh} {0}
#VAR {vkelp} {0}
#CLASS 0

I don't know why the variables are not being updated, not even if I enter the #ADD vkelp 1 or the vcohosh=1 in the command line manually. Any idea?


Thanks for your time
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Jan 16, 2004 12:42 pm   
 
It works fine for me.

Try something simpler to see if the problem is with all variables:
#VAR test 2
#SH @test

should show:
2

#ADD test 1
#SH @test

should show:
3

#TRIGGER {testing} {#VAR test 5}
#SH testing
#SH @test

should show:
testing
5

#TRIGGER {hello} {#ADD test 1}
#SH hello
#SH @test

should show:
hello
6

#UNVAR test
#CLASS {Test}
#VAR test 1
#CLASS 0
#SH @test

should show:
Variable test removed
1

#ADD test 1
#SH @test

should show:
2

#CLASS {Test|TestTrigs}
#TRIGGER {testing2} {#VAR test 5}
#CLASS 0
#SH testing2
#SH @test

should show:
testing2
5

#CLASS {Test|TestTrigs}
#TRIGGER {hello2} {#ADD test 1}
#CLASS 0
#SH hello2
#SH @test

should show:
hello2
6
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jan 16, 2004 8:32 pm   
 
You probably have other variables, with the same names, in another class and the variables in the other class are the ones being updated.

zMUD allows you to address most settings without specifying the full path. When two settings of the same type have the same name you need to specify the full path.

#CLASS {Healing|Variables|Cohosh}
#TRIGGER {and you feel sleepy.} {#VAR Healing/Variables/vcohosh 1}
#CLASS 0

#CLASS {Healing|Variables|Kelp}
#TRIGGER {You lash out clumsily} {#ADD Healing/Variables/vkelp 1}
#CLASS 0

#CLASS {Healing|Variables}
#VAR {Healing/Variables/vcohosh} {0}
#VAR {Healing/Variables/vkelp} {0}
#CLASS 0
Reply with quote
Tulio
Newbie


Joined: 16 Jan 2004
Posts: 2
Location: Mexico

PostPosted: Sat Jan 17, 2004 3:19 am   
 
I don't have other variables named in that way. I did the test and seems to be working fine. I just deleted the whole setting and started to import small parts to see if there is a specific class causing a conflict, apparently having 2 tiggers with the same pattern and different values was the cause. As soon as I deleted that class it started to work fine.

Thanks a lot for your time and advice
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