What's wrong with my functions?

Discussion and feedback on Construct 2

Post » Thu Apr 23, 2015 2:14 pm

Hi,

I have a problem with my functions, and i'm baffled what's wrong. Basically the function on top of the image works, but then subsequent functions don't. Any idea? Thx

https://drive.google.com/file/d/0B0jUjWN7LcQhU19mdV9vVDFNR1E/view?usp=sharing
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
85
S
27
G
20
Posts: 1,962
Reputation: 18,651

Post » Thu Apr 23, 2015 2:21 pm

Off the top of my head, I'd say try reversing the second and third conditions in the TargetSet function.
B
67
S
27
G
24
Posts: 969
Reputation: 18,573

Post » Thu Apr 23, 2015 2:29 pm

Magistross wrote:Off the top of my head, I'd say try reversing the second and third conditions in the TargetSet function.


It worked. Thx. I understand now that logic In c2 is "from all objects with variable N pick nearest". Bit odd to me, but thats fine.
But Mirror function only worked partially - only several instances mirrored, and rest stayed the same! Top function is called on click of mouse : on click, for each IN FAMILY, call function. Seams like there is not enough tick to do all. I don't get it.

EDIT@ To mirror, I've added "Pick by unique UID" and it worked. But it's weird that I don't need to do any picking before, if objects where picked in previous events. ANy idea why? THX!
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
85
S
27
G
20
Posts: 1,962
Reputation: 18,651

Post » Thu Apr 23, 2015 2:39 pm

The SOL isn't propagated through function calls. The only way to do that is to pass UIDs to function (in a loop if multiple instances are to be expected).
B
67
S
27
G
24
Posts: 969
Reputation: 18,573


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests