Ironworks Gaming Forum

Ironworks Gaming Forum (http://www.ironworksforum.com/forum/index.php)
-   Neverwinter Nights 1 & 2 Also SoU & HotU Forum (http://www.ironworksforum.com/forum/forumdisplay.php?f=16)
-   -   Scripting Question (http://www.ironworksforum.com/forum/showthread.php?t=34976)

Willard 10-13-2002 07:31 PM

How do you script an NPC to walk away and disappear? I have tried and tried to make the penguin go away, but it won't do it! [img]graemlins/1pissed.gif[/img] [img]graemlins/awcrap.gif[/img]

Chewbacca 10-13-2002 07:34 PM

What fires the event? Is it the end of a conversation or when a player enters a certain area?

Willard 10-13-2002 08:21 PM

It's at the end of a conversation, when the penguin goes to find some fish. [img]tongue.gif[/img]

Chewbacca 10-13-2002 11:55 PM

Place this script in the end of conversation event found in the conversation editor under the current file tab.

This script will cause a penguin to move to a waypoint with the tag "fishinghole" and disappear in 20 seconds after the end of it's conversation. You can change the time before disappearing by editing the value of the number in the last line.

One known issue is the destination waypoint must be in a fairly straight line from the place the script fires due to NWN lack of pathfinding.

So make a new waypoint with the tag fishinghole and place it where you want the penguin to go and disappear. You may have to tweak the delay before disappearance to suit your needs.

Please reply if you have any problems as I have yet to test this particular script myself, though I have successfully executed this process several times in my current module endeavor. My NWN PC is rendering a Bryce animation and doesn't want to be disturbed. [img]smile.gif[/img] I will test it myself when it is done. Goodluck!

Here is the script:

//
//
void main()
{
object oWP = GetObjectByTag("fishinghole"); //Define destination waypoint

location lDest = GetLocation(oWP);// Define location of destination waypoint

ActionMoveToLocation(lDest, FALSE); // move to destination waypoint

DestroyObject(OBJECT_SELF, 20.0); //Disappear after 20 seconds
}

[ 10-14-2002, 12:10 AM: Message edited by: Chewbacca ]


All times are GMT -4. The time now is 11:15 PM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
©2024 Ironworks Gaming & ©2024 The Great Escape Studios TM - All Rights Reserved