[r122] loopindex call error after wait action

Bugs will be moved here once resolved.

Post » Sun Mar 17, 2013 4:08 pm

Link to .capx file (required!):
http://www.mediafire.com/?i68888z615g2udl

(simplized one for this report.)

Steps to reproduce:
make event like this. and test (preview) it.

Condition : Start of layout (for not looping endless)

Sub Event :

__ Condition : (system) Repeat (Any...? count. Didn't test)
__ Action1 : (system) wait loopindex * 20
__ Action2 : (system) (system) create some object at (loopindex * 10, 0)


Observed result:

error message on test game. Node-js exported one freezes.

Expected result:

spawn some object gradually (in time and position)

Browsers affected:

Chrome: not checked, but node-js exported one freeze.
Firefox: yes
Internet Explorer: yes

Firefox give me an error message.

-----------------------------------------------------
Javascript error!
TypeError: this.runtime.getCurrentLoop(...) is undefined
http://localhost:50000/system.js, line 1400 (col undefined)

This is either a bug in Construct 2 or a problem in a third party plugin or behavior - please report it to the developer!
-----------------------------------------------------

Operating system & service pack:

Win 8 Pro K, x64

Construct 2 version:
   
r122 (beta)Ch_Softblow2013-03-17 16:26:23
B
45
S
9
G
7
Posts: 73
Reputation: 7,518

Post » Mon Mar 18, 2013 2:07 pm

Thanks, should be fixed in the next build. Note these events still won't do what you expect, because by the time you wait 0.1 seconds the loop has finished so loopindex won't be set to anything.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Wed Mar 20, 2013 9:45 am

That's sad, okay, thank you for information.
B
45
S
9
G
7
Posts: 73
Reputation: 7,518

Post » Fri Mar 29, 2013 11:48 am

@Ch_Softblow - I am trying to do something similar. I am doing a loop, waiting loopindex seconds to stagger when a sprite appears, then using loopindex to get the correct sprite out of an array. Doesn't work because of what Ashley says above. Did you come up with a solution?
B
32
S
7
G
8
Posts: 312
Reputation: 8,467

Post » Fri Mar 29, 2013 4:52 pm

@Manley23
Create "Spawner" object for values. It soundw weird, but can be one of solutions, because "Wait" action does not save values, but remembers picked objects. You can access instance's value (instead of loopindex) via that spawner object. (and it's needed adding 1 to the value to spawner object.)

I don't know other ways for removing this bothersome object and actions.

Construct 2 is still intuitive, but some cases Event system was not fit for something I wanted. like object in same family picking (for overlap based z-index sorting.) ... That might be just my lack of knowledge. haha

*( I'm not native and some english might weird. plz understand. :D )
B
45
S
9
G
7
Posts: 73
Reputation: 7,518

Post » Sat Mar 30, 2013 1:18 am

Okay, thanks for the information. I was able to figure out a solution to my problem using regular straight forward logic versus smaller logic in a loop. I think I understand the wait action now, but it is deceptively tricky in loops, especially when accessing indexes in array.
B
32
S
7
G
8
Posts: 312
Reputation: 8,467


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests