RMMZ How do you store ex/sp parameters in variables

Davideo

Villager
Member
Joined
Sep 26, 2015
Messages
5
Reaction score
0
First Language
english
Primarily Uses
Basically like the title says, how would I go about storing ex/sp parameters into variables?
Preferably done through a script call.
 

Davideo

Villager
Member
Joined
Sep 26, 2015
Messages
5
Reaction score
0
First Language
english
Primarily Uses
Seriously can anyone at all please help with this.
I just need to know what kind of thing I'd need to type to save ex-parameters and sp-parameters into a variable.
I.E. $gameVariables.value(1) = actor1.hit_rate, or whatever.
I've been digging through any JS file I could for hours and found nothing, or atleast nothing helpfull.
 

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
161
Reaction score
85
First Language
French
Primarily Uses
RMMV
You got it right. If you want to store a parameter into a variable, just use $gameVariables.value(1) = value
The only part that you need to figure out is which actor you want to point at this way ($gameActors.actor(ID)) and the name of the parameter you want to store.

So for every parameter you want to store into a variable, here's what you need to write as a script:
$gameVariables.value(ID1) = $gameActors.actor(ID2).PARAM
ID1 is the variable ID, ID2 is the target actor's ID, and PARAM is the JS name of the parameter you want to store.

For EX-parameters, here are the names:
Hit Rate: hit
Evasion Rate: eva
Crit Rate: cri
Critical Evasion Rate: cev
Magic Evasion Rate: mev
Magic Reflection Rate: mrf
Counter-Attack Rate: cnt
HP Regen Rate: hrg
MP Regen Rate: mrg
TP Regen Rate: trg

Note: these values are equal to the percentage divided by 100. So for a rate of 100%, the value will be 1.
If you want to store the percentage instead, you'll have to multiply the value by 100, which can be done in the same line:
$gameVariables.value(ID1) = $gameActors.actor(ID2).PARAM * 100
 
Last edited:

Davideo

Villager
Member
Joined
Sep 26, 2015
Messages
5
Reaction score
0
First Language
english
Primarily Uses
You got it right. If you want to store a parameter into a variable, just use $gameVariables.value(1) = value
The only part that you need to figure out is which actor you want to point at this way ($gameActors.actor(ID)) and the name of the parameter you want to store.
The parameter names are what I'm mainly unsure of, would it be something like hit_rate?
 

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
161
Reaction score
85
First Language
French
Primarily Uses
RMMV
I edited my post with the information. I'm sorry, I pressed TAB then space so it sent my message prematurely.
 

Davideo

Villager
Member
Joined
Sep 26, 2015
Messages
5
Reaction score
0
First Language
english
Primarily Uses
I just noticed that, lol.
Thank you very much for the help, and quick response.
 

Latest Threads

Latest Profile Posts

V1.3 of Demo, a new concept artist on the team, character voices are coming into light more... I'm happy to say that the fangame is making good progress.
Ami
--- Stolen Item ---

M.Figher: I want to sell this Stone
Fence: Then...i can buy you 1500G
M.Figher: It's Deal!
(3 Days Later)
F.Fighter: M.Figher,Do you know about Stone that Mayor keep it in his Office? It's missing
M.Figher: Ahh,is that so... (Actually,i Stole it and Sell it to the Fence a few Days ago)
I've spent some cash on foley and other sound effects. I wonder sometimes if I made a poor choice, but I remember that I really want to improve the sound of my games. n...n; My frugalness haunts me sometimes.

Forum statistics

Threads
108,851
Messages
1,040,031
Members
141,313
Latest member
MrLateNight98
Top