DeleteLocalString
From NWN Lexicon
Jump to navigationJump to search
DeleteLocalString(object, string)
Deletes oObject's string variable sVarName.
Parameters
oObject
The object storing the variable.
sVarName
Variable name to delete.
Description
Use this function to delete an object's entry for the string defined by sVarName. If sVarName doesn't exist, nothing will happen.
Remarks
As with all deletions, once removed, GetLocalString returns "", a blank string. Cleaning up old variables can help CPU performance if many are stored on one object (especially if the module has many unused values on it) and good for deleting the new persistent variables which can be put on a PC's inventory item, which will hinder performance if there are many unused values.
Version
1.22
Example
// We delete the string stored on the PC under "PASSWORD" when they go into
// this trigger.
void main()
{
// Declare the PC object
object oPC = GetEnteringObject();
// Delete the local string
DeleteLocalString(oPC, "PASSWORD");
}
// this trigger.
void main()
{
// Declare the PC object
object oPC = GetEnteringObject();
// Delete the local string
DeleteLocalString(oPC, "PASSWORD");
}
See Also
author: Michael Nork, editor: Jasperre, additional contributor(s): Jasperre