Axe Software Forums
  Quest Developer Forum
  status variable


Author Topic:   status variable
gamer1962 posted 21-06-2002 04:15 BST     
I am trying to update a status variable. I have objects (coins) all about the game. When you take the coins it is suppose to update the status variable "coin" with the amount of coins you picked up. I cant seem t make this work.
all the coin objects have a property called "amount"
When the player pick them up the take script runs this code

take {
set numeric <coin; coin = coin + #coin2:amount#>
hide <coin2>
}

the objects name are coin1, coin2... they all have alias names of coins. The problem is that it changes the "coin" status variable to the value of the property "amount" of each coin object instead of adding the value of the property "amount" to the current value of the status variable "coin"

gamer1962 posted 21-06-2002 04:19 BST          
Looking at my own message I think I am using the wrong command for variables, Am I initializing a new varibale coin with the "set numeric" in my code?

Should I be using something like
%coin% = %coin% + #coin1:amount#
?

Computer Whizz posted 21-06-2002 22:16 BST          
You should be using:

set <coin; %coin% + #coin1:amount#>

Since the variable is declared as a status variable it doesn't need to be declaired again - and you just re-adjust the variable to %the variable% plus #collected coins#.

Computer Whizz