Platform Behaviour: Animation mode - accessible with events?

Get help using Construct 3!

Post » Tue Oct 17, 2017 10:54 am

Hi, I'm using the default platform behaviour - in debug mode if you look at how it operates there is an un-editable variable called "Animation Mode" which changes depending on whether the object is stopped, moving, jumping or falling. I can see that this is obviously how the default platform behaviour keeps track of what the player is doing but I'm wondering is there a way I can force the mode. The problem is that if my character jumps or falls and is then pinned to an object in the air - even though it is no longer moving/falling the animation mode still thinks that it is jumping or falling. I would like to force reset this to "stopped" as it is causing issues with what I'm trying to do. Is there any way to overwrite this? Or am I better off looking at custom movement (want to avoid this if possible).
B
68
S
25
G
4
Posts: 212
Reputation: 7,114

Post » Tue Oct 17, 2017 12:31 pm

Sorry, I meant to post this in the C2 area - may not be applicable to C3...?
B
68
S
25
G
4
Posts: 212
Reputation: 7,114

Post » Tue Oct 17, 2017 12:32 pm

couldn't you simply work around this by setting the animation to a different one when this pinning takes place?
B
11
S
2
Posts: 26
Reputation: 695

Post » Tue Oct 17, 2017 12:36 pm

Not in this particular case, the problem is that when the object is returned to a platform it continues on from the state it thinks it's in so for example if it thinks it's falling then when placed onto another platform it will force a land, which in turn triggers a land animation, which I don't want. I have found some workarounds, but none seem to be working consistently, and are causing erratic behaviour, which is why I would prefer to control the animation mode by events rather than let it do it's own thing.
B
68
S
25
G
4
Posts: 212
Reputation: 7,114

Post » Tue Oct 17, 2017 12:53 pm

Started up my own platformer to check it out, I see your issue and it answers a lot of qeustions for me.

When I was working on it I had issues with it as well, I eventually switched to physics based movement and worked out the animations events manually. So I'm afraid I can't help you with this particular problem.
B
11
S
2
Posts: 26
Reputation: 695

Post » Wed Oct 18, 2017 6:15 am

Does it help if upon pinning you manually set the platform behavior Vector X and Vector Y to 0? You might also give your character variables such as "running", "climbing" etc. and change the animation based on boolean states.
B
43
S
15
G
12
Posts: 160
Reputation: 9,281

Post » Wed Oct 18, 2017 9:51 am

I thought that setting vector x and vector y to 0 would fix this too, but it doesn't appear to. When the object is returned to a platform it still continues from where it left off and triggers unwanted animations (even if the hitbox doesn't necessarily move, or appear to move). It would be really good to have control over the states so that I could just set it to "stopped" therefore overwriting the land animation (when necessary). Giving the character a bunch of variables and changing animations depending on what's happening is a good idea, but I'm thinking it may still have the same problem - because I have a landing animation and would need to call it when "on landed" happens - which is still part of the inbuilt platform behaviour - and since that is what is triggering when I don't want it to, it would probably still trigger.
B
68
S
25
G
4
Posts: 212
Reputation: 7,114

Post » Wed Oct 18, 2017 10:36 am

Here's an example of what I mean. If you play the attached file when you jump with up key near a ledge the character will hold onto it (the state of the hitbox will be jump) if you press z, an animation will play and hitbox will be teleported up to the ledge. If you're jumping this seems to work ok - although it was a headache to even get that far and another user worked out that I needed to set a small offset to stop construct triggering the jump animation. The problem now, is that if you catch the ledge when falling (try jumping from one pillar to the other and grabbing the ledge) when the character pulls themselves up it triggers the fall animation straight after the hitbox teleports. Already, the system I have had to set up is very 'hacky' and not very good. It could be made much more elegant and could probably actually work with control over those states.

https://www.dropbox.com/s/yay2q8g52c7t7 ... t.c3p?dl=0 <--- C3 file

https://www.dropbox.com/s/mhsh6fknxes04 ... .capx?dl=0 <---- C2 file
B
68
S
25
G
4
Posts: 212
Reputation: 7,114

Post » Wed Oct 18, 2017 1:06 pm

@signaljacker

Not the most elegant solution, but one way to fix this would be to make a group "Land" and put the "Platform: On landed" animation events inside the group.
Then, under "Is Z pressed.." tree of events, add System-> Set group "Land" deactivated.
Then, under both "On animation "hang_climb" finished event trees, at the end add "System -> Wait 0.5 seconds" and "Set group "Land" activated".
B
43
S
15
G
12
Posts: 160
Reputation: 9,281

Post » Sun Oct 22, 2017 4:39 am

@Waltuo - thank you for a solution - it does indeed work.
B
68
S
25
G
4
Posts: 212
Reputation: 7,114


Return to How do I...?

Who is online

Users browsing this forum: No registered users and 2 guests