Aller au contenu

Photo

Two (simple?) questions


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

#1
0x30A88

0x30A88
  • Members
  • 1 081 messages
I have a boss demon in my fade area and 4 lesser rage deons, is there an event for when the creature have reached 50% health? The second question would then be, how can I make it so the 4 lesser rage demons does not appear at the beginning, but spawn out of the ground when the boss has reached 50%?

#2
Sunjammer

Sunjammer
  • Members
  • 925 messages
Question 1

I haven't tried it but I think comparing the boss demon's current health against the maximum health in its EVENT_TYPE_DAMAGED event would get you there.

GetMaxHealth and GetCurrentHealth functions can be found in core_h (though it's unlikley you'll have to specifically include it in an event script) so you should end up with something like this snippet:

    float fCurrent = GetCurrentHealth(oBoss);
    float fHalf = GetMaxHealth(oBoss) / 2;
    if(fCurrent <= fHalf)
    {
        // activate minions!
    }

Question 2

Place the minions in the area as normal but set them to inactive. In the above script use SetObjectActive function to make each of them appear.

If memory serves if you don't specify anything in nAnimation the creatures will play their default appear animation (for example spiders drop from above) but you can always specify another one using that parameter.

If the default animation suffices then you can also simplify things a bit by giving the minions a team number (different from their boss) and then using UT_TeamAppears (you may have to include utility_h).

Modifié par Sunjammer, 28 octobre 2010 - 08:13 .


#3
Mengtzu

Mengtzu
  • Members
  • 258 messages
Sunjammer's answers are totally correct and sufficient.

But I'm going to link the blog post where I extensively discuss the implementation of health-based boss phases anyway ;)

#4
Sunjammer

Sunjammer
  • Members
  • 925 messages
Bookmarked for when I get to bosses!

#5
0x30A88

0x30A88
  • Members
  • 1 081 messages
Thank you - sorry for not responding, was logged off last time I read it.

This is awesome indeed!