Incrementing a numeric variable
Drummerchar32
17 Apr 2006, 02:48Can anyone tell me how to increment a numeric variable by another numeric variable that has been divided by a number, say, 5?
Example:
Increment numeric variable %gold% by %points% / 5
I've tried that but it doesn't seem to work and just ignores the / and the 5. I don't use ASL so please don't try to tell me how using code.
Thanks a lot,
Drummerchar32
Example:
Increment numeric variable %gold% by %points% / 5
I've tried that but it doesn't seem to work and just ignores the / and the 5. I don't use ASL so please don't try to tell me how using code.
Thanks a lot,
Drummerchar32
MaDbRiT
17 Apr 2006, 06:56Hi
In Quest, Increment means 'increase by one' so your example above actually doesn't really make sense. Also Quest doesn't deal in decimal places, only whole numbers, so division often doesn't produce the result you'd expect. Added to that you can only use very simple expressions.
Apart from making sure your points variable still makes sense if divided by 5,
what you need to do is break the operation down into two stages, set up another numeric variable and set it to %points% / 5, then set gold to %gold% + %another_numeric_variable_name%.
Al
Can anyone tell me how to increment a numeric variable by another numeric variable that has been divided by a number, say, 5?
Example:
Increment numeric variable %gold% by %points% / 5
I've tried that but it doesn't seem to work and just ignores the / and the 5. I don't use ASL so please don't try to tell me how using code.
Thanks a lot,
In Quest, Increment means 'increase by one' so your example above actually doesn't really make sense. Also Quest doesn't deal in decimal places, only whole numbers, so division often doesn't produce the result you'd expect. Added to that you can only use very simple expressions.

Apart from making sure your points variable still makes sense if divided by 5,

Al
Drummerchar32
17 Apr 2006, 23:07I tried it and it worked, thanks for the help!
-Drummerchar32
-Drummerchar32