Originally Posted by AndyUK Instead of using a counter use one of the enemy's alterable values. The alterable values will be unique to the enemies and something like
'set enemy's value A to Random (50)'
will put a different random number in each of the enemies values.
It seems to work well, but it seems that I will need to create a counter so that they will alternate directions and stand idle at random intervals.
I'm sorry but i strongly disagree with one man army. Because of his use of spreading a value. The problem being it can cause problems down the road matching up who is currently moving.
lets face it spread value sucks. It never stays constant as the number of enemies grow.
I recommend using pick one at random and storing it's fixed. Then if the alterable that buffers the fixed isn't zero use the condition pick object by fixed and then set its alterable that moves it to Random(3)
add a on every timer condition to go with the pick object to control the intervals
Granted one man army has code that works perfectly fine. Except it will require you to learn all the in and outs of spread number and fastloops. Which is something you should learn anyways.
It all comes down to coding style and taste. But not every project requires fastloops. I think they are way over used.
Setting a value of the object to a random number should work for multiple objects, in the way that they each receive a random number.
What might be even simpler and shorter is setting multiple directions of an object, because an object can only have one direction at a time, that one will be (randomly) selected for ya.
Moving left or right can be done that way, by setting both left and right in the direction setter window.
So by storing some variable movement data, each enemy can be of the same object and act differently depending on those variable values. Which can be set with some kind of random number generator (expr. calc. or directions).