'Or' not working in certain events

Discussion and feedback on Construct 2

Post » Wed Feb 27, 2013 9:12 pm

I haven't found any pattern in it, but occasionally Or refuses to work. It does it with perfect consistency in those specific events that show the issue, but I can't find any pattern in what makes it happen at all.

On other occasions I've just worked around it, but right now that isn't a reasonable option. I need to use the Or event, unless I want to use some stupidly convoluted method to work around something that shouldn't even be happening.

Here's a picture of the event


It's supposed to make it so that the player can hang from an edge if EITHER the player controls are not locked OR the player is running up a wall (which locks controls).
What actually happens is that the player can ONLY hang from an edge if they ran up the wall to it. No matter what I change that first value to in order to be certain it absolutely should trigger, it just doesn't as long as I have "Or is running up the wall".
If I remove that "Or is running up the wall" part then it works perfectly as it should, except the player cannot grab on after running up to it.

Does anyone know of a way to work around this?
B
6
S
1
Posts: 67
Reputation: 986

Post » Thu Feb 28, 2013 4:54 am

It looks like you're trying to use this logic in the sub-event:

If A or (B and C)

Maybe try splitting those?

E.g. like this

1. if B and C then set flag "BandC = 1"
2. if A or BandC=1
B
7
Posts: 38
Reputation: 476

Post » Thu Feb 28, 2013 6:20 am

No, that's one event, not two. I'm just using a formula inside it.
Basically I have two versions of each animation, one facing left and one facing right because the character's appearance is asymmetrical and cannot use Mirror without looking stupid.
I have an instance variable storing the current direction the player is facing.
When I need to read or play an animation, rather than having two separate events for each animation I just use that formula to choose the base name of the animation then append it with the current direction.
So with a single event it will automatically choose the proper animation based on the player's current direction. grimwolf2013-02-28 06:46:02
B
6
S
1
Posts: 67
Reputation: 986


Return to Construct 2 General

Who is online

Users browsing this forum: MadSpy, TRMG and 15 guests