[VX Ace] Making a dynamic variable become static?

[sOLVED]​

I'm working on a banking system that uses steps to calculate interest rates. I'm trying to set up a series of variables that will then be plugged into my interest formula.

Here is the current script:

s = $game_variables[85]s2 = $game_variables[86]s3 = $game_variables[87]s = $game_party.stepss2 = ss3 = s - s2What I'm wanting to do is take `s` when it is called (by talking to the banker) and assigning that specific value to `s2` .

Example:

Player walks 10 steps.s = 10s2 = 0s3 = 10 - 0 = 0Player walks 10 more stepss = 20s2 = 10s3 = 20 - 10 = 10I've been thinking about this for hours and cannot figure out how to do it. Any help is greatly appreciated!

*Edit*

All the above script does is returns 0 for `s3` because `s2` is still the dynamic ($game_party.steps) value.

*Edit2*

Thanks to Naveed_Ashfaq and his Banking Tutorial I managed to get my bank working right.
Variables are changed at the moment they are called and assigned, and never updated unless they get a new assignment.


Which means the behaviour of your code depends on when which line is executed - and that is something you didn't tell.


That said, I think it would be easiert to do this with events instead of scripts, because with events you have the parallel processes, while in script you would have to search for the correct update method to call.

Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-making-a-dynamic-variable-become-static.42716/