• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Counting Player Steps

  • 27
    Posts
    6
    Years
    • Seen Oct 7, 2024
    I'm trying to create Hidden Grottoes for my Fan Game and I have the basics down but I don't know how to make it so that the grotto resets after a certain amount of steps, is there a way to keep track of players steps and then to reset switches because of it?
     
    Last edited:
    Create a variable that tracks the steps, and use that as a switch to trigger the event.
     
    You can make it so it only works in a specific area. Just use other variable for that.
    It could be:

    Event 1: start tracking steps variable (inside the control variables command, the last option)

    Event 2: Save current steps variable (new variable = steps variable).

    Event 3: when you want to count again, you have to set the steps variable to zero. This way it start from where it was last saved.

    Keep in mind that RMXP already starts counting steps as soon as the game starts (in a clean XP project, essentials is maybe different around it) so you will have to reset the steps variable to zero before you start counting. You probably will need a variable as an parallel process in a common event, where it adds 1 whatever the player takes 1 step.
    If you want to have it in multiple places, you have to keep in mind the Events 2 and 3.

    This is just basic RMXP. I suggest that you toy around with, at least: Control Variables, showing variable in a text command, Conditional Branchs, Labels and Loops. Just learning how to use those will greatly help you in the future.
     
    You can make it so it only works in a specific area. Just use other variable for that.
    It could be:

    Event 1: start tracking steps variable (inside the control variables command, the last option)

    Event 2: Save current steps variable (new variable = steps variable).

    Event 3: when you want to count again, you have to set the steps variable to zero. This way it start from where it was last saved.

    Keep in mind that RMXP already starts counting steps as soon as the game starts (in a clean XP project, essentials is maybe different around it) so you will have to reset the steps variable to zero before you start counting. You probably will need a variable as an parallel process in a common event, where it adds 1 whatever the player takes 1 step.
    If you want to have it in multiple places, you have to keep in mind the Events 2 and 3.

    This is just basic RMXP. I suggest that you toy around with, at least: Control Variables, showing variable in a text command, Conditional Branchs, Labels and Loops. Just learning how to use those will greatly help you in the future.

    The thing is I've tried all of this, and so far it's not working, the Common Events are the one thing I can't find proper tutorials for and the tutorial I looked up didn't exactly help as it just showed me how to do it in a basic RMVX Ace rather than RMXP.

    I think now I might have figured something out that might work though.

    Edit: I tried what you suggested however my issue is that the events don't actually track my steps, I threw in some random ones with the Show Text "\v[18]" and "\v[19]" (Those are the events tracking and saving my steps) however they keep coming up with 0 for both of them. I've tried setting them up to Parellel Process and Autorun, Action Button, Player Touch, but nothing works.
     
    Last edited:
    Aparently essentials changed the way the control variables work and tracking steps directly through the command doesn't work.

    BUT

    After some search, I found this and luckily essentials uses the same thing to track steps.

    When adding +1 to your variable, put a Wait 5 frames after that or your step count WILL be messed up. I tried with 10 and it didn't work well.
     
    Back
    Top