NWNX:EE  8193.36.12
nwnx_util.nss
Go to the documentation of this file.
1 #include "nwnx"
6 
7 const string NWNX_Util = "NWNX_Util";
8 
14 const int NWNX_UTIL_RESREF_TYPE_NSS = 2009;
15 const int NWNX_UTIL_RESREF_TYPE_NCS = 2010;
17 const int NWNX_UTIL_RESREF_TYPE_TWODA = 2017;
19 const int NWNX_UTIL_RESREF_TYPE_ITEM = 2025;
23 const int NWNX_UTIL_RESREF_TYPE_SOUND = 2035;
25 const int NWNX_UTIL_RESREF_TYPE_DOOR = 2042;
27 const int NWNX_UTIL_RESREF_TYPE_STORE = 2051;
30 
33 {
35  int nTimeOfDay;
36 };
37 
40 {
41  int seconds;
43 };
44 
49 string NWNX_Util_GetCurrentScriptName(int depth = 0);
50 
55 
59 int NWNX_Util_Hash(string str);
60 
64 
68 
72 string NWNX_Util_GetCustomToken(int customTokenNumber);
73 
77 itemproperty NWNX_Util_EffectToItemProperty(effect e);
78 
82 effect NWNX_Util_ItemPropertyToEffect(itemproperty ip);
83 
87 string NWNX_Util_StripColors(string str);
88 
92 string NWNX_Util_GetEnvironmentVariable(string sVarname);
93 
97 
100 void NWNX_Util_SetMinutesPerHour(int minutes);
101 
106 string NWNX_Util_EncodeStringForURL(string str);
107 
115 string NWNX_Util_GetFirstResRef(int nType, string sRegexFilter = "", int bModuleResourcesOnly = TRUE);
116 
119 string NWNX_Util_GetNextResRef();
120 
126 object NWNX_Util_GetLastCreatedObject(int nObjectType, int nNthLast = 1);
127 
135 string NWNX_Util_AddScript(string sFileName, string sScriptData, int bWrapIntoMain = FALSE, string sAlias = "NWNX");
136 
143 int NWNX_Util_AddNSSFile(string sFileName, string sContents, string sAlias = "NWNX");
144 
150 int NWNX_Util_RemoveNWNXResourceFile(string sFileName, int nType, string sAlias = "NWNX");
151 
154 void NWNX_Util_SetInstructionLimit(int nInstructionLimit);
155 
158 
161 void NWNX_Util_SetInstructionsExecuted(int nInstructions);
162 
165 
171 int NWNX_Util_RegisterServerConsoleCommand(string sCommand, string sScriptChunk);
172 
175 void NWNX_Util_UnregisterServerConsoleCommand(string sCommand);
176 
181 int NWNX_Util_PluginExists(string sPlugin);
182 
186 
190 
197 object NWNX_Util_CreateDoor(string sResRef, location locLocation, string sNewTag = "", int nAppearanceType = -1);
198 
201 void NWNX_Util_SetItemActivator(object oObject);
202 
208 struct NWNX_Util_WorldTime NWNX_Util_GetWorldTime(float fAdjustment = 0.0f);
209 
214 void NWNX_Util_SetResourceOverride(int nResType, string sOldName, string sNewName);
215 
220 string NWNX_Util_GetResourceOverride(int nResType, string sName);
221 
225 int NWNX_Util_GetScriptParamIsSet(string sParamName);
226 
229 void NWNX_Util_SetDawnHour(int nDawnHour);
230 
233 void NWNX_Util_SetDuskHour(int nDuskHour);
234 
237 
239 string NWNX_Util_GetTTY();
240 
243 void NWNX_Util_SetCurrentlyRunningEvent(int nEventID);
244 
249 int NWNX_Util_GetStringLevenshteinDistance(string sString, string sCompareTo);
250 
254 void NWNX_Util_UpdateClientObject(object oObjectToUpdate, object oPlayer = OBJECT_INVALID);
255 
260 int NWNX_Util_CleanResourceDirectory(string sAlias, int nResType = 0xFFFF);
261 
265 
267 
268 string NWNX_Util_GetCurrentScriptName(int depth = 0)
269 {
270  string sFunc = "GetCurrentScriptName";
271  NWNX_PushArgumentInt(depth);
272  NWNX_CallFunction(NWNX_Util, sFunc);
273  return NWNX_GetReturnValueString();
274 }
275 
277 {
278  string sFunc = "GetAsciiTableString";
279  NWNX_CallFunction(NWNX_Util, sFunc);
280  return NWNX_GetReturnValueString();
281 }
282 
283 int NWNX_Util_Hash(string str)
284 {
285  string sFunc = "Hash";
287  NWNX_CallFunction(NWNX_Util, sFunc);
288  return NWNX_GetReturnValueInt();
289 }
290 
292 {
293  NWNX_CallFunction(NWNX_Util, "GetModuleMtime");
294  return NWNX_GetReturnValueInt();
295 }
296 
298 {
299  NWNX_CallFunction(NWNX_Util, "GetModuleFile");
300  return NWNX_GetReturnValueString();
301 }
302 
303 string NWNX_Util_GetCustomToken(int customTokenNumber)
304 {
305  string sFunc = "GetCustomToken";
306  NWNX_PushArgumentInt(customTokenNumber);
307  NWNX_CallFunction(NWNX_Util, sFunc);
308  return NWNX_GetReturnValueString();
309 }
310 
311 itemproperty NWNX_Util_EffectToItemProperty(effect e)
312 {
313  string sFunc = "EffectTypeCast";
315  NWNX_CallFunction(NWNX_Util, sFunc);
317 }
318 
319 effect NWNX_Util_ItemPropertyToEffect(itemproperty ip)
320 {
321  string sFunc = "EffectTypeCast";
323  NWNX_CallFunction(NWNX_Util, sFunc);
324  return NWNX_GetReturnValueEffect();
325 }
326 
327 string NWNX_Util_StripColors(string str)
328 {
329  string sFunc = "StripColors";
331  NWNX_CallFunction(NWNX_Util, sFunc);
332  return NWNX_GetReturnValueString();
333 }
334 
335 string NWNX_Util_GetEnvironmentVariable(string sVarname)
336 {
337  string sFunc = "GetEnvironmentVariable";
338  NWNX_PushArgumentString(sVarname);
339  NWNX_CallFunction(NWNX_Util, sFunc);
340  return NWNX_GetReturnValueString();
341 }
342 
344 {
345  string sFunc = "GetMinutesPerHour";
346  NWNX_CallFunction(NWNX_Util, sFunc);
347  return NWNX_GetReturnValueInt();
348 }
349 
351 {
352  string sFunc = "SetMinutesPerHour";
353  NWNX_PushArgumentInt(minutes);
354  NWNX_CallFunction(NWNX_Util, sFunc);
355 }
356 
357 string NWNX_Util_EncodeStringForURL(string sURL)
358 {
359  string sFunc = "EncodeStringForURL";
360 
362  NWNX_CallFunction(NWNX_Util, sFunc);
363 
364  return NWNX_GetReturnValueString();
365 }
366 
367 string NWNX_Util_GetFirstResRef(int nType, string sRegexFilter = "", int bModuleResourcesOnly = TRUE)
368 {
369  string sFunc = "GetFirstResRef";
370 
371  NWNX_PushArgumentInt(bModuleResourcesOnly);
372  NWNX_PushArgumentString(sRegexFilter);
373  NWNX_PushArgumentInt(nType);
374  NWNX_CallFunction(NWNX_Util, sFunc);
375 
376  return NWNX_GetReturnValueString();
377 }
378 
380 {
381  string sFunc = "GetNextResRef";
382 
383  NWNX_CallFunction(NWNX_Util, sFunc);
384 
385  return NWNX_GetReturnValueString();
386 }
387 
388 object NWNX_Util_GetLastCreatedObject(int nObjectType, int nNthLast = 1)
389 {
390  string sFunc = "GetLastCreatedObject";
391 
392  NWNX_PushArgumentInt(nNthLast);
393  NWNX_PushArgumentInt(nObjectType);
394  NWNX_CallFunction(NWNX_Util, sFunc);
395 
396  return NWNX_GetReturnValueObject();
397 }
398 
399 string NWNX_Util_AddScript(string sFileName, string sScriptData, int bWrapIntoMain = FALSE, string sAlias = "NWNX")
400 {
401  string sFunc = "AddScript";
402 
403  NWNX_PushArgumentString(sAlias);
404  NWNX_PushArgumentInt(bWrapIntoMain);
405  NWNX_PushArgumentString(sScriptData);
406  NWNX_PushArgumentString(sFileName);
407  NWNX_CallFunction(NWNX_Util, sFunc);
408 
409  return NWNX_GetReturnValueString();
410 }
411 
412 int NWNX_Util_AddNSSFile(string sFileName, string sContents, string sAlias = "NWNX")
413 {
414  string sFunc = "AddNSSFile";
415 
416  NWNX_PushArgumentString(sAlias);
417  NWNX_PushArgumentString(sContents);
418  NWNX_PushArgumentString(sFileName);
419  NWNX_CallFunction(NWNX_Util, sFunc);
420 
421  return NWNX_GetReturnValueInt();
422 }
423 
424 int NWNX_Util_RemoveNWNXResourceFile(string sFileName, int nType, string sAlias = "NWNX")
425 {
426  string sFunc = "RemoveNWNXResourceFile";
427 
428  NWNX_PushArgumentString(sAlias);
429  NWNX_PushArgumentInt(nType);
430  NWNX_PushArgumentString(sFileName);
431  NWNX_CallFunction(NWNX_Util, sFunc);
432 
433  return NWNX_GetReturnValueInt();
434 }
435 
436 void NWNX_Util_SetInstructionLimit(int nInstructionLimit)
437 {
438  string sFunc = "SetInstructionLimit";
439 
440  NWNX_PushArgumentInt(nInstructionLimit);
441  NWNX_CallFunction(NWNX_Util, sFunc);
442 }
443 
445 {
446  string sFunc = "GetInstructionLimit";
447 
448  NWNX_CallFunction(NWNX_Util, sFunc);
449 
450  return NWNX_GetReturnValueInt();
451 }
452 
453 void NWNX_Util_SetInstructionsExecuted(int nInstructions)
454 {
455  string sFunc = "SetInstructionsExecuted";
456 
457  NWNX_PushArgumentInt(nInstructions);
458  NWNX_CallFunction(NWNX_Util, sFunc);
459 }
460 
462 {
463  string sFunc = "GetInstructionsExecuted";
464 
465  NWNX_CallFunction(NWNX_Util, sFunc);
466 
467  return NWNX_GetReturnValueInt();
468 }
469 
470 int NWNX_Util_RegisterServerConsoleCommand(string sCommand, string sScriptChunk)
471 {
472  string sFunc = "RegisterServerConsoleCommand";
473 
474  NWNX_PushArgumentString(sScriptChunk);
475  NWNX_PushArgumentString(sCommand);
476  NWNX_CallFunction(NWNX_Util, sFunc);
477 
478  return NWNX_GetReturnValueInt();
479 }
480 
482 {
483  string sFunc = "UnregisterServerConsoleCommand";
484 
485  NWNX_PushArgumentString(sCommand);
486  NWNX_CallFunction(NWNX_Util, sFunc);
487 }
488 
489 int NWNX_Util_PluginExists(string sPlugin)
490 {
491  WriteTimestampedLogEntry("WARNING: NWNX_Util_PluginExists is deprecated. You should migrate to NWNX_PluginExists.");
492  return NWNX_PluginExists(sPlugin);
493 }
494 
496 {
497  string sFunc = "GetUserDirectory";
498  NWNX_CallFunction(NWNX_Util, sFunc);
499  return NWNX_GetReturnValueString();
500 }
501 
503 {
504  string sFunc = "GetScriptReturnValue";
505 
506  NWNX_CallFunction(NWNX_Util, sFunc);
507 
508  return NWNX_GetReturnValueInt();
509 }
510 
511 object NWNX_Util_CreateDoor(string sResRef, location locLocation, string sNewTag = "", int nAppearanceType = -1)
512 {
513  string sFunc = "CreateDoor";
514 
515  vector vPosition = GetPositionFromLocation(locLocation);
516 
517  NWNX_PushArgumentInt(nAppearanceType);
518  NWNX_PushArgumentString(sNewTag);
519  NWNX_PushArgumentFloat(GetFacingFromLocation(locLocation));
520  NWNX_PushArgumentFloat(vPosition.z);
521  NWNX_PushArgumentFloat(vPosition.y);
522  NWNX_PushArgumentFloat(vPosition.x);
523  NWNX_PushArgumentObject(GetAreaFromLocation(locLocation));
524  NWNX_PushArgumentString(sResRef);
525  NWNX_CallFunction(NWNX_Util, sFunc);
526 
527  return NWNX_GetReturnValueObject();
528 }
529 
530 void NWNX_Util_SetItemActivator(object oObject)
531 {
532  string sFunc = "SetItemActivator";
533 
534  NWNX_PushArgumentObject(oObject);
535  NWNX_CallFunction(NWNX_Util, sFunc);
536 }
537 
538 struct NWNX_Util_WorldTime NWNX_Util_GetWorldTime(float fAdjustment = 0.0f)
539 {
540  string sFunc = "GetWorldTime";
541 
542  NWNX_PushArgumentFloat(fAdjustment);
543  NWNX_CallFunction(NWNX_Util, sFunc);
544 
545  struct NWNX_Util_WorldTime strWorldTime;
546  strWorldTime.nTimeOfDay = NWNX_GetReturnValueInt();
547  strWorldTime.nCalendarDay = NWNX_GetReturnValueInt();
548 
549  return strWorldTime;
550 }
551 
552 void NWNX_Util_SetResourceOverride(int nResType, string sOldName, string sNewName)
553 {
554  string sFunc = "SetResourceOverride";
555 
556  NWNX_PushArgumentString(sNewName);
557  NWNX_PushArgumentString(sOldName);
558  NWNX_PushArgumentInt(nResType);
559  NWNX_CallFunction(NWNX_Util, sFunc);
560 }
561 
562 string NWNX_Util_GetResourceOverride(int nResType, string sName)
563 {
564  string sFunc = "GetResourceOverride";
565 
567  NWNX_PushArgumentInt(nResType);
568  NWNX_CallFunction(NWNX_Util, sFunc);
569 
570  return NWNX_GetReturnValueString();
571 }
572 
573 int NWNX_Util_GetScriptParamIsSet(string sParamName)
574 {
575  string sFunc = "GetScriptParamIsSet";
576 
577  NWNX_PushArgumentString(sParamName);
578  NWNX_CallFunction(NWNX_Util, sFunc);
579 
580  return NWNX_GetReturnValueInt();
581 }
582 
583 void NWNX_Util_SetDawnHour(int nDawnHour)
584 {
585  string sFunc = "SetDawnHour";
586 
587  NWNX_PushArgumentInt(nDawnHour);
588  NWNX_CallFunction(NWNX_Util, sFunc);
589 }
590 
591 void NWNX_Util_SetDuskHour(int nDuskHour)
592 {
593  string sFunc = "SetDuskHour";
594 
595  NWNX_PushArgumentInt(nDuskHour);
596  NWNX_CallFunction(NWNX_Util, sFunc);
597 }
598 
600 {
602  string sFunc = "GetHighResTimeStamp";
603 
604  NWNX_CallFunction(NWNX_Util, sFunc);
607  return t;
608 }
609 
611 {
612  string sFunc = "GetTTY";
613 
614  NWNX_CallFunction(NWNX_Util, sFunc);
615  return NWNX_GetReturnValueString();
616 }
617 
619 {
620  string sFunc = "SetCurrentlyRunningEvent";
621 
622  NWNX_PushArgumentInt(nEventID);
623  NWNX_CallFunction(NWNX_Util, sFunc);
624 }
625 
626 int NWNX_Util_GetStringLevenshteinDistance(string sString, string sCompareTo)
627 {
628  string sFunc = "LevenshteinDistance";
629 
630  NWNX_PushArgumentString(sCompareTo);
631  NWNX_PushArgumentString(sString);
632  NWNX_CallFunction(NWNX_Util, sFunc);
633  return NWNX_GetReturnValueInt();
634 }
635 
636 void NWNX_Util_UpdateClientObject(object oObjectToUpdate, object oPlayer = OBJECT_INVALID)
637 {
638  string sFunc = "UpdateClientObject";
639 
640  NWNX_PushArgumentObject(oPlayer);
641  NWNX_PushArgumentObject(oObjectToUpdate);
642  NWNX_CallFunction(NWNX_Util, sFunc);
643 }
644 
645 int NWNX_Util_CleanResourceDirectory(string sAlias, int nResType = 0xFFFF)
646 {
647  string sFunc = "CleanResourceDirectory";
648  NWNX_PushArgumentInt(nResType);
649  NWNX_PushArgumentString(sAlias);
650  NWNX_CallFunction(NWNX_Util, sFunc);
651  return NWNX_GetReturnValueInt();
652 }
653 
655 {
656  string sFunc = "GetModuleTlkFile";
657  NWNX_CallFunction(NWNX_Util, sFunc);
658  return NWNX_GetReturnValueString();
659 }
NWNX_Util_GetTTY
string NWNX_Util_GetTTY()
Definition: nwnx_util.nss:610
NWNX_Util_StripColors
string NWNX_Util_StripColors(string str)
Strip any color codes from a string.
Definition: nwnx_util.nss:327
NWNX_Util_EffectToItemProperty
itemproperty NWNX_Util_EffectToItemProperty(effect e)
Convert an effect type to an itemproperty type.
Definition: nwnx_util.nss:311
NWNX_GetReturnValueInt
int NWNX_GetReturnValueInt()
Returns the specified type from the c++ side.
Definition: nwnx.nss:94
NWNX_Util_GetModuleMtime
int NWNX_Util_GetModuleMtime()
Gets the last modified timestamp (mtime) of the module file in seconds.
Definition: nwnx_util.nss:291
NWNX_GetReturnValueEffect
effect NWNX_GetReturnValueEffect()
Returns the specified type from the c++ side.
Definition: nwnx.nss:114
NWNX_Util_UnregisterServerConsoleCommand
void NWNX_Util_UnregisterServerConsoleCommand(string sCommand)
Unregister a server console command that was registered with NWNX_Util_RegisterServerConsoleCommand()...
Definition: nwnx_util.nss:481
NWNX_Util_GetCustomToken
string NWNX_Util_GetCustomToken(int customTokenNumber)
Gets the value of customTokenNumber.
Definition: nwnx_util.nss:303
NWNX_Util_AddScript
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.
Definition: nwnx_util.nss:399
NWNX_UTIL_RESREF_TYPE_AREA_GIT
const int NWNX_UTIL_RESREF_TYPE_AREA_GIT
Definition: nwnx_util.nss:18
NWNX_Util_GetStringLevenshteinDistance
int NWNX_Util_GetStringLevenshteinDistance(string sString, string sCompareTo)
Calculate the levenshtein distance of two strings.
Definition: nwnx_util.nss:626
NWNX_Util_HighResTimestamp::seconds
int seconds
Seconds since epoch.
Definition: nwnx_util.nss:41
NWNX_Util_GetModuleTlkFile
string NWNX_Util_GetModuleTlkFile()
Return the filename of the tlk file.
Definition: nwnx_util.nss:654
NWNX_Util_RegisterServerConsoleCommand
int NWNX_Util_RegisterServerConsoleCommand(string sCommand, string sScriptChunk)
Register a server console command that will execute a script chunk.
Definition: nwnx_util.nss:470
NWNX_Util_GetInstructionLimit
int NWNX_Util_GetInstructionLimit()
Get the NWScript instruction limit.
Definition: nwnx_util.nss:444
NWNX_Util_GetWorldTime
struct NWNX_Util_WorldTime NWNX_Util_GetWorldTime(float fAdjustment=0.0f)
Get the world time as calendar day and time of day.
Definition: nwnx_util.nss:538
NWNX_Util_HighResTimestamp
A high resolution timestamp.
Definition: nwnx_util.nss:39
NWNX_Util_WorldTime::nCalendarDay
int nCalendarDay
The calendar day.
Definition: nwnx_util.nss:34
NWNX_GetReturnValueItemProperty
itemproperty NWNX_GetReturnValueItemProperty()
Returns the specified type from the c++ side.
Definition: nwnx.nss:120
NWNX_UTIL_RESREF_TYPE_TRIGGER
const int NWNX_UTIL_RESREF_TYPE_TRIGGER
Definition: nwnx_util.nss:22
NWNX_Util_HighResTimestamp::microseconds
int microseconds
Microseconds.
Definition: nwnx_util.nss:42
NWNX_Util_RemoveNWNXResourceFile
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.
Definition: nwnx_util.nss:424
NWNX_UTIL_RESREF_TYPE_NSS
const int NWNX_UTIL_RESREF_TYPE_NSS
Definition: nwnx_util.nss:14
NWNX_UTIL_RESREF_TYPE_ENCOUNTER
const int NWNX_UTIL_RESREF_TYPE_ENCOUNTER
Definition: nwnx_util.nss:24
NWNX_Util_SetResourceOverride
void NWNX_Util_SetResourceOverride(int nResType, string sOldName, string sNewName)
Set a server-side resource override.
Definition: nwnx_util.nss:552
NWNX_CallFunction
void NWNX_CallFunction(string pluginName, string functionName)
Scripting interface to NWNX.
Definition: nwnx.nss:54
NWNX_Util_GetInstructionsExecuted
int NWNX_Util_GetInstructionsExecuted()
Get the number of NWScript instructions currently executed.
Definition: nwnx_util.nss:461
NWNX_Util_CreateDoor
object NWNX_Util_CreateDoor(string sResRef, location locLocation, string sNewTag="", int nAppearanceType=-1)
Create a door.
Definition: nwnx_util.nss:511
NWNX_Util_SetItemActivator
void NWNX_Util_SetItemActivator(object oObject)
Set the object that will be returned by GetItemActivator.
Definition: nwnx_util.nss:530
NWNX_Util_GetFirstResRef
string NWNX_Util_GetFirstResRef(int nType, string sRegexFilter="", int bModuleResourcesOnly=TRUE)
Get the first resref of nType.
Definition: nwnx_util.nss:367
NWNX_GetReturnValueString
string NWNX_GetReturnValueString()
Returns the specified type from the c++ side.
Definition: nwnx.nss:109
NWNX_PushArgumentString
void NWNX_PushArgumentString(string value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:74
NWNX_UTIL_RESREF_TYPE_SOUND
const int NWNX_UTIL_RESREF_TYPE_SOUND
Definition: nwnx_util.nss:23
NWNX_Util_GetScriptParamIsSet
int NWNX_Util_GetScriptParamIsSet(string sParamName)
Get if a script param is set.
Definition: nwnx_util.nss:573
NWNX_Util_EncodeStringForURL
string NWNX_Util_EncodeStringForURL(string str)
Encodes a string for usage in a URL.
Definition: nwnx_util.nss:357
NWNX_PushArgumentObject
void NWNX_PushArgumentObject(object value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:69
NWNX_PushArgumentInt
void NWNX_PushArgumentInt(int value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:59
NWNX_Util_CleanResourceDirectory
int NWNX_Util_CleanResourceDirectory(string sAlias, int nResType=0xFFFF)
Clean a resource directory, deleting all files of nResType.
Definition: nwnx_util.nss:645
NWNX_Util_GetScriptReturnValue
int NWNX_Util_GetScriptReturnValue()
Get the return value of the last run script with a StartingConditional.
Definition: nwnx_util.nss:502
NWNX_UTIL_RESREF_TYPE_NCS
const int NWNX_UTIL_RESREF_TYPE_NCS
Definition: nwnx_util.nss:15
NWNX_Util_SetDawnHour
void NWNX_Util_SetDawnHour(int nDawnHour)
Set the module dawn hour.
Definition: nwnx_util.nss:583
NWNX_Util_PluginExists
int NWNX_Util_PluginExists(string sPlugin)
Determines if the given plugin exists and is enabled.
Definition: nwnx_util.nss:489
NWNX_PushArgumentEffect
void NWNX_PushArgumentEffect(effect value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:79
NWNX_UTIL_RESREF_TYPE_PLACEABLE
const int NWNX_UTIL_RESREF_TYPE_PLACEABLE
Definition: nwnx_util.nss:26
NWNX_Util_GetModuleFile
string NWNX_Util_GetModuleFile()
Gets the module short file name.
Definition: nwnx_util.nss:297
NWNX_Util_GetAsciiTableString
string NWNX_Util_GetAsciiTableString()
Gets a string that contains the ascii table.
Definition: nwnx_util.nss:276
NWNX_Util_SetCurrentlyRunningEvent
void NWNX_Util_SetCurrentlyRunningEvent(int nEventID)
Set the currently running script event.
Definition: nwnx_util.nss:618
NWNX_Util_UpdateClientObject
void NWNX_Util_UpdateClientObject(object oObjectToUpdate, object oPlayer=OBJECT_INVALID)
Sends a full object update of oObjectToUpdate to all clients.
Definition: nwnx_util.nss:636
NWNX_UTIL_RESREF_TYPE_WAYPOINT
const int NWNX_UTIL_RESREF_TYPE_WAYPOINT
Definition: nwnx_util.nss:28
NWNX_Util_GetNextResRef
string NWNX_Util_GetNextResRef()
Get the next resref.
Definition: nwnx_util.nss:379
NWNX_Util_GetEnvironmentVariable
string NWNX_Util_GetEnvironmentVariable(string sVarname)
Retrieves an environment variable.
Definition: nwnx_util.nss:335
NWNX_UTIL_RESREF_TYPE_TWODA
const int NWNX_UTIL_RESREF_TYPE_TWODA
Definition: nwnx_util.nss:17
NWNX_Util_WorldTime
A world time struct.
Definition: nwnx_util.nss:32
NWNX_Util_SetInstructionsExecuted
void NWNX_Util_SetInstructionsExecuted(int nInstructions)
Set the number of NWScript instructions currently executed.
Definition: nwnx_util.nss:453
NWNX_Util_SetInstructionLimit
void NWNX_Util_SetInstructionLimit(int nInstructionLimit)
Set the NWScript instruction limit.
Definition: nwnx_util.nss:436
NWNX_Util_SetDuskHour
void NWNX_Util_SetDuskHour(int nDuskHour)
Set the module dusk hour.
Definition: nwnx_util.nss:591
NWNX_Util_WorldTime::nTimeOfDay
int nTimeOfDay
The time of day.
Definition: nwnx_util.nss:35
NWNX_Util_GetLastCreatedObject
object NWNX_Util_GetLastCreatedObject(int nObjectType, int nNthLast=1)
Get the last created object.
Definition: nwnx_util.nss:388
NWNX_GetReturnValueObject
object NWNX_GetReturnValueObject()
Returns the specified type from the c++ side.
Definition: nwnx.nss:104
NWNX_Util_GetMinutesPerHour
int NWNX_Util_GetMinutesPerHour()
Gets the module real life minutes per in game hour.
Definition: nwnx_util.nss:343
NWNX_UTIL_RESREF_TYPE_STORE
const int NWNX_UTIL_RESREF_TYPE_STORE
Definition: nwnx_util.nss:27
NWNX_Util_GetResourceOverride
string NWNX_Util_GetResourceOverride(int nResType, string sName)
Get a server-side resource override.
Definition: nwnx_util.nss:562
NWNX_Util_GetHighResTimeStamp
struct NWNX_Util_HighResTimestamp NWNX_Util_GetHighResTimeStamp()
Definition: nwnx_util.nss:599
NWNX_Util_SetMinutesPerHour
void NWNX_Util_SetMinutesPerHour(int minutes)
Set module real life minutes per in game hour.
Definition: nwnx_util.nss:350
NWNX_UTIL_RESREF_TYPE_DOOR
const int NWNX_UTIL_RESREF_TYPE_DOOR
Definition: nwnx_util.nss:25
NWNX_UTIL_RESREF_TYPE_ITEM
const int NWNX_UTIL_RESREF_TYPE_ITEM
Definition: nwnx_util.nss:19
NWNX_UTIL_RESREF_TYPE_CREATURE
const int NWNX_UTIL_RESREF_TYPE_CREATURE
Definition: nwnx_util.nss:20
NWNX_PluginExists
int NWNX_PluginExists(string sPlugin)
Determines if the given plugin exists and is enabled.
Definition: nwnx.nss:131
NWNX_PushArgumentFloat
void NWNX_PushArgumentFloat(float value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:64
NWNX_Util_ItemPropertyToEffect
effect NWNX_Util_ItemPropertyToEffect(itemproperty ip)
Convert an itemproperty type to an effect type.
Definition: nwnx_util.nss:319
NWNX_PushArgumentItemProperty
void NWNX_PushArgumentItemProperty(itemproperty value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:84
NWNX_UTIL_RESREF_TYPE_DIALOG
const int NWNX_UTIL_RESREF_TYPE_DIALOG
Definition: nwnx_util.nss:21
NWNX_Util_GetUserDirectory
string NWNX_Util_GetUserDirectory()
Gets the server's current working user folder.
Definition: nwnx_util.nss:495
NWNX_Util_AddNSSFile
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.
Definition: nwnx_util.nss:412
NWNX_Util_GetCurrentScriptName
string NWNX_Util_GetCurrentScriptName(int depth=0)
Gets the name of the currently executing script.
Definition: nwnx_util.nss:268
NWNX_UTIL_RESREF_TYPE_AREA_ARE
const int NWNX_UTIL_RESREF_TYPE_AREA_ARE
Definition: nwnx_util.nss:16
NWNX_Util_Hash
int NWNX_Util_Hash(string str)
Gets an integer hash of a string.
Definition: nwnx_util.nss:283