Random monster spawn help

Get help using Construct 2

Post » Mon May 25, 2015 8:44 pm

I would like for a weak monster to spawn from a cave every 5 seconds, but I'd also like a strong monster to spawn every 30 seconds. It's important that the strong monster spawns in place of the weak monster instead of with it. Is this possible?
B
3
S
1
Posts: 8
Reputation: 344

Post » Mon May 25, 2015 9:10 pm

That is possible and not too hard.
Make a global variable.
Every 5 seconds add 1 to global variable
If global variable is smaller then 6 > Spawn weak monster
If global variable is equal to 6 > Spawn strong monster
> Set global variable to 0
Good luck ^^
It's time for me to return the favor :)
B
32
S
9
G
9
Posts: 132
Reputation: 5,370

Post » Thu May 28, 2015 6:33 pm

ikke2902 wrote:That is possible and not too hard.
Make a global variable.
Every 5 seconds add 1 to global variable
If global variable is smaller then 6 > Spawn weak monster
If global variable is equal to 6 > Spawn strong monster
> Set global variable to 0
Good luck ^^


Thanks! I will try that.
B
3
S
1
Posts: 8
Reputation: 344

Post » Thu May 28, 2015 8:51 pm

I did this recently with an special enemy that is spawned in an specific interval of time (3~8 seconds).

Set Enemy to floor(random(3,8))

"Enemy" is a global variable that is used in a later event that interrupt the commom enemies spawn.

System > Set group "commom enemies" deactivated
Generator > Spawn Special Enemy on layer 0
System > Wait 1 second
System > Set group "commom enemies" activated
B
39
S
9
G
3
Posts: 259
Reputation: 4,355


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 34 guests