Every X seconds independent for same objects

Get help using Construct 2

Post » Tue Nov 19, 2013 6:48 pm

Yeah cool :) And I know your pain, I went through it just after timers were released and I was defiant to use them, for no reasonable reason. I created ways to do it, but all were harder without the added extras, so I strongly suggest you get comfortable with them to just make life that little bit easier.

Also something you might find relevant one day: every X seconds counts from start-up and not from start of layout. I once had two different layouts that ran scripted scenes and they both worked perfect alone. But when I tried to make one lead into the other, the timing was all messed up. I spent a damn long time trying to figure that one out! xD

EDIT: Actually I should add that timer behaviour is great for small things like this, but if you want a comprehensive timer system that allows pausing, dt adjustments and conditional count-downs etc., you still need a well evented system. I spent a long time refining separate, co-functioning timer systems for my RPG. The biggest hassle I came across was no way to reference the dt of an array, but that's a whole other story ^^

Another thing to remember is that the timer behaviour will count down using the dt of the instance using the behaviour. This can be a blessing or a curse, so remember it if you ever have the need to play with dt!Tobye2013-11-19 19:07:15
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Tue Nov 19, 2013 7:32 pm

So if my variable WAIT is 4 which suppose to resemble 4 sec, it's not gonna be 4 secs in the timer, right?

[email protected] We might be in the same boat, as what I'm doing is a sequential movement for objects, like spikes, so they do things one by one within the group. megatronx2013-11-19 19:33:59
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
93
S
30
G
22
Posts: 1,987
Reputation: 20,203

Post » Tue Nov 19, 2013 7:57 pm

Uff, man, Thanks so much for your help. I've made it!

I don't even know why it's working, but somehow it is! >.> Hopefuly it wont cause much lag when quite a few of those will be on screen. Now got to expand on it.



[email protected] BTW, can I pull it of with families? As it stand, both container and spikes are in the same family.
megatronx2013-11-19 20:00:23
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
93
S
30
G
22
Posts: 1,987
Reputation: 20,203

Post » Wed Nov 20, 2013 11:24 am

Cool! Glad to see you got it :) Why this one works and the other didn't, is that you put 'on start of layout' condition above the 'for each'. So it only triggers once, instead of every tick. The thing to look out for here though is that any objects created after the start of the layout will not have their timers activated (which is why I prefer to use one of my other methods).

And yep, definitely works with families. And there should be no noticeable effect on performance, I have have 100+ objects with timers going and saw no impact, unlike my evented timers which did cause some drain.
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Wed Nov 20, 2013 1:08 pm

Thanks buddy,

I've already go whole level spawning system programmed and already did add the timer there. Here is just to see if its working. ;)

My game is a shooter so that's why I'm bit worried. A lot of enemies on screen.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
93
S
30
G
22
Posts: 1,987
Reputation: 20,203

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests