How do I add a condition that fixes this error?

0 favourites
  • 3 posts
From the Asset Store
Use this game pack to create your own game, modify the existing game or simply take a look and see how it was made.
  • 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.

    [quote:3m8c1b1o]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.

  • better edit your post and put the URL without http or www, for example: dropbox . c o m /urlpath

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Updated post with Majinboo's workaround.

    I'm still waiting on a suggestion, people...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)