hy i just started to use RMMZ and i am not a coder
i want to make a variable that is equal to the highest agility parameter of the party
what is the code for that to write in the script operand in the manue of the variable editing?
or is there any other way to do it?
thank you
This can be done a bit more efficiently with a script call, but it should be very easy for you to do it in event commands, so I'll show you how you would do that.
Control Variable HighestAgility -> Game Data -> Actor (first one in your party) -> Agility
Control Variable Member2 -> Game Data -> Actor (second one in your party) -> Agility
Control Variable Member3 -> Game Data -> Actor (third one in your party) -> Agility
Control Variable Member4 -> Game Data -> Actor (fourth one in your party) -> Agility
Conditional Branch Member2 > HighestAgility
- Control Variable HighestAgility = Member2
Conditional Branch Member3 > HighestAgility
- Control Variable HighestAgility = Member3
Conditional Branch Member4 > HighestAgility
- Control Variable HighestAgility = Member4
Then your HighestAgility variable is the highest in the party.
This only doesn't work well if you have one of those games where you have a bunch of characters and you don't know which actors will be in the party. Then it's more efficient to use a JavaScript function.
The game data section of the control variable command (the one that defaults to map id) is one of the most powerfull tools of the event engine.
you should try to use that instead of javascript commands whenever possible, because the event commands are protected from game-breaking influences.
if you use javascript, any mistake you make can cause a lot of problems and as such javascript should only be used when you know what you're doing and/or there is no other way to handle what you want.