Aller au contenu

Photo

How to make NPC disappear?


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

#1
archer4217

archer4217
  • Members
  • 105 messages
Hiya sweeties,

I have an npc that lures players to an area via waypoints. Once it reaches the last wp, how can I make it disappear?

Thank you :)

#2
WhiZard

WhiZard
  • Members
  • 1 204 messages
How do you want it to disappear. Do you want the creature to be destroyed or do you want it to appear somewhere else, or do you want it simply hidden from view but remain in place?

Most of the answers will likely involve the cutscene invisibility visual effect as well as other things.

#3
archer4217

archer4217
  • Members
  • 105 messages
Hiya sweetie,

I want the creature to be destroyed when it reaches the last wp.

#4
Kato -

Kato -
  • Members
  • 392 messages
In the code wich makes your NPC move from one waypoint to another, once your NPC reaches the last waypoint, simply call DestroyObject(<your npc object>). So, if the code is executed from one of the NPC event handlers, it would be: DestroyObject(OBJECT_SELF). If the NPC is controlled by another object, simply replace OBJECT_SELF by the variable referencing your NPC in code.

Kato

Modifié par Kato_Yang, 22 octobre 2011 - 12:14 .


#5
archer4217

archer4217
  • Members
  • 105 messages
Umm...ok, so I would put this destroy script in the nw c2 default 9 in the onspawn slot? I believe that's the script that makes npc's walk waypoints, right?

#6
Fester Pot

Fester Pot
  • Members
  • 1 394 messages
Don't go making modifications to the stock NWN scripts unless you're prepared to create complications with every NPC that walks waypoints being destroyed at the end of their waypoint cycle.

Draw a trigger around the last waypoint this particular NPC walks.

void main()
{

object oEntering = GetEnteringObject();

if (GetTag(oEntering) == "TAG_OF_NPC")
{
DestroyObject(oEntering);
}
}


FP!

#7
kalbaern

kalbaern
  • Members
  • 824 messages

Fester Pot wrote...

Don't go making modifications to the stock NWN scripts unless you're prepared to create complications with every NPC that walks waypoints being destroyed at the end of their waypoint cycle.

Draw a trigger around the last waypoint this particular NPC walks.

void main()
{

object oEntering = GetEnteringObject();

if (GetTag(oEntering) == "TAG_OF_NPC")
{
DestroyObject(oEntering);
}
}


FP!


FP's suggestion is one I've long used to make carraiges and wagons dissappear at a transtion or even make an NPC the appears to enter a door or drop down a sewer.

#8
archer4217

archer4217
  • Members
  • 105 messages
Awesome FP, thank you so much. That's just what I needed. And thank you to everyone else who replied. *hugs*