RMMV Targeting party member position instead of actor?

dsap

Villager
Member
Joined
Mar 23, 2021
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hello, I am looking for a little help. I have set up a common event that looks like this. The goal is that if in battle the player's entire currently alive active battling party has < 1 MP (negatives are possible in my game) the common event will grant them mp.

◆If:Script:$gameActors.actor(1).mp < 1
◆If:Script:$gameActors.actor(2).mp < 1
◆If:Script:$gameActors.actor(3).mp < 1
◆Change MP:Entire Party, + 7

:End

:End

:Else

:End

My problem is this; I intend for my game to have more than 3 characters. I'm sorry I don't know the proper name for this, but I would like for this event/script to check the "slots" or positions that the characters are occupying, so that it could check ANY character placed in the party. I think this code only works if the party currently consists of those three actors, and wouldn't work if there were other actors.

I tried for a very long time to get it to detect the party as a whole, and finally got it to function as intended by basing the conditional on actors instead and nesting "ifs". All of the other scripts I tried included multiple variables and booleans, but it wasn't working out.

Currently, this functions "as intended" inside the common event but im worried about problems in the future. As extra information I am calling the common event through a skill via yanfly's action sequences.

TLDR; how do i make
If:Script:$gameActors.actor(1).mp < 1
call not on the specific actor, but on either A) the whole allied party currently battling not dead, since thats the ultimate goal or B) the allied party currently battling roster position, so that it will still target all party members regardless of which actors are placed in those positions.

Very sorry if I worded this in a confusing way.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,500
Reaction score
727
First Language
indonesian
you can use this:
Code:
$gameParty.battleMembers()[member_index]
change member_index to the index of your battle member
0-> first member
1-> second member
2 -> third member
and so on

hope this help.
 

dsap

Villager
Member
Joined
Mar 23, 2021
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMMV
you can use this:
Code:
$gameParty.battleMembers()[member_index]
change member_index to the index of your battle member
0-> first member
1-> second member
2 -> third member
and so on

hope this help.
Ill try this, thank you.
 

Latest Threads

Latest Profile Posts

Sometimes you Just need to realise someone is beyond help... Still hard to walk away tho :(
100 Horror/Tragedy Sample Maps, Penguin Mech Sprite, & TileD Templates | RPG Maker News #70

Continuing working on abs. So far I have done the workout twice. I am excited to see the results after a couple of weeks. How is everyone doing? :)
MZ: oh boy imma work today
Me, excited: Really?
MZ, doesn't do what I tell It too
Me: I Thought-
MZ: I am Working!
Oof, this "side project" of mine is starting to get as complex as a VS plugin, at least as far as plugin parameters are concerned. I think I now understand why a plugin like this doesn't already exist(that I know of). Learning a lot while trying to make it work though!

Forum statistics

Threads
112,216
Messages
1,066,603
Members
145,821
Latest member
Adra
Top