Randomizer triggering both possible behaviors
Backtothis
Member, PRO Posts: 75
This is an extremely simplified down version of a question I asked a couple days ago that wasn't able to be resolved. I've narrowed it down as follows:
Initialize State:=1
Timer every 1 second
-->When game.State = 1
---->DisplayText "1"
---->Otherwise
------>When game.State = 2
--------->DisplayText "2"
-->game.State = random(1,2)
What happens is that sometimes, "1" will be displayed, sometimes "2" will be displayed, and sometimes both "1" and "2" will be displayed. Whatever is causing the "1" and "2" at the same time behavior explains my previous problem.
The project file I uploaded to http://www.filesnack.com/files/ct9qdilj
All the logic is in the spawner actor and is literally as short as it sounds but I can't figure out what I'm missing.
edit - look at the spawner on the scene not the prototype, I just noticed the prototype is a super old version that is out of date because it referenced variables that were cut out to simplify the problem as I was trying to figure it out.
Initialize State:=1
Timer every 1 second
-->When game.State = 1
---->DisplayText "1"
---->Otherwise
------>When game.State = 2
--------->DisplayText "2"
-->game.State = random(1,2)
What happens is that sometimes, "1" will be displayed, sometimes "2" will be displayed, and sometimes both "1" and "2" will be displayed. Whatever is causing the "1" and "2" at the same time behavior explains my previous problem.
The project file I uploaded to http://www.filesnack.com/files/ct9qdilj
All the logic is in the spawner actor and is literally as short as it sounds but I can't figure out what I'm missing.
edit - look at the spawner on the scene not the prototype, I just noticed the prototype is a super old version that is out of date because it referenced variables that were cut out to simplify the problem as I was trying to figure it out.
Comments
Anyway, I'll take a look at the file...
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Timer every 1 second
-->When game.State = 1
---->DisplayText "1"
---->Otherwise
------>When game.State = 2
--------->DisplayText "2"
-->game.State = random(1,2)
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
When game.State = 1
can be simultaneously evaluated as true and false even with some strange order of the random function being executed... but wow lol. Thanks a lot xD
The fix in all its humor lol. Taking it out did miracles.
edit - Also I did all sorts of moving order around with the timer. The problem is literally if it stays in the timer, no matter what order it's in, it will bug out like that. Even if you put the random function AFTER the display text, within each rule block, it will bug out.
So like
When game.State = 1
-->Display 1
-->game.State=random(1,2)
Otherwise
-->When game.State = 2
---->Display 2
---->game.State=random(1,2)
Even that won't work right. And the timer is a 1 second timer so you'd think that the commands would definitely have plenty of time to execute but idk lol. Either way taking the rule out of the timer fixes it.