Aller au contenu

Photo

Making an NPC hover


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

#1
Qutayba

Qutayba
  • Members
  • 1 295 messages
I'm making a scripted boss fight, and I want the boss to hover invulnerable in the air above the fight while its minions are killed.  I've tried putting a waypoint in the air and/or an invisible object and using the following function.  The creature jumps to the x & y of the position, but not the z.  (Yes, I'm going for an immediate jumps.  Doing the transition from ground to air in a cutscene seems simpler than making an ongoing gradual movement script - but I want it to stay in the air after the cutscene!).

object oBoss = GetObjectByTag("wh_boss");
object oSpot = GetObjectByTag("wh_invis_object");
vector vSpot = GetPosition(oSpot);
SetPosition(oBoss, vSpot, FALSE);  // FALSE = turning "safe position" off.  I'm assuming safe position is what pulls the boss to the ground, or maybe it just prevents the creature from being inside a wall.

I've also tried using an invisible barrier as a floating floor (didn't work, but think of the double decker possibilities if it had!).  I'm guessing that this is a problem with the walkmesh.  Is there something similar to the ability to turn off snap to walkmesh that we have in cutscenes.  (I know how to make the boss float in a cutscene, but I want this to be happening during combat action).

#2
FergusM

FergusM
  • Members
  • 460 messages
SetLocalInt(oBoss,"PHYSICS_DISABLED",TRUE);



and false again when you want him back to normal.

#3
Craig Graff

Craig Graff
  • Members
  • 608 messages
That works. So does SetPhysicsController(oBoss, FALSE);

#4
Qutayba

Qutayba
  • Members
  • 1 295 messages
Nice! Thank you.