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


Joined: 01 May 2003
Posts: 20

PostPosted: Thu May 08, 2003 10:11 pm   

Weird variable problem
 
I'm using the variable coins to keep track of my silver.

When I pick up silver, I have a trigger

#tr {you gather the remaining (%d) coins} {#add coins %1}

But, instead of adding it, it's placing it next to it.

So instead of having 200 coins when I pick up 200, I have 0 200. What am I doing wrong here?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri May 09, 2003 1:31 am   
 
It appears that the original value is being treated as a string. @coins was probably {0 }

ie:
Behaviour as a string
#VAR atest1 a
#ADD atest1 1;#SH @atest1

Behaviour as a number
#VAR atest2 0
#ADD atest2 1;#SH @atest2

So check coins for its default value and/or reset it
#VAR coins 0
Ton Diening
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