bossfight HP bar half empty, can I fix?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
[SMUG]Ipecac
Posts: 28
Joined: Tue Oct 21, 2014 5:51 am

bossfight HP bar half empty, can I fix?

Post by [SMUG]Ipecac »

Hey guys,

I have a bossfight with a wizard, and it's HP is reduced to 500hp to make it possible at lower levels. His HP bar shows 500/1500hp at the start, can I make the HP bar look right?
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: bossfight HP bar half empty, can I fix?

Post by Skuggasveinn »

Don't use setHealth to change the hitpoints, use setMaxHealth
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
mythos
Posts: 14
Joined: Fri Oct 24, 2014 2:04 am

Re: bossfight HP bar half empty, can I fix?

Post by mythos »

Skuggasveinn wrote:Don't use setHealth to change the hitpoints, use setMaxHealth
Where do I go about putting this function? I too, have this problem.
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: bossfight HP bar half empty, can I fix?

Post by Skuggasveinn »

lets say you are going to use skeleton_commander is your boss, before you start the fight, or when you spawn your boss (if you are spawning him with a script) change the MaxHealth

Code: Select all

function setbosshealth()
      skeleton_commander_1.monster:setMaxHealth(250)
end 
Then when you are starting the boss fight you add your skeleton_commander to the boss fight.
When you add him here he will have MaxHealth of 250 and the bar will be full.

Code: Select all

function startBrothersBossFight()                      
   boss_fight_brothers.bossfight:addMonster(skeleton_commander_1.monster)
   boss_fight_brothers.bossfight:activate()
end
hope that helps.

Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
mythos
Posts: 14
Joined: Fri Oct 24, 2014 2:04 am

Re: bossfight HP bar half empty, can I fix?

Post by mythos »

Skuggasveinn wrote:lets say you are going to use skeleton_commander is your boss, before you start the fight, or when you spawn your boss (if you are spawning him with a script) change the MaxHealth

Code: Select all

function setbosshealth()
      skeleton_commander_1.monster:setMaxHealth(250)
end 
Then when you are starting the boss fight you add your skeleton_commander to the boss fight.
When you add him here he will have MaxHealth of 250 and the bar will be full.

Code: Select all

function startBrothersBossFight()                      
   boss_fight_brothers.bossfight:addMonster(skeleton_commander_1.monster)
   boss_fight_brothers.bossfight:activate()
end
hope that helps.

Skuggasveinn.
I have this setup correctly, as I can see his hp increase a bit when I step over the trigger that triggers the boss and runs the script. It still shows a lot of missing HP if I adjust the monsters level to 5. It seems like monster level is overriding the maxhp and the bar is still partially empty.

Thanks for all your help!
[SMUG]Ipecac
Posts: 28
Joined: Tue Oct 21, 2014 5:51 am

Re: bossfight HP bar half empty, can I fix?

Post by [SMUG]Ipecac »

That's it! Thanks very much man. My wizard is now looking right.
Post Reply