I’m trying to learn to use states when scripting AI for enemies and I’m having a hard time grasping on
what benefits states would give me over simple ‘status’ variable check.
I noticed that a controller can only have one state?
Or is there a way to have some scripts running no matter what the state is?
This is a slight issue for me since I would like to have some functions to be running all the time.
States are conceptual not different to properties.
The overall data of an object is state too ;).
It depends how you interpret the data.
You can implement state machines as you like:
build-in state machine
properties
any state machine implementation in Python
a mixture of the above methods
A controller can be assigned to exactly one state. This might require that you create additional controllers. In most cases this is a very minor issue (except for Python controllers). I guess this is for a simpler user interface.
Place them in a state that gets activated all the time (you can switch to multiple states).
see this state explaining thread