Player gets stuck in scenario after resizing =(

Get help using Construct 2

Post » Mon Jan 02, 2017 12:07 am

Hello...

First, sorry about my english =P

- In my project, the player can change his size to a small version for few seconds (just like the antman =D), to access certain areas af the stage.

That's working pretty well ;)

The problem is: when the effect is over, the character returns to the original size, and sometimes it "enters the scenario", getting stuck. Something like this:

Image

How can I fix it?

=[

Thanks ;)
B
4
S
1
Posts: 4
Reputation: 308

Post » Mon Jan 02, 2017 12:30 am

I guess that's a Tilemap with which you are drawing the obstacles.

If that's the case, you can do this:

Put a condition in front of your 'resizing back to normal'-action(s):
Code: Select all
If Tilemap.PositionToTileY(Player.Y-50) = -1


(Replace 50 if needed. Right now, the player will only rescale, if there are no tiles 50 pixels above his origin image point)
Last edited by randomly on Tue Jan 03, 2017 6:58 pm, edited 1 time in total.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Mon Jan 02, 2017 1:18 pm

Humm...

Sorry, I could not find this kind of condition...

Found Else (wich I believed works together with IF), but not the IF itself... so sorry =(

I ask you for patience with a beginner (with a terrible English knowledge) =P

Here some screenshots of my attempt:

Image

"AlmaRed" is the platform guide, the "soul of character" (just as the tutorials taught me) =P

"nanorun" is the trigger.

Image

/I'm a beginner =P Please don't laught at my "gambiarra" (something less functional than a quick fix)... This code is not smart, I know =P

I tried few other ways, but it was conflicting with other character animations after resizing. This way it's working ;P

Image

All the objects. There's no tilemaps, I'm using the tiles (objects) that apears when you start a new project =P
B
4
S
1
Posts: 4
Reputation: 308

Post » Tue Jan 03, 2017 12:18 am

To be honest, I would replace the TiledBackground with a Tilemap. That will make future environment building easier. :]

Also, the "If" condition is not a "real" condition, I just used it to tell you that it is a condition. :)

You know what? You could simply upload your .capx to Dropbox and link it here. Then, I can directly edit your .capx.
That will make everything easier. :]
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Tue Jan 03, 2017 2:01 am

Message: Rotieh can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Man, you're a nice person! =P

Here is the .capx:
https://www.dropbox.com/s/4vagtkveoo2qz ... osave?dl=0

Hum... It's just it? Don't you need the whole project?

Thank you so much! =]

EDIT:
"Message: Rotieh can only post plain text URLS until they have 500 rep. 1 URLS modified."


I can't send links yet... =P

I'll try to send on code:
Code: Select all
https://www.dropbox.com/s/4vagtkveoo2qzh5/New%20project.capx.autosave?dl=0
B
4
S
1
Posts: 4
Reputation: 308

Post » Tue Jan 03, 2017 9:10 am

He overlapped with a SOLID object
Image Image Image
B
32
S
12
G
27
Posts: 761
Reputation: 17,246

Post » Wed Jan 04, 2017 9:04 pm

This fixes it:
_______
Image

_______

I also found two bugs:
  • The nano animation doesn't trigger anymore after it has been done twice in a row (probably an issue with the "nano"-variables
  • The reversed "nano" animation is triggered multiple times when "nanocontrol" >= 5 (I fixed this with the "trigger once" in the image
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Fri Jan 06, 2017 6:09 pm

Yay!

Thank you so much!

The nano animation will not be able to be used twice in a row, there will be a cooldown =)

You are the best!

How can I thank you?
B
4
S
1
Posts: 4
Reputation: 308

Post » Sun Jan 08, 2017 9:44 pm

I'm happy to have helped, that's all. A Thank you is all I need to be happy.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091


Return to How do I....?

Who is online

Users browsing this forum: dop2000, gameba, Seruza and 12 guests