Party total hp check (Script)

Hi,


I looking this time somekind party hp inspector script or command what check if every party members have only 25hp or bellow or total partty hp is bellow 25hp happend someting.


If i use somekind of script i found somewhere someting like this but, that/this not work:


$game_party.all_members.all? $game_party.all_members.all[-1].hp > 25


If there is any way to do with out scripting, i like to use thease more.
all_members is not a method. there is a way to loop through all party members using while or what not.


I think simplest way to do so, is to say; $game_party.actor[0].hp < 25 that is the less than operator, the one you are using is greater than.


you could even do,


all_members = $game_party.party_members.count


i = 0


while i < all_members do


if $game_party.party_members.hp < 25 (do stuff here, such as call common event or something)





i += 1





end





 





I recommend placing that within the battle event window if possible, or even having it executed with a common event, place the script inside a common event. then you can call it within a battle sequence, or if lag is not a concern, then have it as parallel process.





 





hope that helps. I don't know the commands for vx, only for ace, so maybe someone else can clarify the methods to use with $game_party.... sorry
If there is any way to do with out scripting, i like to use thease more.

yes, it just needs a series of control variables and conditional branches.


control variable can load the current HP of any actor or enemy into a variable, and then you can follow it with a conditional branch to compare it to any number.


The only problem is that this doesn't loop automatically, so you'll need a series of commands for every actor (best placed in a common event if needed often)
all_members is not a method. there is a way to loop through all party members using while or what not.


I think simplest way to do so, is to say; $game_party.actor[0].hp < 25 that is the less than operator, the one you are using is greater than.


you could even do,


all_members = $game_party.party_members.count


i = 0


while i < all_members do


if $game_party.party_members.hp < 25 (do stuff here, such as call common event or something)


i += 1


end


 


I recommend placing that within the battle event window if possible, or even having it executed with a common event, place the script inside a common event. then you can call it within a battle sequence, or if lag is not a concern, then have it as parallel process.


 


hope that helps. I don't know the commands for vx, only for ace, so maybe someone else can clarify the methods to use with $game_party.... sorry



-Well ,yeah, I just realized that I wanted to ask about this issue VX program does not, VX Ace program but, yeah...I looking for someting like that if i using someting script but, otherwise i like to use more commands.

Original thread: https://forums.rpgmakerweb.com/threads/party-total-hp-check-script.68203/