I think you got confused here - Arrays are only ways to store values and make processing a series of values for the same operation easier - but as soon as you want to have different operations (like setting each element to a different value), you'll still need to access them one at a time.
For something like described above, I would use a case-structure to set the data. That data might still be set into array-elements for the other advantages of arrays instead of setting it into single variables, but to decide that we would need more info about what those values are intended to do.
What is PHP, PMP, PTK, PEF, PAT, PDF, PGI, PEX? Obviously they're based on actor stats, but what are these ones used for, and why have you renamed them?
I know what an array is, I just didn't know how to properly code them at the time of asking. (not at all code savvy)
I'm using
N.A.S.T.Y. Extra Stats by Nelderson to create additional sets of attributes. These additional attributes are plugged into a formula to help determine a character's stats as they progress in level and perform various actions. The set I am currently focusing on is rather simple (in theory). These attributes can only be 1 of 6 values seen in the array below. These values are linked to the PER attribute.
PER can be any number between 1 and 16.
So lets say PER represents 1 of 16 titles the character could obtain. Each title would modify the character's attributes differently.
(The APR attribute isn't necessary and I don't intend to use it in the final script. A local variable will do.)
module PerCalc
def self.One
p1 = $game_party.members[0]
p1.xstat.APR = [0.30, 0.25, 0.20, 0.15, -0.30, 0.00]
p1.xstat.PER = 1
p1.xstat.php =
p1.xstat.PER==1 ? p1.xstat.APR[0] : p1.xstat.PER==2 ? p1.xstat.APR[1] :
p1.xstat.PER==3 ? p1.xstat.APR[1] : p1.xstat.PER==4 ? p1.xstat.APR[1] :
p1.xstat.PER==5 ? p1.xstat.APR[1] : p1.xstat.PER==6 ? p1.xstat.APR[1] :
p1.xstat.PER==7 ? p1.xstat.APR[1] : p1.xstat.PER==8 ? p1.xstat.APR[1] :
p1.xstat.PER==9 ? p1.xstat.APR[1] : p1.xstat.PER==10 ? p1.xstat.APR[1] :
p1.xstat.PER==11 ? p1.xstat.APR[1] : p1.xstat.PER==12 ? p1.xstat.APR[1] :
p1.xstat.PER==13 ? p1.xstat.APR[1] : p1.xstat.PER==14 ? p1.xstat.APR[1] :
p1.xstat.PER==15 ? p1.xstat.APR[1] : p1.xstat.PER==16 ? p1.xstat.APR[1] : 0;
end
end
end
My plan is to use a script call (PerCalc.One, I think) to change these 'P stats' based on the PER attribute when a character joins the party. I'm finding it difficult to express this with code, especially since I don't actually know how to code. >_< This has to be efficient because I'm not entirely sure how many actors the game will actually have, but I do know the player will at least have the option to switch out teammates for new ones quite often.