RunBatchScript

From GECK
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Executes the script source in the specified file.

  • The source file path should be relative to the game's root folder (..\Fallout New Vegas\).
  • The script is executed immediately; The calling script will be halted until the invoked script is processed.
  • The script source should follow the same structure rules as Result Scripts (of quest stages, dialogue topics, etc.), and may include local variables and if/else statements.
  • When using forms/references in the script source, the Form ID must be specified (not the Editor ID), enclosed in double quotation marks. Example:
ref rItem
set rItem to "00020420"          ; ArmorCombat

AddItem "00E3778" 1 1            ; WeapNV9mmPistol

if "0010D8DF".GetPlayerTeammate  ; RexREF
endif
  • If the function is called on a reference (implicitly/explicitly), the script will be called on that same reference (passed as "this" and returned by GetSelf). Otherwise, it will be called on the player (see examples, below).
  • If the source file was successfuly opened and read, and the script was compiled and executed with no errors, the function returns 1.

Syntax

[help]
(success:0/1) reference.RunBatchScript filePath:string

Example

RunBatchScript "my_script_source.txt"
CraigBooneRef.RunBatchScript "my_script_source.txt" 

See Also