Aller au contenu

Photo

Triggers based on a boss' health level


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Kilrogg_

Kilrogg_
  • Members
  • 296 messages
This was sort of touched upon in a thread I made a while ago about enemies surrendering, where it was suggested I use EVENT_TYPE_DAMAGED, but after looking at that event's parameters I'm not sure where to start.

Ultimately I want to trigger stuff when a boss hits 75%, 50% and 25% hp. EVENT_TYPE_DAMAGED only seems to return the latest hit's damage... I guess I need to do some magic where all the damage gets added until it crosses the 75%/50%/25% threshold but I'm not sure I even know how to do that.

Considering how basic of a boss mechanic this is, I assume there's an easier way...

Modifié par Kilrogg_, 26 juin 2010 - 04:39 .


#2
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
The easiest way would be to use GetCurrentHealth() and GetMaxHealth() and using simple maths get the boss's current health percentage. If it has reached one of your thresholds, perform the appropriate action. Of course, you'll want a local variable or plot flag(s) to keep track of if you've fired off the action, but that is fairly easy to do.

Modifié par AmstradHero, 26 juin 2010 - 04:49 .


#3
Kilrogg_

Kilrogg_
  • Members
  • 296 messages
Thanks, that worked fine.



Any idea how to trigger an ambient spoken line through scripting? I tried to use PlaySoundset to trigger a 100% probability line from a custom soundset but I didn't hear anything in-game (and I did have the VO generated).



The idea is the boss would say something (voice, not just a floaty message) at certain health thresholds.



Should I just use PlaySound instead?

#4
Kilrogg_

Kilrogg_
  • Members
  • 296 messages
PlaySound doesn't seem to work either but I've never had any luck getting that and PlayMusic to ever work so that's no news.



Does anyone have any idea how I would get an hostile NPC to speak a line during combat?

#5
FergusM

FergusM
  • Members
  • 460 messages
PlaySound doesn't work? That's unusual. Does it work for existing sounds in the toolset? I've been able to use things like PlaySound(GetHero(),"glo_gui/gui/gui_fade_flash");.

#6
Kilrogg_

Kilrogg_
  • Members
  • 296 messages
Maybe the volume is too low for me to hear through the combat sounds... but no, that does not seem to work.