Equipments with their own set of HP/Gauges

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
Is it possible to have equipments with their own set of HP and gauge(bar) in menu/battle?

Example on how the HP works:

Actor A wears Equipment A with 1000HP, Actor A will not take damage until Equipment A's HP is reduced to 0.
If Enemy hits 1500 damage, and the Equipment has 1000HP, the equipment is destroyed and Actor A will receive the remaining damage minus the equipment's HP, which is 500 in this case.

Extra Requirements:

To let certain skills penetrate the equipment and damage the actor directly. eg, drain skill, penetrate spells.
To be able to "repair"  the equipment when its HP isn't at max with either item or skill so the user can prevent the equipment from being destroyed.

Putting on and Taking off the equipment will not reset its current HP, eg, if the equipment has 500/1000 HP now, taking it off and putting it back on later will still show 500/1000 HP with no changes.

I've seen a similar way done using skill but i wish to have it effective as soon as the actor wears the equipment and not by casting a skill to activate it. This is bgillisp's HP Barrier script that does what i want, but it's using a skill to activate the HP bar, which i do not find useful unless i can find a script that automatically use a skill when an equipment is equipped, but i'd want to avoid that if possible. Hime has a similar HP Shield script but it's using skill to active the extra bar too.

Having states activates the extra HP gauge is welcome too, but i'll need it to work with Yanfly's Passive States. So whenever an actor wears the equipment, the state is automatically applied.

Edited to add more info:

This doesn't have to work on every single piece of equipment, and an actor is limited to wear only one of these at all time so there won't be any needs for more than 1 extra hp bar for each actor.

This should open up the possibilities for Battle Golem/Armor/Vehicle/Robots/Animals(Mounts). Where the actors gets an extra set of HP that blocks incoming damage when they are wearing the specific equipment.

For those interested and wish to help/support.

Thanks in advance!
 
Last edited by a moderator:

ArcaneEli

Mage of Thunder
Veteran
Joined
Mar 24, 2012
Messages
205
Reaction score
35
First Language
English
Primarily Uses
I like this idea, but it might get too cluttered if every armor and your weapon had an HP bar to go with your HP bar.

You could use the HP Barrier/Shield and have Durability on your Equips instead.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
It is an interesting idea. My script was never designed for equipment to have HP, mainly because I don't yet know how the equip engine works in RM. If someone wishes to modify my script to handle equipment, be my guest, the code I have under make_damage_value is probably a good place to start.
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
@ArcaneEli: Well, generally it's not for every single piece of equipment or i'll have gone to the durability option like you said. More like a shielding option to make one or a few characters able to use armors with extra HP gauge acting as extra protections. (Pretty much similar to the +hp% but doing it on a separate hp bar). This allows the possibilities to add battle armors/vehicles/robots to the game. Where when an actor wears an equipment, he/she will change her sprite into another fitting sprite (eg vehicle) and have a set of extra hp as long as he/she is wearing it.

@bgillisp: Thanks for the fast reply, i found your old script (0.96) that actually uses states, but sadly there's a few bug unfixed. I kept getting a window pop up of the max hp value whenever the state is applied, and the gauge in the menu will not use the max hp on creation and still uses the script max hp(the number that pops up on a separate window). And if i use Yanfly's Passive states to call the state with the notetag in it, it won't work even when the state is successfully applied. Is it possible to update that script to add current functions and make it works with Yanfly's Passive States?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
You can edit the max hp of the script, that should be in there. However, the reason I moved away from states and that old version is I couldn't fix the bugs in that method due to the way the game uses and sets up states. That's why I discontinued that approach. I don't even have that old code anymore so I can't modify it, but someone else is free to try.

Though, the way I was using a barrier was for a cast it as a shield to block damage (all or some, depending on your setting). It *might* work with a passive state script in the newer version if you set a state for the shield first (as you have to do that too even in the new version), then tell it to add the state. You would need to manually add the hp though via a script call, and I'm not sure how that can be done as I've never found the code for when equipment is equipped in this game.
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
You can edit the max hp of the script, that should be in there. However, the reason I moved away from states and that old version is I couldn't fix the bugs in that method due to the way the game uses and sets up states. That's why I discontinued that approach. I don't even have that old code anymore so I can't modify it, but someone else is free to try.
The old script(0.96) works pretty well on its own, I find it working with Hime's Equip Event(where i add the state using a common event and the barrier is added after i exit the menu), but not with Yanfly's Passive States(where the state is applied but the barrier isn't working).

The thing that bothers me is that the max barrier hp used to create the barrier isn't being applied to the hp gauge(eg, create barrier with 1500hp, the gauge shows 1500/5000), and that won't even be a big problem with a few "bypass" edits in the script.

The major problem i have with that script is that pop up window like an error message, but it doesn't crash the game. Simply a pop up window showing a set of number which happens to be the barrier max hp in the script setting, and after you press the [OK] button the barrier is created and show up in the menu. Not even sure how you managed to make a pop up window that doesn't crash the game. lol! But that pop up is definitely in the way when adding/creating a new barrier, making it unusable for me.

It *might* work with a passive state script in the newer version if you set a state for the shield first (as you have to do that too even in the new version), then tell it to add the state. You would need to manually add the hp though via a script call, and I'm not sure how that can be done as I've never found the code for when equipment is equipped in this game.
The state required in your new script(1.01) does nothing but works like a flag(switch) to tell the script whether the barrier is activated. So adding the state alone using Yanfly's Passive States won't work. And sadly, there's no way to force cast a skill using events other than troops event.

Well, it can still work if i set up a troop event condition checking if actor x is wear equipment x then force cast the skill at the start of the battle. But.. that's far from being a solution in my opinion, because it only works after a battle occurs and not during equipping the equipment.

The only possible approach i can think of is by using a state or script call the function into the equipment with a notetag.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
The major problem i have with that script is that pop up window like an error message, but it doesn't crash the game. Simply a pop up window showing a set of number which happens to be the barrier max hp in the script setting, and after you press the [OK] button the barrier is created and show up in the menu. Not even sure how you managed to make a pop up window that doesn't crash the game. lol! But that pop up is definitely in the way when adding/creating a new barrier, making it unusable for me.
Go to scripts, hit CTRL-SHIFT-F (all at the same time), type in msgbox_p, and look for the line that has that command in the script, add a # sign at the start of the line (it will all turn green if you did it right). That was added for error catching and I forgot to ever comment it out before switching over to the other version.

That should fix that part.
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
Thanks, at least now i have a substitute to work on while hoping someone might pops by with a better solution.  :)  
The problem left now will be the state removing itself after it reaches HP 0 leaving the equipment behind safe and sound, and re-equipping the equipment each time reset the HP barrier to full HP(this opens up to hp cheating). Will also need to add a variable to get the current hp of the barrier and have a parallel process running all time to remove and destroy the equipment when the hp reaches 0(which doesn't work in battle when parallel is turned on, and will need another troop event that check conditions every turn during battle  ;_;  ). 

By the way, haven't test it on damage floors, does it blocks them too?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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
How many parameters is 'too many'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top