I'm working on an overworld travel system that progresses the time according to how many steps were taken.
i.e. 1 step equals 1 hour
I have a normal(real time) clock system, for local maps, which pauses when the player transfers to a Region(overworld) map, and starts back up when returning to the local map.
I've managed to get the step counter working by making a "Stored Steps" variable (z) when the player transfers to the Region map, and a "Step Taken" variable (x), by making a "Total Steps" variable (y) to find the difference of "Stored Steps" and "Total Steps".
The script looked like this
$gameVariables.setValue(x,$gameVariables.value(y) - $gameVariables.value(z));
From here I used
$gameVariables.setValue(a,$gameVariables.value(b) + $gameVariables.value(x));
where x is still the steps taken, a is the "Hours" variable, and b is the"Region Hours" variable(which was also set when the player transfers).
This all works great, and does what i intended.
Time flows normal on the local map, then the player transfers, and the time stops. The player moves 1 step, and the hour increases by 1.
This is where the problem starts. I tried to make the Hour reset back to 1 and days to increase by 1 after a certain point by making a conditional branch
if Hours > x
then Hours = 1
Days = +1
(I know this isnt real script, I only started learning this stuff a couple days ago)
As i'm sure most of you can figure out, this didn't work so well. The Hours did get reset back to 1, but then stayed there and refused to increase again. The Days then start increasing at the designated Hour, but rapidly and without stopping. I've tried everything I can think of over the last couple days to no avail.
So, after banging my head against the wall for what has seemed like an eternity, I decided to ask the oracle that is the internet. My question is if am missing something obvious, or if there is a way to make the Control Variable option run only once. Maybe a script that will make one variable increase, when another increases, but not rely on them being the same value.
I'm stuck, my brain is fried. Sorry if this is pretty vague, I'm not really sure how else to explain what else I'm trying to achieve.
i.e. 1 step equals 1 hour
I have a normal(real time) clock system, for local maps, which pauses when the player transfers to a Region(overworld) map, and starts back up when returning to the local map.
I've managed to get the step counter working by making a "Stored Steps" variable (z) when the player transfers to the Region map, and a "Step Taken" variable (x), by making a "Total Steps" variable (y) to find the difference of "Stored Steps" and "Total Steps".
The script looked like this
$gameVariables.setValue(x,$gameVariables.value(y) - $gameVariables.value(z));
From here I used
$gameVariables.setValue(a,$gameVariables.value(b) + $gameVariables.value(x));
where x is still the steps taken, a is the "Hours" variable, and b is the"Region Hours" variable(which was also set when the player transfers).
This all works great, and does what i intended.
Time flows normal on the local map, then the player transfers, and the time stops. The player moves 1 step, and the hour increases by 1.
This is where the problem starts. I tried to make the Hour reset back to 1 and days to increase by 1 after a certain point by making a conditional branch
if Hours > x
then Hours = 1
Days = +1
(I know this isnt real script, I only started learning this stuff a couple days ago)
As i'm sure most of you can figure out, this didn't work so well. The Hours did get reset back to 1, but then stayed there and refused to increase again. The Days then start increasing at the designated Hour, but rapidly and without stopping. I've tried everything I can think of over the last couple days to no avail.
So, after banging my head against the wall for what has seemed like an eternity, I decided to ask the oracle that is the internet. My question is if am missing something obvious, or if there is a way to make the Control Variable option run only once. Maybe a script that will make one variable increase, when another increases, but not rely on them being the same value.
I'm stuck, my brain is fried. Sorry if this is pretty vague, I'm not really sure how else to explain what else I'm trying to achieve.