How do I add a condition that fixes this error?

Get help using Construct 2

Post » Wed Sep 02, 2015 4:20 am

Okay... so I made an account here because I've ran into something that's been really stumping me.

This code is meant to set up grid movement and random encounters much like a Pokemon game (which is what my game is gonna have mechanics of). I've been able to fix most bugs except one, which is produced by code doing exactly as it is told.

When coming back from the battle screen, moving forward causes the BattleRoll function to be called twice, which is unintended behavior (watch the EncounterRoll variable) and is caused by the condition check being met.

To roll a number, the code checks for the player object to be entirely inside TiledBackground, which is meant to be overlaid on top of the tilemap to represent tiles where random encounters are possible. When coming back from a battle, the player object already starts inside the TiledBackground, so the slightest movement will cause a die roll.

The place where I need help is in what sort of check I can use to prevent this erroneous die roll from happening.
AngelGNo55 is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?

dropbox . c o m /s/maqotrq86qdglf2/my_grand_project.capx?dl=0
Get the capx from here.
Last edited by AngelGNo55 on Wed Sep 02, 2015 1:20 pm, edited 1 time in total.
B
4
Posts: 2
Reputation: 204

Post » Wed Sep 02, 2015 6:08 am

better edit your post and put the URL without http or www, for example: dropbox . c o m /urlpath
B
9
S
3
Posts: 142
Reputation: 1,108

Post » Wed Sep 02, 2015 1:20 pm

Updated post with Majinboo's workaround.

I'm still waiting on a suggestion, people...
B
4
Posts: 2
Reputation: 204


Return to How do I....?

Who is online

Users browsing this forum: Apollo14, ChoosyZerk and 51 guests