General waits depending on game's framerate.

So basically, I want to make an option in my game to select the game's framerate, and I found a way to make waits to automatically be the same for all the framerates (so the game will not actually speed up).
I did wait_count * framerate / (framerate / 2), and it actually works. But there's a problem: I searched on the interpreter and other scripts the definition of @wait_count, but there wasn't any, instead i've found things like "@wait_count = @parameters[0]", so I added on it my calculation but nothing actually happened, the game is still speed-up. So, am I doing something wrong? (also, how do I found and put my calculation on other waits like picture's or characters'?)

EDIT: Ok I noticed my calculation is wrong, any help with it? I'll explain better: I want to moltiplicate the waits depending of how high is the fps, so if for example the game waits 10 frames, i want it to keep the same speed for every framerates, so if for 40 fps 10 is normal, then with 80 it should be 20, and with 60 like.. 15 I think? (sorry I suck on math, lmao)
Hello. First of all sorry if my explanation isn't clear.
If you want to multiply the duration of waits, you'll need to multiply them with the ratio of frame rate change. RMXP normal frame rate is 40. So 60 FPS would be 150% the normal rate, and 80 FPS 200%.

Say we're going with 60 FPS, the ratio of framerate change would be 60 / 40 = 1.5
So if you have 10 frames wait in 40 FPS, in 60 FPS you'll have 10 * 1.5 = 15 frames.

In case of @wait_count, I think it's fine to just do it like so: @parameters[0] * (framerate / 40).
Hello. First of all sorry if my explanation isn't clear.
If you want to multiply the duration of waits, you'll need to multiply them with the ratio of frame rate change. RMXP normal frame rate is 40. So 60 FPS would be 150% the normal rate, and 80 FPS 200%.

Say we're going with 60 FPS, the ratio of framerate change would be 60 / 40 = 1.5
So if you have 10 frames wait in 40 FPS, in 60 FPS you'll have 10 * 1.5 = 15 frames.

In case of @wait_count, I think it's fine to just do it like so: @parameters[0] * (framerate / 40).

Thank you! It worked, though now when i set the game to an higher value than 40, the game just seem really laggy, if it's on 40 then it's fine. if instead i put a value lower than 40, it seems that everything related to duration and speed just breaks, like the move picture command.
Now, I don't really know why the first problem happens, maybe because my computer is sheetty or RPG Maker XP isn't just powerful or optimized enough to work at that framerate, if it's the second, that's a real shame then.

Can maybe someone try it on a new rpg maker xp project if someone has a powerful computer? Maybe it's just the thing that my computer sucks, but who knows.

EDIT: Oh by the way, I'm still AndreWharn. That account was meant to be my new one because i've lost the password of this, but then i found it and that account is now basically unused. So yeah, it's still me. Sorry for the confusion and for not telling it quickly, I just forgot that i've post this thread on that other account.
Perhaps you'll need to update all scripts that use 40 frames in its calculations..
In case of @wait_count, I think it's fine to just do it like so: @parameters[0] * (framerate / 40).
You're doing integer division here. A framerate lower than 40 would result in 0. Have to make it 40.0 to get 1.5 as you expect. Or multiply framerate to the parameter first, then divide.
You're doing integer division here. A framerate lower than 40 would result in 0. Have to make it 40.0 to get 1.5 as you expect. Or multiply framerate to the parameter first, then divide.
Makes sense, I actually thought about this and it seems I was right. But though... what is exactly the formula then? (Sorry I suck so much on math, it will be appreciate if you directly write it)
Have to make it 40.0
Code:
(@parameters[0] * (framerate / 40.0)).round
Or multiply framerate to the parameter first, then divide.
Code:
@parameters[0] * framerate / 40

Original thread: https://forums.rpgmakerweb.com/threads/general-waits-depending-on-games-framerate.122553/