Tying a variable to steps

Bluequoise

Warper
Member
Joined
Oct 23, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA

I've moved this thread to VX Ace Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Bluequoise

Warper
Member
Joined
Oct 23, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Thank you,

I'm sorry I thought that was the correct thread.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
534
First Language
English
Primarily Uses
N/A
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
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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)
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
534
First Language
English
Primarily Uses
N/A
Or subtract the variable by itself
 

Bluequoise

Warper
Member
Joined
Oct 23, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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
I hadn't thought about using key presses. As a parellel process it seems it would be easy enough to make an "If" statement that would run the process only IF you were on specific maps.

Thank you for the idea.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Take note though that if the player keeps the button pressed, you cant easily determine amount of steps via press check..
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If you only want it run on a specific map, then use a map event instead of a common event.
 

Bluequoise

Warper
Member
Joined
Oct 23, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top