Hi everyone,
I'm currently in the early stages of my first serious game creation attempt with RPG Maker, so I haven't figured out a lot of the subtle functions or scripting mechanics yet. Given enough time I can probably figure everything out on their own but I have a function that a sizable portion of my game will end up being built around and I'd like to have it working earlier rather than later.
I'm trying to get a function implemented where when the player takes a step it pluses a specified var by specific increment, ideally only while on a specific map, in this case specifically mapID: 002.
I've tried trying the variables directly to game data "steps", but without a means to reset the steps counter this method hasn't given satisfactory results.
Any advice that anyone can give me?
Thank you,
I'm sorry I thought that was the correct thread.
did you try creating a parellel process common event that checks fopr button presses? and have you tried reseting the variable in the event that transfers the player off the map?
the common event ill need a game switch attached. you can turn it on when the player enters the map and off when they leave it
If you want the steps to "reset", all you need to do to check the current step count counting from the last is to subtract the previous value from the current step count.
If you want it to "reset" only when entering that map, save the current step count upon entering, and to count the steps, use that as the base (the value you subtract from the steps when you check)
Or subtract the variable by itself
Take note though that if the player keeps the button pressed, you cant easily determine amount of steps via press check..
If you only want it run on a specific map, then use a map event instead of a common event.
So I finally found a solution, it works, although not as exactly how I will eventually want it to behave. The objective is to create a way to track the passage of time as the player moves around the world (I'll explain why later).
On the map where I want to have the steps count I have a parallel process event:
control variables: [##, Steps] = Steps
conditional branch: Variable [##, Time] <= Variable [##, Steps]
Call common event: [Day Rollover]
Day Rollover then does all the functions of for pushing the game into a new day, including making the variable for [Time] to be equal to [Steps] +24.
Now every step on my world map is loosely equivalent to an hour's walk. (2-4 miles casually walking depending on the person but that's not really important.). Also sleeping will advance the calendar by a day as well, and specific events might roll the calendar by several days depending on the need.
The purpose is to give quests a time value as well. If an NPC gives the player a week for a quest, that's now an actual measured value in game. Similarly if I want to send a party member off on a privet mission there becomes a way to time that where that can be counted evenly rather than randomly. And if I want to have a major story event take place after a specific amount of time regardless of if the player is ready to face it then that is also available to me.
Anyhow, this solution has the limit that eventually the game will not be able to count an increase to steps and/or the variables attached to them and as a result the game will crash. So eventually I'll need to write a script that will do all this and also reset the needed variables and steps to prevent maxing out the counters. But I'll cross that bridge later, this works for now.
Thank you everyone for the input.