How do I prioritize actions?
NightlyShadow
Member Posts: 0
Hi! I'm fairly new to game salad and I'm trying to make some form of an AI for an enemy actor. One of the actions that it's supposed to do randomly is move right a few pixels, rotate few degrees so it's looking down, and jump into a sort of "portal" actor. However, I can't get it passed rotation. It rotates then moves. Is there anyway I can control the order? Thanks in advance!
Comments
You can make a 'self' variable called 'state'.
When you open up your actor, its info (e.g. position, size) are in the window on the left.
At the bottom of this window are +/- buttons - pressing '+' will make a new self.variable
You can choose the type - let's make an 'integer' one (whole numbers) and call it 'state'.
Set it to 0.
Now you can break up your actions into state numbers:
Essentially, when it's finished a state add a 'change attribute' behaviour to make self.state = self.state +1
Each state would have a rule:
Hopefully that'll give you a start!
QS =D
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io