Timed events start before I get to right layout

Get help using Construct 2

Post » Wed Oct 16, 2013 3:47 am

@plinkie

Hey plinkie and everyone! Sorry responding took a long time, I have been very busy lately. Here is a test .capx for the problem I am still facing.
SpawnTest1.0

You will notice that enemy spawn times are different if you start from the menu (layout 1) than if you start from layout 2 the actual game scene. So please check it out for me. I set up a global variable text that is initially set to off, but when the yellow block falls on the player at the beginning of the layout it sets it to on. I tried to make my events so that the enemies only start to spawn once the variable is on but it still doesn't work properly. Basically I only want my spawn events to start when layout 2 is started, if you guys could help me out with this I would be extremely happy. Thanks much in advance!   
B
8
S
1
Posts: 42
Reputation: 1,159

Post » Wed Oct 16, 2013 6:45 am

Wouldn't it be easier to use the timer behaviour, set the timer to thirty seconds and on timer create enemies and set timer again?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Oct 16, 2013 7:40 am

[QUOTE=33miles] @plinkie

Basically I only want my spawn events to start when layout 2 is started, if you guys could help me out with this I would be extremely happy. Thanks much in advance!    [/QUOTE]

Try this:


It's not so different from your approach.

Have fun.
B
19
S
2
G
1
Posts: 23
Reputation: 1,473

Post » Wed Oct 16, 2013 9:29 am

@moonworx

Thanks for the suggestion moonworx, but it did not work for me. I set it up just like your screenshot and it played just like the way it was originally. Thanks anyway! Do you have any other ideas?

@LittleStain

I don't have much experience with timers. Could you explain in a bit more detail how I could make this work the same way by using them? I really appreciate it!

Thanks and please respond soon!
B
8
S
1
Posts: 42
Reputation: 1,159

Post » Wed Oct 16, 2013 9:38 am

I could try to explain the timer behaviour, but this link will do

Scirra Manual: Timer behaviour

in essence you can decide, when the timer starts (and for what period of time) and what should happen when the timer ends. So if you set the timer for thirty seconds you could set the creation of enemies on timer end and restart the timer for thirty seconds and repeat and repeat....
So every thirty seconds the enemies would be created, but you can adjust everything through events and conditions ofcourse.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Oct 16, 2013 11:52 am

Hey LittleStain! Thanks for getting back to me so quickly. I read the link you supplied and tinkered a bit but am still not knowing how to use these properly. My main problem is that I am unsure of how to set up a timer event that spawns an enemy in a certain place, the conditions and actions just don't seem to be available where I would think they should be. Like I can't use the condtion (on start of layout) and have the proper timer actions to go along with it. Also after I learn how to do this will timers succeed where my every x seconds events failed?

I'm just trying to get my enemies to start spawning at the proper time only when I'm on the actual level layout and not while I'm on the menu screen layouts. I don't really see why the original logic in my .capx that I shared on here didn't work...

So please LittleStain could you give me a short little example of an enemy spawning event with timers just so I can see the process of how to form them? I'm sorry for all the questions, but I am very thankful for everyone who has replied. Respond when you can please, thanks much. Here is my demo .capx again for easy reference. SpawnTest1.033miles2013-10-16 11:58:21
B
8
S
1
Posts: 42
Reputation: 1,159

Post » Wed Oct 16, 2013 12:02 pm

You could:

Create a sprite, call it timersprite, set it invisible and give it the timer behaviour.

system on start of layout (or after start button pressed or whatever event you want) - timersprite : start timer duration: 30 tag: "enemyspawn"

add another event:

timersprite : on timer "enemyspawn - create object "robot" on layer 2 (x:12751,y:430)
                                      - timersprite: start timer duration: 30 tag: "enemyspawn" LittleStain2013-10-16 12:03:04
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Oct 16, 2013 12:15 pm

Thanks sooo much LittleStain! That example is logical to me. I'll try it out after a few hours sleep and let you know how it goes. Have a great night, well early morning I guess I should say hehe. Thanks again for all your help!
B
8
S
1
Posts: 42
Reputation: 1,159

Post » Fri Oct 25, 2013 12:38 am

It worked! Your a genius LittleStain! Thanks for all your help buddy.
B
8
S
1
Posts: 42
Reputation: 1,159

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests