X0 i0 common

From NWN Lexicon



[edit] x0_i0_common

Common functions used across multiple include files.<br /><br /> NOTE 1: This file contains a couple of functions that are also present in x0_i0_transport.

[edit] Constants

Name Value Brief Description
CONVERSATION_ATTEMPT_DELAY 3.0 Controls the amount of delay between persistent conversation attempts.
DIFFICULTY_EASY 1 Difficulty setting for skill checks.
DIFFICULTY_HARD 3 Difficulty setting for skill checks.
DIFFICULTY_IMPOSSIBLE 4 Difficulty setting for skill checks.
DIFFICULTY_MODERATE 2 Difficulty setting for skill checks.
sAdviceSuffix _ADV This gets tacked onto the NPC's tag to denote the tag for their "home" waypoint.
sDidQuitSuffix _QUIT This gets tacked onto the NPC's tag to denote the tag for their "home" waypoint.
sFriendSuffix _FR This gets tacked onto the NPC's tag to denote the tag for their "home" waypoint.
sHasHiredSuffix _HIRED This gets tacked onto the NPC's tag to denote the tag for their "home" waypoint.
sHasInterjectionSuffix _INTJ This gets tacked onto the NPC's tag to denote the tag for their "home" waypoint.
sHasMetSuffix _MET This gets tacked onto the NPC's tag to denote the tag for their "home" waypoint.
sInterjectionSetSuffix _INTJ_SET This gets tacked onto the NPC's tag to denote the tag for their "home" waypoint.
sOneLinerVarname X0_CURRENT_ONE_LINER Holds the current one-liner.
sOneShotVarname X0_ONE_SHOT_EVENT Holds whether this NPC's one-shot event has occurred.
sPersuadeAttemptSuffix _PERSUADE This gets tacked onto the NPC's tag to denote the tag for their "home" waypoint.
sPersuadeSuccessSuffix _PERSUADE_SUCC This gets tacked onto the NPC's tag to denote the tag for their "home" waypoint.
sRespawnLocationVarname X0_RESPAWN_LOC Goes on the PC to specify the respawn point for them and their henchman.
sRouterTag X0_EVT_ROUTER_M The event router is the object in each module that will be responsible for receiving user-defined events (eg, for quest start or completion), and then in turn sending events out to the henchmen and other NPCs as appropriate to trigger new effects on them.
sStartLocationVarname X0_START_LOC Marks the starting location of a creature.
sThreatenSuffix _THREAT This gets tacked onto the NPC's tag to denote the tag for their "home" waypoint.
X0_DEBUG_SETTING 0 If this is set to 0, all debug messages will be turned off. Note that the code WILL still be compiled in, so this is not ideal for final release.


[edit] Functions

Name Brief Description
ClearAllDialogue Call to clear all dialogue events.
CreateEventRouter Create the appropriate event router for this chapter in the starting location. The event router should be an invisible object.
DBG_msg Print out a short message to the log files.
EndModule

This *ALWAYS* returns false. That is the only thing this function does.

ONLY VALID IN EXPANSION PACK 0! NOT VALID FOR USER MODULES!

NOTE: This is different than the version found in nw_i0_henchman .

FriendCheck Friendly check.
GetBooleanValue Get the value of a TRUE/FALSE variable on the specified object.
GetCampaignBooleanValue Get the value of a persistent TRUE/FALSE variable on the specified object.
GetChapter

Returns the number of the current chapter of the game.

THIS WILL ONLY WORK CORRECTLY IN EXPANSION PACK 0. NOT VALID FOR USER MODULES!

NOTE: This is different than the version found in nw_i0_henchman .

GetDidPersuade Determine whether the PC has successfully persuaded the NPC.
GetEventRouter Return the appropriate event router for this chapter. This function will create the event router if it doesn't already exist.
GetEventRouterTag Return the appropriate event router tag for this chapter.
GetFriendly Check how friendly/nasty the PC has been to this NPC.
GetHasAdvice Call to determine if the NPC has advice to give to this PC.
GetHasInterjection Call to determine if the NPC has an interjection to make to this PC.
GetMyArea

Returns the tag of the current area the specified object is in.

NOTE: This is slightly different than the version found in nw_i0_henchman . This version tests that the target creature is valid. If it is invalid the function returns "".

GetOneLiner Determine whether and which one-liner an NPC has available.
GetPersuadeAttempt Determine whether the PC has attempted to persuade an NPC.
GetRespawnLocation Get the current respawn point for the caller.
GetTagNoPrefix Returns the tag of the target with the 3-letter prefix (x0_) stripped. Useful since these are stripped from blueprint resrefs when editing copies.
GetThreaten Determine if the PC attempted to threaten the NPC.
HasItemByTag Determine if the target is carrying the specified object.
MeanCheck Unfriendly check.

PersistentConversationAttempt

This function attempts to ensure that an NPC starts a conversation with a specified PC.
SetBooleanValue Set a TRUE/FALSE value on the specified object.
SetCampaignBooleanValue Set a TRUE/FALSE persistent value on the specified object.
SetDidPersuade Indicate that the PC persuaded the NPC.
SetFriendly Indicate that the PC did something friendly use FALSE if the PC was nasty. This increments/decrements a variable on the PC and can be looked up to see how many friendly or nasty acts a player has committed to this NPC.
SetHasAdvice Call to indicate this NPC has some advice to give to this PC and which advice set if so.
SetHasInterjection Call to indicate this NPC has an interjection to make to this PC and which one if so.
SetInterjection Call to set the interjection value.
SetOneLiner Set whether an NPC has a one-liner available to make.
SetPersuadeAttempt Indicate that the PC attempted to persuade the NPC.
SetRespawnLocation Set the respawn point to the current location of the caller.
SetRespawnLocationSpecific Set the respawn point for the target to a specific location.
SetThreaten Indicate that the PC attempted to threaten the NPC.
ThreatenCheck Threaten check.



 author: Charles Feduke, editor: Mistress
 

Personal tools
Categories