No idea how to check boss HP

JEIA_CORP

Veteran
Veteran
Joined
Aug 24, 2019
Messages
68
Reaction score
4
First Language
English
Primarily Uses
RMVXA
I'm a user of RPG Maker VX Ace. It was suggested to me by a friend that I should include a function to check a bosses HP mid-bossfight. After failing to create this on my own, I googled some tutorials but was unable to find what I was looking for. (All I found were guides on how to make an HP bar.)
What I have in mind is a Skill (something similar to Cyrus' Study from Octopath Traveler) that would display the bosses current HP
when used. (The number would change according to the damage the boss has taken and so on)
Please advise as I am helpless on my own.
Many thanks.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
Being a boss means that you already know which battler you are talking about in the troop array (you can check its position in the Troop tab in your database).
You can simply create a skill that calls a common event. In the common event you can store the boss HP in a variable. After that you can either use the said variable to show the remaining HP, or use that variable to show how much damage has been dealt. Everything can be handled through the Control Variable event command. Once you have that, all you have to do is change that variable according to your boss health.

You could refresh the variable value at the end of each turn and show a message window whenever you refresh it, or you could create a separate window to show the said value. Not having played Octopath Traveler I cannot understand what you are looking for so this is all the help I can provide. If you give us more information, even those who did not play the game you mentioned can help you. It is usually better to explain things with more details rather than just saying "like game X", otherwise you are going to limit the number of users that can help you to the intersection between those who played the game and those who read your post (which is naturally smaller than or equal to the smallest of the two sets).
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Specifically, the command is Control Variables > Game Data > Enemy > 1's (assuming the boss is the first enemy you placed in that troop) > HP
 

JEIA_CORP

Veteran
Veteran
Joined
Aug 24, 2019
Messages
68
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Regarding Cyrus' Study: Upon activation, the enemies HP is shown as Current HP/Total HP.
I'll try your suggestion. Would I have to create a common event for every boss?
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
Would I have to create a common event for every boss?
No, you are not supposed to create a different common event for every boss, not if you do it in a smart way at least. I recommend taking advantage of element rates for that. Create an element called "boss" and make all your bosses take 0 damage from that element. This allows you to immediately understand which enemy is the boss in your current troop array by checking the element_rate of each enemy for that element.

Code:
boss = $game_troop.members.select { |enemy| enemy.element_rate(boss_element_id) < 0.1 }
if (boss.length != 0)
  $game_variables[variable_id_for_hp] = boss[0].hp
  $game_variables[variable_id_for_mhp] = boss[0].mhp
end
 

JEIA_CORP

Veteran
Veteran
Joined
Aug 24, 2019
Messages
68
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Ah, gotcha.
Do I have to script that?
If so where?
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
If you don't want to write a different event for each boss you need the script call I provided. You can put it in a script call in the common event linked to your skill.
 

JEIA_CORP

Veteran
Veteran
Joined
Aug 24, 2019
Messages
68
Reaction score
4
First Language
English
Primarily Uses
RMVXA
So it goes:
Common Events>Script>The stuff you posted above right?
 

JEIA_CORP

Veteran
Veteran
Joined
Aug 24, 2019
Messages
68
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Tried putting the code shown above into a Common Event, then using the common event in a skill.
Tried it on a boss and this is what I got:
Something I missed or forgot to include?
 

Attachments

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
You are supposed to change those ID placeholders (namely "boss_element_id", "variable_id_for_hp" and "variable_id_for_mhp") to real IDs from your database. I could not do that because I cannot see your whole project, but you know which variables you want to use and which one is the boss_element that you created, so change them accordingly.
 

JEIA_CORP

Veteran
Veteran
Joined
Aug 24, 2019
Messages
68
Reaction score
4
First Language
English
Primarily Uses
RMVXA
so change boss_element_id to the name of the boss and so forth?
 

JEIA_CORP

Veteran
Veteran
Joined
Aug 24, 2019
Messages
68
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Where would I create the element? In script?
This is the code you posted above, what parts exactly do I change?
I can send a picture of an example boss if needed
 

Attachments

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
Where would I create the element?
This is a very basic question. Since things are as they are, I recommend you to follow the link to Andar's tutorial in my signature. Taking your time understanding how the engine exactly works will greatly speed up your development process later on.
 

JEIA_CORP

Veteran
Veteran
Joined
Aug 24, 2019
Messages
68
Reaction score
4
First Language
English
Primarily Uses
RMVXA
I don't suppose you have a link to that specific tutorial?
 

JEIA_CORP

Veteran
Veteran
Joined
Aug 24, 2019
Messages
68
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Ahh! Now I see!
Thanks a ton you guys!
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
[dpost]JEIA_CORP[/dpost]
If you want to add something just use the Edit button and type the additional info/comment. What many people do to make it clear that it's an addition is this:
EDIT
More stuff here.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top