Reinitialize step count

I am using this event to get a step count.

◆Control Variables:#steps1 = Steps
◆Loop
◆Control Variables:#steps2 = Steps
◆Wait: 6
◆If:#0007 > #0006
◆Break Loop
◆
:End
◆
:Repeat Above

When the steps reach, say 1000, how do I reset them back to zero?

I tried changing the variable steps1 and steps2 to to =0, but it does nothing.
steps2 = 0
I also tried subtracting the steps variable by itself, still nada.
Steps2 -= steps2
Too little information. But I would suspect the reason why this is happening is because you don't reset steps and since steps1 and 2 take value of steps, doesn't matter how many times you return them to 0, once the event gets called again, they will come back as long as steps remains unchanged.
You can't reset the internal step count, you can only reset your variables.

However, there is an alternative for what you want:
Make a modulo operation with 1000 after you read the step number, that will remove the part above 1000 from the number in the variable.
@Andar I know I can't reset the internal step count, but I thought storing steps into a variable meant you could reset the variable. Am I storing them wrong, or should I make another variable based on steps1 and steps 2?

I thought about using modulo but I want one event t o play at 1000 steps and another event to play at 2000 steps, that seems to exclude the modulo solution, unless I'm missing something.
You can't reset the internal step count,
You can't? That's some news for me. However, it is not true. You can.
Steps are located inside $gameParty as _steps and they are completely flexible. You can, absolutely fearlessly, overwrite these steps in any way you like. Even set them to 0 or negative values if you want 😀
Spoiler: step count reset in action
Screenshot_336.png

EDIT: The Modulo solution doesn't need to be excluded. You just need to increase another variable as you go. For example: if modulo steps2 == 1000, then variable stepThousands increases by 1. And then in the common event have
if stepThousands == x, then...
EDIT: The Modulo solution doesn't need to be excluded. You just need to increase another variable as you go. For example: if modulo steps2 == 1000, then variable stepThousands increases by 1. And then in the common event have
if stepThousands == x, then...

@Poryg
Also, modulo works to trigger the events(the events already work without it though) but it doesn't reset the counter, which is what I REALLY need. How do you reset the counter and get it to work? I'll need you to spell it out for me, lol.
Set to 0 whatever you are using to write down the actual number of steps. Whether it is internal one or variable. I will provide an example once I can.
Set to 0 whatever you are using to write down the actual number of steps. Whether it is internal one or variable. I will provide an example once I can.

If you check out my first post, it's being stored in var steps2 and I've tried to set it to zero, but it doesn't respond at all.


blockley.png
blockley.png
Because you reset steps 2, but not steps, meaning next time the parallel event gets called, steps2 gets back to value of steps. You need to set steps to 0.
As Poryg stated above, you have TWO events both trying to set the value of Steps2. It doesn't matter how many times "Mushroom treat" is called to reset Steps2 to 0, IMMEDIATELY following that, your parallel process event "Dogs hunger" sets it BACK to the internal game step count. (Which is presumably over 1000.)

You can either:

1) Change the internal game step count to 0 within "Mushroom treat", which will effectively change Steps2 to 0 the second "Dogs hunger" runs (the following tick). In this case, you will never get higher than whatever step count is used to trigger "Mushroom treat". You would do this by replacing the Control Variables line in "Mushroom treat" with a script call:
$gameParty._steps = 0;
Again, with this method, you will FOREVER lose track of any steps taken before "Mushroom treat" was called.

2) OR find some other way to do it, that would probably be better. I'm not entirely clear on the full context of what you're trying to do. Where are you using Steps1? How is "Mushroom treat" being triggered? Is your ultimate goal just to know how many thousands of steps the player has taken, and also only allow "Mushroom treat" to trigger once for every thousand steps?
I feel like we aren't on the same page 🙁

I already reset the steps variable, steps2 is the name of the variable = to steps.

I tried making another one, a basic no name variable, with gamedata = steps, and setting it to zero just for the heck of it. It doesn't work. (It is no different than what I'm already using though, just un-named.)
@Llareian YES! Thank you, that script call was exactly what I needed. I don't think I will need a step count for anything else, so it will work perfect! Thank you!!!!!

And @Poryg and @Andar Thank you so much for your help too! 😀
Quite funny that I posted the same script a little while ago, just in the screenshot 😀
@Poryg I haven't done anything with the dev console yet so, it was too obscure for me too pick out. I thought that's what you were trying to do, that's why I said you would need you to spell it out for me. 😛
😀 I would have provided the actual example if you waited a little bit longer 😛 But well, nevermind 🙂 Probkem solved, that's important 😀
Dev console is not important here though, the commands usable in the console are usable even outside of the console, since it is the same javascript. I only use console as a real-time debug tool, because it allows me to manually influence variables and all sorts of stuff. If you want, you can check my school lesson and have some fun with the console 🙂
I'll take you up on that, after the jam that is. I've been away from rpg maker for 4 months to learn javascript, so I understand script calls better, but have done absolutely nothing with what I learned about JS with the engine yet. Your school sounds like a wonderful way to get started with that! 🙂
Sure thing, I'm not rushing you anywhere. It's not my school though, just my lesson for community school 😛

Good luck with the jam 🙂

Original thread: https://forums.rpgmakerweb.com/threads/reinitialize-step-count.85718/