• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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

26
Posts
5
Years
    • Seen Oct 17, 2023
    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:

    ChickenCombo

    ㅇㅅㅇ
    27
    Posts
    9
    Years
    • Seen Feb 15, 2020
    Create a variable that tracks the steps, and use that as a switch to trigger the event.
     
    26
    Posts
    5
    Years
    • Seen Oct 17, 2023
    Create a variable that tracks the steps, and use that as a switch to trigger the event.

    Okay question, how do I create that variable so that it tracks the player when the player is out of the specific area, or does it always track them no matter what?
     
    178
    Posts
    10
    Years
  • 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.
     
    26
    Posts
    5
    Years
    • Seen Oct 17, 2023
    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:
    26
    Posts
    5
    Years
    • Seen Oct 17, 2023
    Is there anyway to do a 24 Hour or 12 Hour, or really whatever hour timer cooldown?
     
    178
    Posts
    10
    Years
  • 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