|
NWNX:EE
8193.36.12
|
|
Go to the documentation of this file.
7 const string NWNX_Util =
"NWNX_Util";
135 string NWNX_Util_AddScript(
string sFileName,
string sScriptData,
int bWrapIntoMain = FALSE,
string sAlias =
"NWNX");
197 object NWNX_Util_CreateDoor(
string sResRef, location locLocation,
string sNewTag =
"",
int nAppearanceType = -1);
270 string sFunc =
"GetCurrentScriptName";
278 string sFunc =
"GetAsciiTableString";
285 string sFunc =
"Hash";
305 string sFunc =
"GetCustomToken";
313 string sFunc =
"EffectTypeCast";
321 string sFunc =
"EffectTypeCast";
329 string sFunc =
"StripColors";
337 string sFunc =
"GetEnvironmentVariable";
345 string sFunc =
"GetMinutesPerHour";
352 string sFunc =
"SetMinutesPerHour";
359 string sFunc =
"EncodeStringForURL";
369 string sFunc =
"GetFirstResRef";
381 string sFunc =
"GetNextResRef";
390 string sFunc =
"GetLastCreatedObject";
399 string NWNX_Util_AddScript(
string sFileName,
string sScriptData,
int bWrapIntoMain = FALSE,
string sAlias =
"NWNX")
401 string sFunc =
"AddScript";
414 string sFunc =
"AddNSSFile";
426 string sFunc =
"RemoveNWNXResourceFile";
438 string sFunc =
"SetInstructionLimit";
446 string sFunc =
"GetInstructionLimit";
455 string sFunc =
"SetInstructionsExecuted";
463 string sFunc =
"GetInstructionsExecuted";
472 string sFunc =
"RegisterServerConsoleCommand";
483 string sFunc =
"UnregisterServerConsoleCommand";
491 WriteTimestampedLogEntry(
"WARNING: NWNX_Util_PluginExists is deprecated. You should migrate to NWNX_PluginExists.");
497 string sFunc =
"GetUserDirectory";
504 string sFunc =
"GetScriptReturnValue";
511 object NWNX_Util_CreateDoor(
string sResRef, location locLocation,
string sNewTag =
"",
int nAppearanceType = -1)
513 string sFunc =
"CreateDoor";
515 vector vPosition = GetPositionFromLocation(locLocation);
532 string sFunc =
"SetItemActivator";
540 string sFunc =
"GetWorldTime";
554 string sFunc =
"SetResourceOverride";
564 string sFunc =
"GetResourceOverride";
575 string sFunc =
"GetScriptParamIsSet";
585 string sFunc =
"SetDawnHour";
593 string sFunc =
"SetDuskHour";
602 string sFunc =
"GetHighResTimeStamp";
612 string sFunc =
"GetTTY";
620 string sFunc =
"SetCurrentlyRunningEvent";
628 string sFunc =
"LevenshteinDistance";
638 string sFunc =
"UpdateClientObject";
647 string sFunc =
"CleanResourceDirectory";
656 string sFunc =
"GetModuleTlkFile";
string NWNX_Util_GetTTY()
string NWNX_Util_StripColors(string str)
Strip any color codes from a string.
itemproperty NWNX_Util_EffectToItemProperty(effect e)
Convert an effect type to an itemproperty type.
int NWNX_GetReturnValueInt()
Returns the specified type from the c++ side.
int NWNX_Util_GetModuleMtime()
Gets the last modified timestamp (mtime) of the module file in seconds.
effect NWNX_GetReturnValueEffect()
Returns the specified type from the c++ side.
void NWNX_Util_UnregisterServerConsoleCommand(string sCommand)
Unregister a server console command that was registered with NWNX_Util_RegisterServerConsoleCommand()...
string NWNX_Util_GetCustomToken(int customTokenNumber)
Gets the value of customTokenNumber.
string NWNX_Util_AddScript(string sFileName, string sScriptData, int bWrapIntoMain=FALSE, string sAlias="NWNX")
Compiles and adds a script to the UserDirectory/nwnx folder, or to the location of sAlias.
const int NWNX_UTIL_RESREF_TYPE_AREA_GIT
int NWNX_Util_GetStringLevenshteinDistance(string sString, string sCompareTo)
Calculate the levenshtein distance of two strings.
int seconds
Seconds since epoch.
string NWNX_Util_GetModuleTlkFile()
Return the filename of the tlk file.
int NWNX_Util_RegisterServerConsoleCommand(string sCommand, string sScriptChunk)
Register a server console command that will execute a script chunk.
int NWNX_Util_GetInstructionLimit()
Get the NWScript instruction limit.
struct NWNX_Util_WorldTime NWNX_Util_GetWorldTime(float fAdjustment=0.0f)
Get the world time as calendar day and time of day.
A high resolution timestamp.
int nCalendarDay
The calendar day.
itemproperty NWNX_GetReturnValueItemProperty()
Returns the specified type from the c++ side.
const int NWNX_UTIL_RESREF_TYPE_TRIGGER
int microseconds
Microseconds.
int NWNX_Util_RemoveNWNXResourceFile(string sFileName, int nType, string sAlias="NWNX")
Remove sFileName of nType from the UserDirectory/nwnx folder, or from the location of sAlias.
const int NWNX_UTIL_RESREF_TYPE_NSS
const int NWNX_UTIL_RESREF_TYPE_ENCOUNTER
void NWNX_Util_SetResourceOverride(int nResType, string sOldName, string sNewName)
Set a server-side resource override.
void NWNX_CallFunction(string pluginName, string functionName)
Scripting interface to NWNX.
int NWNX_Util_GetInstructionsExecuted()
Get the number of NWScript instructions currently executed.
object NWNX_Util_CreateDoor(string sResRef, location locLocation, string sNewTag="", int nAppearanceType=-1)
Create a door.
void NWNX_Util_SetItemActivator(object oObject)
Set the object that will be returned by GetItemActivator.
string NWNX_Util_GetFirstResRef(int nType, string sRegexFilter="", int bModuleResourcesOnly=TRUE)
Get the first resref of nType.
string NWNX_GetReturnValueString()
Returns the specified type from the c++ side.
void NWNX_PushArgumentString(string value)
Pushes the specified type to the c++ side.
const int NWNX_UTIL_RESREF_TYPE_SOUND
int NWNX_Util_GetScriptParamIsSet(string sParamName)
Get if a script param is set.
string NWNX_Util_EncodeStringForURL(string str)
Encodes a string for usage in a URL.
void NWNX_PushArgumentObject(object value)
Pushes the specified type to the c++ side.
void NWNX_PushArgumentInt(int value)
Pushes the specified type to the c++ side.
int NWNX_Util_CleanResourceDirectory(string sAlias, int nResType=0xFFFF)
Clean a resource directory, deleting all files of nResType.
int NWNX_Util_GetScriptReturnValue()
Get the return value of the last run script with a StartingConditional.
const int NWNX_UTIL_RESREF_TYPE_NCS
void NWNX_Util_SetDawnHour(int nDawnHour)
Set the module dawn hour.
int NWNX_Util_PluginExists(string sPlugin)
Determines if the given plugin exists and is enabled.
void NWNX_PushArgumentEffect(effect value)
Pushes the specified type to the c++ side.
const int NWNX_UTIL_RESREF_TYPE_PLACEABLE
string NWNX_Util_GetModuleFile()
Gets the module short file name.
string NWNX_Util_GetAsciiTableString()
Gets a string that contains the ascii table.
void NWNX_Util_SetCurrentlyRunningEvent(int nEventID)
Set the currently running script event.
void NWNX_Util_UpdateClientObject(object oObjectToUpdate, object oPlayer=OBJECT_INVALID)
Sends a full object update of oObjectToUpdate to all clients.
const int NWNX_UTIL_RESREF_TYPE_WAYPOINT
string NWNX_Util_GetNextResRef()
Get the next resref.
string NWNX_Util_GetEnvironmentVariable(string sVarname)
Retrieves an environment variable.
const int NWNX_UTIL_RESREF_TYPE_TWODA
void NWNX_Util_SetInstructionsExecuted(int nInstructions)
Set the number of NWScript instructions currently executed.
void NWNX_Util_SetInstructionLimit(int nInstructionLimit)
Set the NWScript instruction limit.
void NWNX_Util_SetDuskHour(int nDuskHour)
Set the module dusk hour.
int nTimeOfDay
The time of day.
object NWNX_Util_GetLastCreatedObject(int nObjectType, int nNthLast=1)
Get the last created object.
object NWNX_GetReturnValueObject()
Returns the specified type from the c++ side.
int NWNX_Util_GetMinutesPerHour()
Gets the module real life minutes per in game hour.
const int NWNX_UTIL_RESREF_TYPE_STORE
string NWNX_Util_GetResourceOverride(int nResType, string sName)
Get a server-side resource override.
struct NWNX_Util_HighResTimestamp NWNX_Util_GetHighResTimeStamp()
void NWNX_Util_SetMinutesPerHour(int minutes)
Set module real life minutes per in game hour.
const int NWNX_UTIL_RESREF_TYPE_DOOR
const int NWNX_UTIL_RESREF_TYPE_ITEM
const int NWNX_UTIL_RESREF_TYPE_CREATURE
int NWNX_PluginExists(string sPlugin)
Determines if the given plugin exists and is enabled.
void NWNX_PushArgumentFloat(float value)
Pushes the specified type to the c++ side.
effect NWNX_Util_ItemPropertyToEffect(itemproperty ip)
Convert an itemproperty type to an effect type.
void NWNX_PushArgumentItemProperty(itemproperty value)
Pushes the specified type to the c++ side.
const int NWNX_UTIL_RESREF_TYPE_DIALOG
string NWNX_Util_GetUserDirectory()
Gets the server's current working user folder.
int NWNX_Util_AddNSSFile(string sFileName, string sContents, string sAlias="NWNX")
Adds a nss file to the UserDirectory/nwnx folder, or to the location of sAlias.
string NWNX_Util_GetCurrentScriptName(int depth=0)
Gets the name of the currently executing script.
const int NWNX_UTIL_RESREF_TYPE_AREA_ARE
int NWNX_Util_Hash(string str)
Gets an integer hash of a string.