attributes
ds1239
Member Posts: 33
i need an attribute that doesn't go into negatives but does go into decimals.
Comments
On Rule
"if Attribute < 0.00" Set To 0.00
Someone please correct me if I'm wrong or there's an easier way.
Boolean (can't do numbers unless you count 0 and 1)
Text (can display numbers but can't do math with them)
Real (decimals!)
Integer (no decimals)
Index (no decimals; Mac only)
Angle (no decimals)
So knowing that your only choice is Real, you would need to change or constrain the value to a positive number:
(see @Socks' answer below)
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
From the GS cookbook:
abs
Usage: abs(x)
The absolute value of the number. i.e. make the number positive if it is negative.
Examples:
abs(-42) = 42
abs(42) = 42
So therefore in a game using @Socks technique we can replicate this reality, so that even if your reversing, it shows the speed as a positive number. Otherwise, it would display as a negative number!
Useful!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Like this: