http://rmrk.net/index.php/topic,34056.0.html (http://rmrk.net/index.php/topic,34056.0.html)
I need a script call to perform an action based on the above script, MA's "Show Variable-Based Stats". The script basically creates new stats, based on variables. These stats then show up in the Status Menu. I've been using the script for a while now and really like it. But there's a place in my project during which I need to alter the entire party's variable-based stats at the same time. Since, there are any number of actors who could be in the party at any point, I need this to be summed up in a single script call.
EXAMPLE:
We'll use a variable-based stat called 'INT', or Intelligence.
I need something that can say:
Add +2 to everyone in the party's INT.
There are event commands for the real stats, but unfortunately this script gives no direct call to perform the task.
To get the IDs of all the actors in the party, you could use this.
v = 14 # -> The ID of the base variable
a = []
for actor in $game_party.members
a.push(actor.id)
end
for i in a
$game_variables[v + i] += 2 # -> The operation you want to take out on the variable
end
For example, if I wanted to multiply the base variable 5 by 2, I would do this.
v = 5 # -> The ID of the base variable
a = []
for actor in $game_party.members
a.push(actor.id)
end
for i in a
$game_variables[v + i] *= 2 # -> The operation you want to take out on the variable
endIf I understood that correctly.
Thanks for the reply, Pacman.
So the 'base variable' in these examples are the variables which store the stat for the first actor?
In example 1, you are saying, start at variable 14 (actor 1's variable), and add to the array "a" the variable for all actors in the party.
Then, in the second part, you iterate through them, adding to '2' to all of them.
I'll try it and post results.
Yes. That's what I was doing.
Thanks Pacman. This works fine. This topic can be closed.