Well, there's a lot of ways to do that. If you have a predetermined and low number of actors in your party you can just use conditionnals.
You'll have to update the event each time you change the number of possible actors though, and it can get quite complicated, especially if they can change classes.
What the editor lacks for a fully evented automated way is:
- A way to get an actor class Id with only the actor's own id (script call: $gameActors.actor(actorId)._classId)
- A way to get an actor parameter with only the actor's own id (script call: $gameActors.actor(actorId).atk for example)
You can do an automated evented way using a loop and the script calls above, probably.
Or, you can go full javascript.
I know you said an evented way, but it piqued my interest so I wrote a javascript solution, in spoilers below, you're free to use it if you want.
Spoiler
var ar = []; var car = [];var maxIndex = 0; var mageClassId = 1;//set mageClassId to your liking
var vid1 = 1; var vid2 = 2; //variable vid1 will contain the actor id, variable vid2 will contain the parameter value
for (var i = 0; i < $gameParty.members().length; i++) {
if ($gameParty.members()
._classId === mageClassId) {
ar.push($gameParty.members()._actorId)
car.push($gameParty.members().mat) //change the parameter here to the one you want
}
}
var maxValue = car[0]
for (var i = 1; i < car.length; i++) {
if (car > maxValue) {maxIndex = i; maxValue = car}
};
$gameVariables.setValue(vid1, ar[maxIndex]); $gameVariables.setValue(vid2,maxValue)
What this does is:
- Run a loop through all party members and add them to an array if their class Id is equal to mageClassId,
- Add the specified parameter to another array.
- Check the second array and get the highest number index and value
- Get the actor Id of the highest parameter by cross matching between the two.
- Assign the actor Id of the actor with the highest parameter to variable vid1, and the value to variable vid2;
Change vid1 from 1 to the number of the game variable you want to use, same for vid2.