Seperate Every Random Second Event For Same Instance

Get help using Construct 2

Post » Tue May 09, 2017 6:53 pm

So I have 9 sprites that has many variables such as engine speed, downforce, driver skill etc. In the event sheet I use event such as Every random 1-3 seconds to calculate something. The problem here is that random even is useless here as if let's say 1.5 were chosen from 1 to 3 range it would apply to all 9 sprites, but I want this to happen just to single sprite.

I tried using "For Each" however that doesnt work, and it only makes the event work for single sprite.
Image
Last edited by deropke2 on Tue May 09, 2017 7:24 pm, edited 4 times in total.
B
5
S
2
Posts: 28
Reputation: 541

Post » Tue May 09, 2017 7:21 pm

Try "picking" the sprite you want to change in the "condition" of the event that makes changes to instance variables.

Some tasks take time to complete. Just ask yourself if you want to develop something fast, or something of quality.
B
46
S
13
G
7
Posts: 32
Reputation: 5,678

Post » Tue May 09, 2017 7:27 pm

SEGamestudio wrote:Try "picking" the sprite you want to change in the "condition" of the event that makes changes to instance variables.

Some tasks take time to complete. Just ask yourself if you want to develop something fast, or something of quality.


I don't know what you really mean, I added screenshot though,anyways I would be down of making all events seperatly for each sprite, however I don't want to because it would be really hard to edit anything and it's something I can't get right the first time.
B
5
S
2
Posts: 28
Reputation: 541

Post » Tue May 09, 2017 7:34 pm

Use the Timer behavior to set a period for each object.

https://www.scirra.com/manual/167/timer
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Tue May 09, 2017 7:36 pm

Try using timers. Like this :

Image
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Tue May 09, 2017 8:04 pm

Magistross wrote:Try using timers. Like this :

Image


Why multiple timers doesnt work at once ?
B
5
S
2
Posts: 28
Reputation: 541

Post » Tue May 09, 2017 8:41 pm

Not quite sure what you mean by that.
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Tue May 09, 2017 9:09 pm

Magistross wrote:Not quite sure what you mean by that.

Image

I made two timers, but only one work at the time.
Last edited by deropke2 on Tue May 09, 2017 9:17 pm, edited 2 times in total.
B
5
S
2
Posts: 28
Reputation: 541

Post » Tue May 09, 2017 9:16 pm

In the On Timer trigger, you need to restart your timer with the same action that started it, to get a new random value.
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Tue May 09, 2017 9:19 pm

blackhornet wrote:In the On Timer trigger, you need to restart your timer with the same action that started it, to get a new random value.


how would I do that, I can only find "Start timer" or "Stop timer" event
B
5
S
2
Posts: 28
Reputation: 541

Next

Return to How do I....?

Who is online

Users browsing this forum: ditocruz, dop2000, RalleRoyal and 29 guests