"One trigger per event branch" problem

Get help using Construct 2

Post » Sun Oct 13, 2013 5:54 pm

I wrote a block that involves some collision based events and once I got it completely working correctly, I tried to turn it into a function. However, C2 balks when I try to drag any events into the function that are triggered by collision. This is a real show-stopper. Is there some way to alleviate this? I don't fully understand C2's objections. All I get by way of error messages is "There can only be one trigger per event branch, so some events could not be moved here."
B
11
S
4
G
1
Posts: 159
Reputation: 1,803

Post » Sun Oct 13, 2013 6:18 pm

you should just import the actions in the function.
and use.
on collision - call function.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Oct 13, 2013 6:54 pm

You can use 'is overlapping' instead.
Moderator
B
95
S
34
G
33
Posts: 3,007
Reputation: 27,876

Post » Mon Oct 14, 2013 2:49 pm

@LittleStain
There is more than one collision being checked for in the function.

@Arima
I originally had been using overlap, but overlap doesn't pick the colliding objects the way that colliding does, which hoses the rest of the script. It's an 'infection' type of script, similar to the 'evil sprite' demo.

Thank you both. I may have found a solution, though: Making the function enable or disable a group, and within that group is my script. The function also initializes some variables necessary for the script, and checks to see if the group is still running or not, returning an error if it is. This should get close enough to being able to use the script as if it were a true function. I'm debugging it now.
B
11
S
4
G
1
Posts: 159
Reputation: 1,803


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 45 guests