[R138.2]Function - Wait and use instance variable.

Bugs will be moved here once resolved.

Post » Mon Jul 15, 2013 10:16 pm

Link to .capx file (required!):
https://dl.dropboxusercontent.com/u/6813637/waitFunction.capx

Steps to reproduce:
1. Create a textbox, add two instance variables.
2. Create a Function that sends the instance variables as parameters.
3. On function call, wait the 1st var seconds and set the text as the second param.

Observed result:
The textbos returns 0.

Expected result:
The textbos should display the second instance variable.

Browsers affected:
Chrome: yes
Firefox: yes
Internet Explorer: yes

Operating system & service pack:
Windows 8.1 Preview

Construct 2 version:
R138.2

Thanks for looking.
B
38
S
8
G
3
Posts: 439
Reputation: 6,876

Post » Tue Jul 16, 2013 2:18 pm

Closing as not a bug. 'Wait' does not pause the game, so by the time the next action runs, the function has finished and there are no parameters that can be accessed.
Scirra Founder
B
378
S
220
G
84
Posts: 23,871
Reputation: 188,207

Post » Tue Jul 16, 2013 3:37 pm

@ashley ok, any idea on how I could achieve the effect I want?
B
38
S
8
G
3
Posts: 439
Reputation: 6,876

Post » Tue Jul 16, 2013 5:08 pm

Use a static local variable perhaps.
Scirra Founder
B
378
S
220
G
84
Posts: 23,871
Reputation: 188,207

Post » Tue Jul 16, 2013 5:14 pm

Like Ashley said have the function store the value in a variable. Works with a global variable too, but if you have a lot that would clutter the global variables.

This works fine:

B
49
S
12
G
10
Posts: 1,833
Reputation: 14,538

Post » Tue Jul 16, 2013 5:42 pm

@ashley @BluePhaze thank you again for the kind answers ;] Sorry about another faulty bug report
B
38
S
8
G
3
Posts: 439
Reputation: 6,876


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 8 guests