|
Kaishaku Beginner
Joined: 01 May 2003 Posts: 20
|
Posted: 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? |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: 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 |
|
|
|
|
|