Table of Contents

Method IsValidScriptName

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

IsValidScriptName(string?, bool)

Validates a script name against engine constraints.

public static bool IsValidScriptName(this string? scriptName, bool allowEmpty)

Parameters

scriptName string

The script name to validate.

allowEmpty bool

If true, an empty or null name is allowed.

Returns

bool

True if the name is valid, otherwise false.

Remarks

The following constraints apply to script names:

  • Script must be <=16 characters.
  • Scripts must only use alphanumeric characters (Aa-Zz, 0-9), underscores (_), or hyphens (-).
  • Scripts must not use reserved names: GameEventScriptName or NWNXEventScriptName.