Spawn Without Using Every X Second

Get help using Construct 2

Post » Sat Nov 23, 2013 2:05 am

So you have some idea of why I'm asking here is my original question which while I did get a lot of great responses I could get none of them to work.

ORIGINAL QUESTION:

I was wondering (And I wouldn't ask if I didn't try everything I can think of because I really am trying to learn how to do this properly) but I'm leaning so I need to ask question right now so I hope you can help please.

I have the spawns set at different Every Random X times. It starts off slow with just one and then another and then another so the longer you stay alive the more things are coming at you. (7 different random X spawn types) Yes, I am leaving the page on any hit of my hero or if he is pushed off the layout the game ends and takes you to option page to start again or go to the intro page.

If I take a while getting back to the game as soon as I hit the start game button I get all the spawns at once because the Every Random X is still counting even if I'm not playing the game.

In order to keep the gradual flow from easy in the beginning to harder the longer you play the Every Random X needs to start from 1 each the game is started. It's not doing that for me, once the game is started if it gets to 300 seconds when the harder enemies would appear after the first game if you want to play again you immediately start getting the harder spawns and many of them right away instead of starting slow abd then getting harder.

I did go back and group everything and tried the deactivate group but that did not work. I tried the the Pause Plugin and while it worked pausing it does not reset the Every Random X count.

The set time scale to "0" works fine but it's not resetting the Every Random X count.

I've tried everything I just want when the game ends to stop the spawn count and when the game start and I mean actual game play for it to reset the spawn count (Every Random X) so it starts from 1 second not at whatever time the game has been running, but actual game play time.

Is there a way to do that?

NEW QUESTION:

Is there a way to spawn objects without using every X second and then I won't have to worry about turning it off when the player dies.

Thanks
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
33
S
16
G
3
Posts: 358
Reputation: 5,398

Post » Sat Nov 23, 2013 2:33 am

Every X seconds is bound to game time (as you've noticed), so if deactivate it and later on reactivate it, every 10 seconds could fire off directly in less than 1 second or it could take up to 10 seconds till it fires off.

You have various options actually.
You could use timers (which ofc you can stop and start anew when the game starts again).
You could use cooldown variables.
You could write the current time into a variable and then later on substract time-oldtime to find out how much time passed


example:

on new game start: set oldtime = time

system compare - if time-oldtime > 5: spawn stuff, set oldtime = time
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Sat Nov 23, 2013 6:05 am

I could say Oh yeah thanks I will try that and pretend I know what you're talking about or I could be honest and say I kind of understand but not quite sure, and that would be the truth. I do appreciate it very much and thank you for taking the time to help.

I will do some research on what you have said and see if I can figure it out.

Thanks
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
33
S
16
G
3
Posts: 358
Reputation: 5,398

Post » Sat Nov 23, 2013 9:26 am


I created a variable called Difficulty with an initial value of 0. Also created another variable called Stage initially this is set to 0. On the Title screen whenever they click the play button or hit enter to play we set the Stage 1 variable to 1 and goto layout Stage 1. We have an event that says For Every 1 Second with the condition that Stage variable is = 1 then we add 1 to Difficulty. If the player dies, Difficulty is reset to 0 and Stage is reset to 0 and we goto layout Title Screen. Then you can have your different types of enemies spawn off a Pick Random Instance of a Spawn sprite. Saying if Difficulty is greater than 0 and less than 25 then spawn Easy Enemies. If Difficulty is greater than or equal to 26 and less than 50 spawn mid enemies. So on and so forth.

EVENT SHEET





I hope this helps.
Image
B
46
S
17
G
2
Posts: 201
Reputation: 4,526

Post » Sat Nov 23, 2013 10:38 am

I used an array.
check out my capx.
post on the second page
if you need another example for a cooldown system.
B
23
S
6
G
5
Posts: 132
Reputation: 4,487

Post » Sat Nov 23, 2013 4:57 pm

@VictoryX and philx Thank you soooooooo much!!!!

Ok! thank you for the visual I will get to work and let you know what I come up with.

@philx if and when you have the time yes I would like to learn all I can so cool downs would be nice to know as well...

Thank you.
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
33
S
16
G
3
Posts: 358
Reputation: 5,398

Post » Sat Nov 23, 2013 5:11 pm

@VictoryX. Ok, I think I'm following you... How do I group or tag the enemies so the random pick only picks from each difficulty group? Right now I have all my enemies grouped under "ENEMIES" when I pick a random spawn for the easy group, how do I tell it to only look at the easy group?

I'm sure it's there I'm just not versed enough to fully understand it yet but it makes great since and I do appreciate it.

Thank you
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
33
S
16
G
3
Posts: 358
Reputation: 5,398

Post » Sat Nov 23, 2013 5:20 pm

@VictoryX. (or anyone who may know) I think I get it I have to do it for each enemy and I have 9. 3 easy, 3 mid and 3 hard. So let me ask you, can I group them separately and then have the random pick choose any from that group?

Only one way to find out and that's to go try right?

Thanks, this will be a good start.

Thank you for your time and everyone who offered help thank you.
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
33
S
16
G
3
Posts: 358
Reputation: 5,398

Post » Sat Nov 23, 2013 6:21 pm

@VictoryX. Can you send me the capx? I'm stuck at the PICK A RANDOM SPAWN. It's only allowing my to pick from the objects I have already.

Yours is a black square and then it spawns is different object from your black square. I'm just not seeing those options to choose from.

Sorry to be so difficult I just have everything almost finished at this stage and I want to get past this part.

Thanks

NEVER MIND I GOT IT!!!!! Just Make a Sprite Called SPAWN!!!!ALLMarkMade2013-11-23 18:26:53
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
33
S
16
G
3
Posts: 358
Reputation: 5,398

Post » Sat Nov 23, 2013 7:59 pm

@VictoryX.... This is exactly what I wanted and needed. Thank you for teaching me something new. Seeing it really helped me understand it better.

This works well with my set up thank you and everyone.

I can move on now...
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
33
S
16
G
3
Posts: 358
Reputation: 5,398

Next

Return to How do I....?

Who is online

Users browsing this forum: Armench, Yahoo [Bot] and 20 guests