Making a step counter, for step by step time progression

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.
rather than trying to explain with a lot of words, it's better for you to just take screenshots of your events so we can see exactly what you've done. There's a lot of information that you haven't provided here, and the little bit that you have doesn't show where the issue is.

When you get your screenshot, use Alt+PrintScreen, and don't crop anything away. In many cases (and I suspect this one), the issue is not with the event commands themselves, but with something else on one of the event pages. If your event has several pages, show us all of them.
OK, let me try this again without sounding like a babbling lunatic.

This is the event that runs the step based time progression.
Screenshot (8).png

I get whats going on in that conditional branch, or at least I think I do. It's running it continuously as if the variable is greater than 8, I just don't know why, or how to stop it.
Well, I feel dumb. the answer was so simple
Screenshot (9).png

It was just a matter of adding the difference in Hours to Stored Steps.

Sorry for wasting the internet's time with my dumb question
That really doesn't show us what the issue was, because we have no idea where the other variable you added is used, or what for. I'm thinking you have another event somewhere that's constantly checking/comparing. But you got it working, and seem to understand what the problem was, so that's good.

You realise you can use Control Variables rather than a script call for those first two commands?

You can either do Control Variables [Variable = 9] [Operation = Set] [Operand = Script: $gameVariables.value(7) - $gameVariables.value(8)]

or to avoid scripts altogether, you can do Control Variables [Variable = 9] [Operation = Set] [Operand = Variable 7] followed by Control Variables [Variable = 9] [Operation = Sub] [Operand = Variable 8]

The last one will make it clear what all of those variables are used for, because it will show their names. Any option that includes script hides that a bit, so could be more prone to make mistakes and not pick them up.
Oh, I didn't realize I can chain different control variables together, when they are using the same id. The fact of the matter is I really have no idea what I'm doing. Been using RM in my spare time for about 2 weeks now, and JS for less than half that. I'm also kinda dumb, so that doesn't help much

I appreciate the info though Shaz.
Hmmm, strangely neither of those seem to work. They look like they should in theory. Perhaps I didn't give you the right info, or my wall of text was too convoluted? It's too bad too, because that would make things far less confusing. I think I may have tried at least one of those solutions before, but had similar results, and that's why I went with script call. I've lost track of everything I've tried at this point. Oh well, I'm still learning.

Thanks again, you've given me some things to think about

Original thread: https://forums.rpgmakerweb.com/threads/making-a-step-counter-for-step-by-step-time-progression.111704/