Spawning more than 1 enemy using every and random and every timer
luke2125
Member, PRO Posts: 225
Hi,
I'm like 90% finish with my Kindle Game, however, I've run into a roadblock, and would appreciate any help regarding the below code:
Timer - Every 5 Seconds - Run to Completion
Change Attribute - game.enemychallengerand To random ( 1, 3 )
When All Conditions Valid: Attribute.gameenemychallengerand = 1
When All Conditions Valid: Attritube.gameenemychallenge < 3
Timer - Every 0.3. Seconds - Run to Completion
Spawn Actor: underwaterchallenge1 : Front Layer, Direction: 0: Position: random (x,y), Position random (x,y) Relative to Actor
In underwaterchallenge1: I have Change Attribute: game.enemychallenge to game.enemychallenge+1, and the rest of the movement behaviors....Just like enemychallenge 1 and enemychallenge 3 which equals 3, hence random ( 1,3)
Now, I'm trying to randomly spawn 3 actors every 60 seconds, but coming from different directions. Ex: if enemychallengerand =1 then spawn that actor, if =2 spawn that actor. However, this code is not working. I have the spawner on the scene ( not visible on the scene ). Would appreciate any help regarding this....Thanks and God Bless....
Sincerely,
Sunday
I'm like 90% finish with my Kindle Game, however, I've run into a roadblock, and would appreciate any help regarding the below code:
Timer - Every 5 Seconds - Run to Completion
Change Attribute - game.enemychallengerand To random ( 1, 3 )
When All Conditions Valid: Attribute.gameenemychallengerand = 1
When All Conditions Valid: Attritube.gameenemychallenge < 3
Timer - Every 0.3. Seconds - Run to Completion
Spawn Actor: underwaterchallenge1 : Front Layer, Direction: 0: Position: random (x,y), Position random (x,y) Relative to Actor
In underwaterchallenge1: I have Change Attribute: game.enemychallenge to game.enemychallenge+1, and the rest of the movement behaviors....Just like enemychallenge 1 and enemychallenge 3 which equals 3, hence random ( 1,3)
Now, I'm trying to randomly spawn 3 actors every 60 seconds, but coming from different directions. Ex: if enemychallengerand =1 then spawn that actor, if =2 spawn that actor. However, this code is not working. I have the spawner on the scene ( not visible on the scene ). Would appreciate any help regarding this....Thanks and God Bless....
Sincerely,
Sunday
Comments
. . . . etc etc
Basically the question is a little confusing, is there any way you could make it a little clearer ?
Thanks for the quick response and help, but I figured it out, I was missing the following:
Change Attribute: game.enemychallenge to 0. In other words, I had to reset this attribute so it will begin to spawn again, since I have a Rule - > Change Attribute: game.enemychallenge < 7, so it was doing it the first time, spawning the enemies, but only once. Now, it's working like it's supposed to. Sometimes in a game, the most simple thing is what's missing....Thanks again for your help and God Bless.....
Sincerely,
Sunday