Low health warning script

NeoPGX

~ King of Cuteness ~
Veteran
Joined
May 15, 2014
Messages
847
Reaction score
175
First Language
English (US)
Primarily Uses
N/A
WILL BE USED IN A COMMERCIAL GAME

First off I am well aware that this can be done by events. It seems to be a major headache for me to even try to understand. 

http://forums.rpgmakerweb.com/index.php?/topic/37885-can-this-be-done-in-vx-ace-by-default-or-would-it-require-a-script/

As you can see, I am very confused which in turn is making me angry and giving me a headache so I no longer wish to go that route.

My request is simple. Make it to where if a party member(s) HP falls below a specified percentage, a certain BGS plays continuously until all members of the party have their HP rise above said amount or all  of the said member(s) enter the death state.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Seems simple enough - let me make sure I understand ...


If you have one or more LIVING party members whose HP is below the specified level, the BGS plays. Otherwise (those party members are dead and/or all living party members are above the level), the BGS does not play.


Do you have BGS that comes from the map and continues during battle?


If this special BGS is playing at the end of battle, it should stop when you return to the map?
 

NeoPGX

~ King of Cuteness ~
Veteran
Joined
May 15, 2014
Messages
847
Reaction score
175
First Language
English (US)
Primarily Uses
N/A
If you have one or more LIVING party members whose HP is below the specified level, the BGS plays. Otherwise (those party members are dead and/or all living party members are above the level), the BGS does not play.
Correct.

Do you have BGS that comes from the map and continues during battle?

If this special BGS is playing at the end of battle, it should stop when you return to the map?
I don't quite understand the first question but for the second question, yes it has to stop when you return to the map.
 

NeoPGX

~ King of Cuteness ~
Veteran
Joined
May 15, 2014
Messages
847
Reaction score
175
First Language
English (US)
Primarily Uses
N/A
Bump.

Any takers?
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
class Scene_Battle < Scene_Base alias starwarrior_scene_battle_update update #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update starwarrior_scene_battle_update $game_party.battle_members.each do |member| if member.state?(1) # death state RPG::BGS.stop elsif member.hp <= 50 RPG::BGS.new("Clock", 100, 100).play end end endendclass Scene_Map < Scene_Base alias starwarrior_scene_map_update update def update starwarrior_scene_map_update $game_party.battle_members.each do |member| if member.state?(1) # death state RPG::BGS.stop elsif member.hp <= 50 RPG::BGS.new("Clock", 100, 100).play end end endendIf you don't want it to play in the map just remove the whole scene_map thing on the script.
 

NeoPGX

~ King of Cuteness ~
Veteran
Joined
May 15, 2014
Messages
847
Reaction score
175
First Language
English (US)
Primarily Uses
N/A
Sorry but the script doesn't work the way I want it to.

You set it so that is the actual amount of HP. But I wanted it so I can set it based on a certain percentage of the max HP.

Edit 1: BTW I just realized that even after copying only the battle part of the script, it still plays on the map for some reason.

EDIT 2: I noticed that the BGS still plays even after the HP has risen above the specified level.

 
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
That script will not do what you want anyway, even if it's change to hp.rate instead of hp.


If member 1 has the low HP, the BGS will play. If member 2 is dead, the BGS will stop.


It needs to look at $game_party.alive_members.any?{|i| i.hp_rate <= x} rather than iterating through each one and acting based on the individual's values.


assuming alive_members only includes battlers. I'm not sure if hp_rate is the right syntax, and I'm not sure if x needs to be a fraction (so .5 for 50%).
 

NeoPGX

~ King of Cuteness ~
Veteran
Joined
May 15, 2014
Messages
847
Reaction score
175
First Language
English (US)
Primarily Uses
N/A
That script will not do what you want anyway, even if it's change to hp.rate instead of hp.

If member 1 has the low HP, the BGS will play. If member 2 is dead, the BGS will stop.

It needs to look at $game_party.alive_members.any?{|i| i.hp_rate <= x} rather than iterating through each one and acting based on the individual's values.

assuming alive_members only includes battlers. I'm not sure if hp_rate is the right syntax, and I'm not sure if x needs to be a fraction (so .5 for 50%).
I have a question:

I noticed that RPG maker has its own low health warning indicator in which the color of the current HP turns yellow. At what percent is the engine by default supposed to do this? I'm gonna assume 25% and lower.
 

Nanaki_Fan

Veteran
Veteran
Joined
Jul 15, 2014
Messages
501
Reaction score
159
First Language
English
Primarily Uses
I have a question:

I noticed that RPG maker has its own low health warning indicator in which the color of the current HP turns yellow.
I thought this while reading the thread. Could we not just take that section of the game engine/default script then add in the sound effect to play to that section of the script?
 

NeoPGX

~ King of Cuteness ~
Veteran
Joined
May 15, 2014
Messages
847
Reaction score
175
First Language
English (US)
Primarily Uses
N/A
I thought this while reading the thread. Could we not just take that section of the game engine/default script then add in the sound effect to play to that section of the script?
I doubt it. It would also have to stop the moment any and all member members rise above the specified percentage or enter the death state.

This is basically how its supposed to work:

If you have one or more LIVING party members whose HP is below the specified level, the BGS plays. Otherwise (those party members are dead and/or all living party members are above the level), the BGS does not play.
 

NeoPGX

~ King of Cuteness ~
Veteran
Joined
May 15, 2014
Messages
847
Reaction score
175
First Language
English (US)
Primarily Uses
N/A

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top