Change attribute back and forth between 1 and 2
iPhoneDevForMe
Member Posts: 362
I swear I have read how to do this somewhere but I CANNOT find the post!
Basically I just have an int attribute that I want to change every 15 seconds between 1 and 2
so:
1, 2, 1, 2, 1, 2, 1, 2.....ect
All I know is it involves the expression editor and modulus, just don't remember the formula!
Thanks for your time!
-Kyle
Basically I just have an int attribute that I want to change every 15 seconds between 1 and 2
so:
1, 2, 1, 2, 1, 2, 1, 2.....ect
All I know is it involves the expression editor and modulus, just don't remember the formula!
Thanks for your time!
-Kyle
Comments
Every 15 sec
Change attribute to ((attribute+1)%2)+1
You can take that any way you want haha!
My rule is set:
Every 15 sec:
-Change attribute to ((attribute+1)%2)+1
I am using display text to check, and it goes from 0 to 2, and stays that number. Any thoughts?
You will need 2 attributes to get that to work correctly...
Thanks alot for the detailed explantion barkbark!
Display text: attribute+1
Rule:
Every 15 sec:
-Change attribute to (attribute+1)%2
The rule gives you 1,0,1,0,1,0,1, etc...
You just need to add the +1 when you use the attribute.
Set attribute to 0
Change attribute to (attribute+1)%2
actor that uses this
Check for attribute +1 but do not add the extra 1 to attribute
Oops barkbark beat me
I should have got it right the first time cause i use tgus alot in mu games when i need an actor to be in two different location depending on some other attribute
A bit unrefined perhaps, but it works. 2 game attributes, bool OneTwo + int Switcher:
Might help you out, although there's no modulus involved or the expression editor though... so barkbark00 + jstrahan ideas could well work out better.
:-)
---------------------------------------------------------------
Spiral Gyro Apps
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps