constrain an attrib to a number from a range?
pjnolen
Member Posts: 152
Should be easy. I want to constrain or change, whichever is proper, a number to an attribute from a range of numbers.
for example the game generates a number from 100 -500. Let's say it generates 385.76
Well i want to record that in an attribute as any number from 350-400 will be recorded as just the number 7.
I tried just typing in rule "if attribute game.mynumber = 350-400
but it doesn't like that. Probably thinking I'm wanting to subract. Is there a way to show a range inside that box? without having to make another attribute and changing one into the other then back into my rule?
for example the game generates a number from 100 -500. Let's say it generates 385.76
Well i want to record that in an attribute as any number from 350-400 will be recorded as just the number 7.
I tried just typing in rule "if attribute game.mynumber = 350-400
but it doesn't like that. Probably thinking I'm wanting to subract. Is there a way to show a range inside that box? without having to make another attribute and changing one into the other then back into my rule?
Comments
new rule:
if attribute game.mynumber > 350
if attribute game.mynumber < 400
Then
Change attribute game.othernumber = 7
(So essentially its saying, if the generated number is bigger than 350, and smaller than 400 then make the othernumber attribute = 7.
Make sure the attribute you are working with if you want it to include decimals