3 problems!

Hi guys, need a lil' help here. Much appreciated in advance.
Basically I have a Player actor, and some random spawned baddies randomly walking around the screen.
Problem 1: Looping Spawning
I'm currently using a timer to spawn my baddies (10 of them). I would like them to spawn all at one go, but using the timer, even with value set to 0, they still spawn, though quickly, one after the other.
I've tried the interpolation DrGlickert started but I'm sure I'm doing it wrong cuz my baddies don't really spawn.
What I did:
actor.spawner(invisible controller)
>when game.spawn attribute is false, set it to true.
>when game.spawn attribute is true & when game.spawnlimit is <10, spawn actor.baddies.
actor,baddies
>when game.spawn attribute is true or when actor.baddie overlaps/collides with actor.background, set to false. (not sure about this one)
I don't know how to make the loop right, so that it constantly checks and updates its values. So anyway I succumbed to using a timer and got to problem2.
Problem 2:
As I've mentioned, my actor.baddies are randomly moving around the screen, it's their idle state.
These actor.baddies are tied down to the rules:
when
>game.idle is 1
>>timer: every 0 seconds, move to random place for another random number of seconds (no run to completion for all 3 rules).
when
>game.attack is 1
>>move to actor.player
(I have an in-game button that when down, attack goes on, and idle goes off btw.)
The problem is that now the baddies move like they're shivering during idle,
or if i turn run to completion on, they move fine, but they'll FINISH moving to their position set by their idle before switching to attack.
I like the latter option if i could somehow get the baddies to just halt their idle responsibilities and charge for the player.
Problem 3:
I'd like the baddies to keep chasing the player when game.attack is 1, and when game.lives are >0
Currently, they do chase the player to it's X & Y positions but somehow they stop chasing when they reach the player, even when lives are more than 0. How do I set the baddies to keep chasing until both, not just one, conditions are met?
Long post yea, but thought i'd be abit more detailed.
Thanks guys!
Basically I have a Player actor, and some random spawned baddies randomly walking around the screen.
Problem 1: Looping Spawning
I'm currently using a timer to spawn my baddies (10 of them). I would like them to spawn all at one go, but using the timer, even with value set to 0, they still spawn, though quickly, one after the other.
I've tried the interpolation DrGlickert started but I'm sure I'm doing it wrong cuz my baddies don't really spawn.
What I did:
actor.spawner(invisible controller)
>when game.spawn attribute is false, set it to true.
>when game.spawn attribute is true & when game.spawnlimit is <10, spawn actor.baddies.
actor,baddies
>when game.spawn attribute is true or when actor.baddie overlaps/collides with actor.background, set to false. (not sure about this one)
I don't know how to make the loop right, so that it constantly checks and updates its values. So anyway I succumbed to using a timer and got to problem2.
Problem 2:
As I've mentioned, my actor.baddies are randomly moving around the screen, it's their idle state.
These actor.baddies are tied down to the rules:
when
>game.idle is 1
>>timer: every 0 seconds, move to random place for another random number of seconds (no run to completion for all 3 rules).
when
>game.attack is 1
>>move to actor.player
(I have an in-game button that when down, attack goes on, and idle goes off btw.)
The problem is that now the baddies move like they're shivering during idle,
or if i turn run to completion on, they move fine, but they'll FINISH moving to their position set by their idle before switching to attack.
I like the latter option if i could somehow get the baddies to just halt their idle responsibilities and charge for the player.
Problem 3:
I'd like the baddies to keep chasing the player when game.attack is 1, and when game.lives are >0
Currently, they do chase the player to it's X & Y positions but somehow they stop chasing when they reach the player, even when lives are more than 0. How do I set the baddies to keep chasing until both, not just one, conditions are met?
Long post yea, but thought i'd be abit more detailed.
Thanks guys!
Comments
a little demo/template… http://www.mediafire.com/download.php?692lg943pa1afjl
@};- MH
Ok I've tried the demo, but it doesnt actually help me solve problem 2 and 3.
Even though the baddies have been activated to attack, they will still finish their idle rules before doing so.
And after reaching the player's XY, the baddie just stops attacking even if the player still has lives.
Also I have a problem, I've noticed that in the demo @MotherHoose has an interpolate to the movement of the baddies where to "To" is an expression editor. Why does mine always stay as 0? I tried typing expressions in myself but it would only accept numerals. Sorry for this noob question.
No matter, I have another question!
If i have 2 groups, 1 friendly and 1 baddie, how do i make them hostile towards one another? whereby they will "attack" the closest enemy? Please note that its 2 groups of multiple actors!
Thanks again!
the things you type are operants/modifiers that you want to do on the values of the attribute
of course that little demo isn't going to do all the work for you … just get the Baddies moving in the right direction
it is for spawn of 10 at the same time and idle behavior and chase behavior
you will have to decide when they should (and how they should) actually attack the player
I don't know what the mechanics of your game are
take a step back in your new scenario … work on getting 1 enemy and 1 friendly to behave correctly …
after that it should be easy to get as many as you want to perform correctly
you will get there!
@};- MH