$gameParty.members()[index].atk
// Note that you'll have to replace "index" by the index of the party member you want to access.
For example, "if at least one of party members has ATK more or equals 60"And what will be the condition? To get the data you want, simply use this code:
Code:$gameParty.members()[index].atk // Note that you'll have to replace "index" by the index of the party member you want to access.
var check = false;
for (var = i ; i < $gameParty.members().length; i++) {
var pm = $gameParty.members()[i];
if (pm.atk >= 60) {
check = true;
break;
}
}
$gameSwitches.setValue(1, check);
Okay.This will set the game switch #1 (you can easily change the game switch id by changing the number) to true (ON) if any of the party members has an ATK of over 60. If not, it will set the switch to false (OFF). You can copy/paste the code and insert in a script call in an event.Code:var check = false; for (var = i ; i < $gameParty.members().length; i++) { var pm = $gameParty.members()[i]; if (pm.atk >= 60) { check = true; break; } } $gameSwitches.setValue(1, check);
$gameParty.members().some(function (m) { return m.actor().atk >= 20; })
$gameParty.members().some(actor => actor.atk >= 20)
Thank you.If you want to put it even more concisely:
With anonymous functions, it's generally better to name the arguments something clear like "actor" rather than "m" for better readability.Code:$gameParty.members().some(actor => actor.atk >= 20)