How do I create object position with function

Get help using Construct 2

Post » Tue Jul 28, 2015 3:18 pm

Hi,

I use function to create object, function has 2 params which is object's x and y position, so I can create object where I want, but the problem is when I add a system wait action, the function can not get the params(can not create the object on the position I want), I have no idea what's going on, please help

file: https://www.dropbox.com/s/6d7lgyxtcnu9e ... .capx?dl=0

thanks
B
11
S
3
Posts: 172
Reputation: 1,178

Post » Tue Jul 28, 2015 4:23 pm

I don't really understand why the "wait 3 seconds" but you can push your actions under a sub-event, add 2 local variables, and set those variables to Function.Param(0) and Function.Param(1). Then do your "Wait 3 seconds" and create the object using your local variables for coordinates, they will still exist in the current scope.
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Tue Jul 28, 2015 5:25 pm

@Magistross thanks, would you please show me your screenshot? not quite understand how to do this, thanks
B
11
S
3
Posts: 172
Reputation: 1,178

Post » Tue Jul 28, 2015 6:17 pm

I thought it would work, but it seems it doesn't, or at least, not as I thought it would. Multiple function calls seem to share the same variables so you can't tap the s1 square twice and get two s2 squares at different positions, they both end at the 2nd set of coordinates. Maybe you could just simply set the delay outside of the function, since it doesn't appear to be designed for this.
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Tue Jul 28, 2015 7:41 pm

ok, thanks
B
11
S
3
Posts: 172
Reputation: 1,178

Post » Tue Jul 28, 2015 7:58 pm

yea something like that https://mega.nz/#!XMlm2IiL!qmLVM2YAWTEl ... T-iR63qC8E

I also find it strange that it doesn't work inside the function
Image
B
28
S
11
G
2
Posts: 139
Reputation: 3,299


Return to How do I....?

Who is online

Users browsing this forum: Syazanie Amirin and 8 guests