Question about variables...

So, my question is simply this: is there a way to reset stored variables?

To elaborate on my situation: I'm making a fishing system in my game. It works like this, the more times you interact with a fishing spot, the better the likelihood of catching a fish. I accomplished this by having a variable, "Catch Fish", and having the number stored go up by a random number between 1-15 each time the fishing spot is interacted with. Once the variable stored reaches a cumulative of a certain number, the fish with be caught. Unfortunately, every subsiquent time after, a fish will be caught. I'd like it to reset every time after a fish is caught.

Sorry if I'm not explaining it well.... any ideas on what I can do? Just a way to reset the variable would be great. Or maybe another way to go about this fishing system.

Thanks.
In the event where you catch a fish, just do a Control Variables to reset the variable to 0.
Sorry if this is a really simple fix but I still don't get it.... I don't see a reset option. And I can't just subtract a set number because it can sometimes be over the target number (since I'm somewhat working with randomized numbers)
Wait, just hit constant(0)? -_- wow. How did I miss that..

Terribly sorry to bother xP my apologies
🙂


In the Control Variables, you have these operations:


Set (a = B )


Add (a += B )


Sub (a -= B )


Mul (a *= B )


Div (a /= B )


Mod (a %= B )


And even if you DID want to do a subtraction to get it back to 0, you can use the same variable as the second operand:


a -= a


would make a 0.


Next time, just edit your post instead of double posting.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/question-about-variables.19696/