How do I allow player to temporarily bypass solid objects?

Get help using Construct 2

Post » Mon Jan 26, 2015 9:30 pm

My game is played from a Zelda-like perspective.

So far, it's been easy to handle collision; apart from the visual layer, I have a separate collision layer, not visible to the player, with bright red squares marking off everywhere the player can't go.

However, in my game the player has an 'acrobatics' ability. When pressing the acrobatics button plus the appropriate direction, the player is supposed to be able to cross some (but not all) physical obstacles.

So, for example, instead of being stopped by a fence, he vaults over the fence. Instead of being stopped by the wall of a building, he runs up the wall and lands on the roof of the building.

I'm pretty sure what I need to do is have a new layer that defines 'acrobatics areas' of a given level; areas where pressing a certain key combination (acrobatics key plus appropriate direction) will produce a certain result in terms of player movement and animation. But how do I do this on the player movement side? Is there a way to make the player 'intangible' for passing through the wall and force a specific pattern of movement (run up the wall and land on the roof, vault the fence, etc.) that temporarily overrides the player's normal controls, while still making the player vulnerable to bullets and other projectiles?

Thanks!
B
6
S
1
G
1
Posts: 97
Reputation: 914

Post » Mon Jan 26, 2015 11:57 pm

Create a condition that check a specific animation of your char. When true, disable Solid behavior.
Image
B
17
S
7
Posts: 126
Reputation: 1,945

Post » Tue Jan 27, 2015 12:24 am

Hmm... if the player temporarily turns non-solid, would that prevent the player from being hit by bullets/projectiles during that stretch of time? That would be a major problem...
B
6
S
1
G
1
Posts: 97
Reputation: 914

Post » Tue Jan 27, 2015 12:26 am

Televangelist wrote:Hmm... if the player temporarily turns non-solid, would that prevent the player from being hit by bullets/projectiles during that stretch of time? That would be a major problem...


That could be a bonus side-effect of doing an acrobatic move.
B
56
S
15
G
13
Posts: 826
Reputation: 17,705

Post » Tue Jan 27, 2015 12:46 am

Tekniko wrote:
Televangelist wrote:Hmm... if the player temporarily turns non-solid, would that prevent the player from being hit by bullets/projectiles during that stretch of time? That would be a major problem...


That could be a bonus side-effect of doing an acrobatic move.


Could be, but would be less than ideal.

Is there a way to 'override' the player's movement and position, including collision with walls, without changing his ability to interact with bullets/projectiles?
B
6
S
1
G
1
Posts: 97
Reputation: 914

Post » Tue Jan 27, 2015 7:25 am

There's a couple of possibilities.
If you want the player to remain solid to bullets while the acrobatic ability is active,
The one on my mind is, have the kinds of objects that can be temporarily not solid (on your collision layer) be different from the objects that are always solid. (e.g, SolidWall and AcroWall)
Your Acrowall would have different animations based on direction and style; "VaultFenceUpDown" "RunWallUp".
Then, when the player character collides with the Acrowall; if they're not in Acrobatics Mode, they just stop.
If they're not going one of the acceptable directions of the acrowall? (Trying to cross the runwall going left or right) they stop.
If they're in Acromode and going the right direction, then,

(Player->8-Direction.StartIgnoringInput)
Then, AcroWall->Solid.Disable
Player.AnimationChange.RunWallUp
Player.8Direction.SimulateInput("Up")
until they're no longer overlapping the Acrowall. Then you reenable Acrowall Solids, 8-Direction input, and normal animation.
Make any sense?
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Tue Jan 27, 2015 8:51 am

This is one problem that Construct 2 could solve if it had the container(I think that's what it's called) feature from Unity3D.
Basically you set what can interact with what, so you could have players passing through objects e.g. forcefields that enemies couldn't.

Anyway, the only way I can think of you to do it is to either disable solid, do a really super complicated event that I can't think of and probably wouldn't/would work, or just change your ability to a kind of teleport.

So there's that, or making the player invulnerable.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Tue Jan 27, 2015 9:03 am

That sounds an awful lot like "families," Nesteris.
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Tue Jan 27, 2015 6:24 pm

Thanks so much to both Nesteris and Unnatural20 for great and very informative replies! I really appreciate it. :)

My only concern with dropping the solid property of the wall temporarily is that if my game is multiplayer online, it might allow other players to 'walk' through the fence while the acrobatic move is active. If I have to pick one object being solid or another, the player being invulnerable might be preferable to allowing other players to 'cheat'.

Could this be solved by simply not updating the state of the 'Acrowall' object for multiplayer? So it's fully client-side, and an acrowall being 'non-solid' on my client has no impact on other players? Or are things like that forced to update/sync when using multiplayer?
B
6
S
1
G
1
Posts: 97
Reputation: 914

Post » Wed Jan 28, 2015 3:50 am

Honestly, I know nothing of multiplayer; that might just be something you need to try!
B
11
S
4
Posts: 152
Reputation: 1,236


Return to How do I....?

Who is online

Users browsing this forum: RIDETHEPIG and 4 guests