Neverwinter Nights Forum Update
Posted Thursday, July 11, 2002 - 21:30 CET by Z-Layrex
David Gaider, Designer
Nearest NPC Creature: GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC);
That will return the nearest non-PC creature to the caller.
More:
A couple of things I can think of:
1) The door is going to fire off this script every time the player hits it... it's possible that your guard could be receiving multiple commands,or could already be busy.
I would suggest that you send a ClearAllActions() to the guard (at least once) to clear his current queue before getting him to move to the PC.
2) Are you sure the guard is the nearest non-PC to the door? The PC doesn't have any companions or similar?
3) Instead of getting the PC with GetNearestCreature, it might be more accurate to use GetLastAttacker.
Conversation: BeginConversation is primarily supposed to be used within the context of an OnDialogue event. It IS possible to use it elsewhere, but ActionStartConversation is going to get you better results overall. The 'Useable' flag for an item you want to speak is immaterial. It is simply required that 'Static' must be unchecked. Check out the post on placeables & dialogue in the FAQ sticky up top.
Neil Flynn, Programmer
Highlighted Text: Hi,
The three types of highlighting are:
Action is for "Show the item to the king"
Check is for a skill check "Persuade"
Highlight is for other stuff you may want.
The highlights do not actually do anything. Just because I put a check highlight in the dialogue, doesn't mean there actually is a check. You have to add that in yourself through scripting (or the script wizard). The highlights are independent of any actions or skill checks, they are just a visual notification to the user.
Don Moar, Tools Programmer
Conversation Nodes: Yup, Brand has it right. The NPC will always say the first node whose start condition (Text Appears When...) returns TRUE. If a node doesn't have a script assigned, it returns TRUE by definition. So organize your conversations so that the node that has the most restrictions (conditions) is at the top and reduce the restrictions on each subsequent sibling node. If no NPC node has a start condition that returns TRUE, the game will use the last sibling in the list.