Wait bug or not ?

Discussion and feedback on Construct 2

Post » Tue Apr 02, 2013 8:00 pm

Not necessarily - you can have a subevent which tests some conditions, and the subevent won't run or test its conditions until after the 'Wait' resumes.
Scirra Founder
B
357
S
214
G
72
Posts: 22,946
Reputation: 178,228

Post » Tue Apr 02, 2013 8:48 pm

Yeah, but I would guess you would be dealing with changing variables back and forth all withing one event. That can get pretty complicated.

The only other thing I could say is that picking with wait might be an issue, where the behavior should have none.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Tue Apr 02, 2013 10:48 pm

@newt - That sounds like a good idea. I've always longed for such a feature. I Did not like having to create an instance variable just for a custom timer for each feature I wanted. The wait command is not that usable for such a feature.
B
21
Posts: 23
Reputation: 2,429

Post » Wed Apr 03, 2013 8:02 am

[QUOTE=Ashley]
then the loop completes immediately, but schedules ten "Append text" actions all after one second. After one second all ten of them run. Note the original example uses loopindex so it sets up a 0 second delay, then a 1 second delay, then a 2 second delay, etc. whereas you use a constant delay, meaning the entire loop is basically done instantly after a single delay.

[/QUOTE]

Ashley, I know but this doesnt work. I make "Wait Loopindex * 2" This should mean every 2 seconds 1 loop. But nope.

+ repeat 3 times
-> Wait loopindex * 2
-> Console.Log("Fire")
-> Spawn Image on Imagepoint("loopindex")

This does:
Second 2: "Fire" + nothing
Second 4: "Fire" + nothing
Second 6: "Fire" + Spawn Image on Imagepoint("3")
Darklinki2013-04-03 08:32:59
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Thu Apr 04, 2013 9:16 am

Is there any different Tutorial or Example ?
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Thu Apr 04, 2013 1:58 pm

Your events don't make sense, unless you have an image point named "loopindex".
Scirra Founder
B
357
S
214
G
72
Posts: 22,946
Reputation: 178,228

Post » Thu Apr 04, 2013 2:20 pm

+ repeat 3 times tag:try
-> Wait loopindex("try") * 2
-> Console.Log("Fire")
-> Spawn Image on Imagepoint(loopindex("try"))

This does:
Second 2: "Fire" + nothing
Second 4: "Fire" + nothing
Second 6: "Fire" + Spawn Image on Imagepoint("3")


Tought you know what I mean with loopindex, is it now clear ? I try to spawn Images every X Seconds on the Imagepoints of a given Image ;)

B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Thu Apr 04, 2013 3:15 pm

Sharing a .capx is the clearest way to show what you mean and what isn't working.
Scirra Founder
B
357
S
214
G
72
Posts: 22,946
Reputation: 178,228

Post » Thu Apr 04, 2013 6:25 pm

[QUOTE=Darklinki]
Tought you know what I mean with loopindex, is it now clear ? I try to spawn Images every X Seconds on the Imagepoints of a given Image ;)
[/QUOTE]

I don't know the context of your code, but if you just want to spawn an image every few seconds why don't you just use this action then:

System -> Every 2 seconds: Spawn Image on Imagepoint("3")

Have fun

B
18
S
2
G
1
Posts: 23
Reputation: 1,448

Post » Thu Apr 04, 2013 8:17 pm

You will have to use a variable to do what you want, you just can't use loopindex with a wait.

the Wait will not "pause" the loop. The loop will continue to run normaly at max CPU speed and finish instantly.
2 seconds after, when your first "wait" countdown is finished, the loop already finished 2 seconds ago (instantly) and the loopindex will be null so you can't use it
Here is a screenshot of what i understood you wanted, i'm using a variable instead of the loopindex



the green sprite have 3 image point at different positionsMimiste2013-04-04 20:20:46
B
12
S
3
G
4
Posts: 62
Reputation: 3,408

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: Eisenhans, Triforce and 5 guests