Hello again!
This is a follow on from the script I mentioned in my previous thread.
Basically, I'm using VisuStella's Common Event Button plugin to swap the positions of party members around for use in Jragyn's JABS plugin.
This is the script I have been using:
Which works well for switching!
However, this lets me switch out a character who is dead, and continue attacking with them which is... not quite ideal?
I wrote up an idea of how I'd set this up:
I'm sure there are FAR cleaner ways to do this, but this is all my Greymatter could come up with at this point.
I've been rummaging around in the RPG Maker MV/ MZ Script calls excel file (such beauty!) and figured I could probably use ".isStateAffected(1)" to check for death.
But this is where it gets a bit beyond me...
My attempt:
Returns the following error:
Which I honestly have no clue what to do with.
I'm assuming I'm mishandling "$gameParty.members()[]" and need to do something else with it before I can check if that party member has a state?
Any and all advice would be incredibly appreciated! Thank you!
This is a follow on from the script I mentioned in my previous thread.
Basically, I'm using VisuStella's Common Event Button plugin to swap the positions of party members around for use in Jragyn's JABS plugin.
This is the script I have been using:
JavaScript:
\\Checking Party size and switching accordingly
if ($gameParty.members().length == 3) {
$gameParty.swapOrder(0, 1)
$gameParty.swapOrder(2, 1);
} else if ($gameParty.members().length == 2) {
$gameParty.swapOrder(0, 1);
} else {
}
However, this lets me switch out a character who is dead, and continue attacking with them which is... not quite ideal?
I wrote up an idea of how I'd set this up:
Code:
if I have 3 party members
if member 1 is dead
if member 2 is dead
do nothing
else
Swap member 0 and 2
else
swap member 0 and 1
swap member 1 and 2
else if I have 2 Party members
if member 1 is dead
Do nothing/ play buzz
else
Swap member 0 and 1
else //1 member
Do nothing / play buzz
I'm sure there are FAR cleaner ways to do this, but this is all my Greymatter could come up with at this point.
I've been rummaging around in the RPG Maker MV/ MZ Script calls excel file (such beauty!) and figured I could probably use ".isStateAffected(1)" to check for death.
But this is where it gets a bit beyond me...
My attempt:
JavaScript:
if ($gameParty.members().length == 3) {
if $gameParty.members()[1].isStateAffected(1) {
if $gameParty.members()[2].isStateAffected(1) {
} else {
$gameParty.swapOrder(0, 2)
}
}else {
$gameParty.swapOrder(0, 1)
$gameParty.swapOrder(1, 2)
}
} else if ($gameParty.members().length == 2) {
if $gameParty.members()[1].isStateAffected(1) {
} else {
$gameParty.swapOrder(0, 1)
}
} else {
}
Returns the following error:
JavaScript:
SyntaxError: Unexpected identifier
at Game_Interpreter.command355 (rmmz_objects.js:11265)
at Game_Interpreter.<computed>.<computed> [as command355] (VisuMZ_0_CoreEngine.js:6411)
at Game_Interpreter.executeCommand (eval at onScriptLoad (FOSSIL.js:7880), <anonymous>:195:26)
at Game_Interpreter.update (rmmz_objects.js:9539)
at Game_Map.updateInterpreter (rmmz_objects.js:6769)
at Game_Map.update (rmmz_objects.js:6673)
at Game_Map.update (J-ABS.js:3364)
at Scene_Map.updateMain (rmmz_scenes.js:733)
at Scene_Map.<computed> [as updateMain] (VisuMZ_4_Debugger.js:404)
at Scene_Map.updateMainMultiply (rmmz_scenes.js:729)
I'm assuming I'm mishandling "$gameParty.members()[]" and need to do something else with it before I can check if that party member has a state?
Any and all advice would be incredibly appreciated! Thank you!
