{i} ActivateCharacter ({c} CharacterToActivate)
Description:
In order to achieve better performance, characters can be deactivated and activated (for instance when the player is a long way away). In the deactivated state, no processing occurs on the character and its model is released from control, and can thus be unloaded (see UnloadModel). Activate should be called after Deactivating a character to reload the model back into memory and to resume the characters processing. Note that only one AI character can be active and thus control any model at any one time.
ParameterDescription
CharacterToActivate: The character to be activated. Note that GetCharacterByName still works even when characters are deactivated.
Return:

{c} AddCharacter ({s} AI Name, {s} ModelName, {s} StartupScriptName)
Description:
This command adds new AI characters to the level. Note that a model to be used must be created before calling AddCharacter (see the command CreateModel). AddCharacter takes 2 parameters, the name of the model to be used, and a startup script filename for the new character. All characters run a startup script when they are created, to allow them to setup their names, health etc, set event responses and teleport them to their initial positions. Note that the startup script will not be run until the character is activated.
ParameterDescription
AI Name: The name to be given to the character. (note that this just does a SetStatusString for you on the name)
ModelName: The identifier of the model to use (see CreateModel)..
StartupScriptName: The filename of the startup script to be run by the new character.
Return:
Returns a pointer to the character created.

{v} AddItemToDropList ({c} Character, {s} ItemName, {i} HowMany)
Description:
When characters die they can be set to drop items in a DOB pickup. This command allows the script writer to add items to the list of items to be dropped. The items are identified by a string (which corresponds to the driver item names, listed in itemtable.dcf), and how many of the items of that type should be dropped. See also SetDropListRemovalTime.
ParameterDescription
Character: The character to add an item to his droplist.
ItemName: The type of item to be dropped (see itemtable.dcf).
HowMany: The number of this type of item to be dropped.
Return:

{v} AddSoundTypeToSoundGroup ({s} TypeName, {s} GroupName)
Description:
All sounds to be sent to the AI listener played by the game code (as opposed to played directly from script) are played as a sound 'type' rather than a sound 'group'. Although script writers can set the range and priority of sound groups, and tell characters to listen to particular sound groups, no equivalent functions exist for sound types. Instead script writers should assign each sound type to be a particular group, for instance in their initialization in PlayerConstructor.hfs. This command allows assigning sound types to the groups. Note that the names of the sound types in use by the game code can be found by looking in the Data/AI/AI_SoundTypes.txt file.

ParameterDescription
TypeName: The sound type to assign to a group.
GroupName: The group to assign the sound type to.
Return:

{i} AddToWatchList ({c} Watcher, {c} Watchee)
Description:
Although the AI constantly checks whether each character can see the player, in order to create the PlayerEnteredView event where necessary, the AI does not by default perform in view checks between NPCs. However, each character has a customizable watch list of characters that they are interested in, aside from the player. When a character on the watch list enters view, an AI event is generated, with the name of the character immediately followed by the string 'EnteredView'.

e.g.

BrianEnteredView

ParameterDescription
Watcher: The character to do the watching.
Watchee: The character to be watched for.
Return:

{i} AddWeapon ({c} Character, {s} WeaponName, {i} StartingAmmo)
Description:
Adds a weapon to the characters inventory. Weapons must be added before they can be used. The weapon names are as follows :

HandAxe

HandCrowBar

HandGunColtRevolver

HandHybrid

HandDeepOneClaw

HandKnife

HandLeadPipe

HandNightStick

ShotgunDoubleBarrelled

ShotgunSawnOff

Note that some weapons can be used in either ranged or melee mode, such as shotguns. The choice of which mode to use is made automatically, and is dependent on the amount of ammo in the weapon and the range to the target.

ParameterDescription
Character: The character to add the weapon to.
WeaponName: See above for list.
StartingAmmo: The amount of ammo in the weapon.
Return:

{i} AlreadyRunning ({s} ScriptName)
Description:
Finds the number of instances of the script named that are currently running on the calling character.
ParameterDescription
ScriptName: The name of the script to count the instances of.
Return:
Returns the number of these scripts that are running.

{i} Attack ({c} Target, {f} Priority)
Description:
Creates a hard coded attack script. The hard coded script, when active forces the character state machine into attack mode. It is important to note that the attack script has a priority and will be overrided if other scripts exist at a higher priority. When first called, if the target is not in the attackers view memory, the attacker will instantly know where the target is and run straight to that location, before launching into normal attack mode. If the attacker loses track of the target, he will automatically enter search mode until he finds the target again.
ParameterDescription
Target: The character to attack.
Priority: The hard coded attack script priority.
Return:

{i} BeginSafeBlock ()
Description:
A safe block is a section of code that can be guaranteed to run as a contiguous block of code on one frame. This allows a scripter to guarantee that a pointer to a character or any other object will still be valid later on in a block, with no chance of an external thread having deleted the character through the runtime of the block. Safe blocks are delimited by the BeginSafeBlock and EndSafeBlock functions.

Note that any time-consuming commands (ones which either suspend the virtual machine or are marked as time-consuming) will automatically end the safe block, regardless of the positioning of the EndSafeBlock function. The reason for this is simple - if for example a Wait command is issued within a safe block, the game cannot pause and stop rendering until the safe block is finished. Instead it automatically ends the safe block. In these cases (which are often scripting bugs) an OutputDebugString will be issued with details of the possible bug, but the game will continue running. Note that in certain cases it will be the intention of the scripter to end a safe block with a time-consuming command, such as MoveToPosition.

ParameterDescription
Return:

{v} CharacterCreateListenerSound ({c} Character, {s} SoundGroupName)
Description:
CharacterCreateListenerSound allows script writers to create their own sounds treated as coming from an AI character (including the player) which will be listened to by the other AI characters. See also CreateListenerSound for another method.
ParameterDescription
Character: The character creating the sound.
SoundGroupName: The group of sound to create (see AddSoundTypeToSoundGroup).
Return:

{v} CharacterCreateListenerSoundEx ({c} Character, {s} SoundGroupName, {i} TeamID)
Description:
CharacterCreateListenerSoundEx allows script writers to create their own sounds treated as coming from an AI character (including the player) which will be listened to by the other AI characters. This extended version of CharacterCreateListenerSound allows the user to specify the team ID origin of the sound. See also CreateListenerSound for another method.
ParameterDescription
Character: The character creating the sound.
SoundGroupName: The group of sound to create (see AddSoundTypeToSoundGroup).
TeamID: The team ID origin of the sound (see ListenToTeam for a list of the teams).
Return:

{s} ChooseDeathAnimation ({c} Character)
Description:
Uses in built code to randomly choose an appropriate death animation for a character, taking into account whether forward, left right and backward walls would potentially clash with an animation.
ParameterDescription
Character: The character to choose a death animation for.
Return:
Returns a string of the chosen animation name.

{i} ClearAllWatchLists ()
Description:
Clears the watch lists of every character in the level (both active and deactive characters). Note however that all characters will always look out for the player (and generate the PlayerEnteredView event), irrespective of the contents of their watchlists. See AddToWatchList for more info.
ParameterDescription
Return:

{i} ClearExcludeZones ({c} Character)
Description:
Clears the exclusion zones list of the character specified. See ExcludeZone for more information.
ParameterDescription
Character: The character to clear the exclusion zones on.
Return:

{v} ClearViewMemory ({c} Looker, {c} Target)
Description:
The InView system of each character maintains two pieces of information about each other character running. It stores whether a character is currently in view, and whether it is in view memory. ClearViewMemory allows the script writer to force a character to forget that he has seen another character, clearing both the InView flag and the InViewMemory flag. This means that immediately following this script command, an EnteredView event will be issued when the character becomes visible. Note that an EnteredView event will only occur if the character entering view is not in view memory, and this command provides a means to bypass this limitation.
ParameterDescription
Looker: The character doing the looking.
Target: The character to be seen.
Return:

{i} ClearWatchList ({c} Watcher)
Description:
Removes all characters from a characters watch list. Note however that all characters will always look out for the player (and generate the PlayerEnteredView event), irrespective of the contents of the watchlist. See AddToWatchList for more info.
ParameterDescription
Watcher: The character to clear the watch list on.
Return:

{i} ClearZones ({c} Character)
Description:
Clears the travellable zones list of the character specified. See SetZone for more information. Note that when no travellable zones are selected, the character defaults to being able to travel to all zones (that are not on the exclude list).
ParameterDescription
Character: The character to clear the travellable zones on.
Return:

{i} ConvertFloatToInt ({f} Float)
Description:
Converts a floating point number or variable to an integer. Does mathematical rounding. i.e. 0.49 rounds to 0, 0.5 rounds to 1.

-0.5 rounds to -1, -0.49 rounds to 0.

ParameterDescription
Float: The floating point number to convert.
Return:
Returns the integer.

{f} ConvertIntToFloat ({i} Integer)
Description:
Converts an integer to a floating point number.
ParameterDescription
Integer: The integer to convert.
Return:
Returns the floating point number.

{i} CreateDriverEvent ({s} EventName)
Description:
CreateDriverEvent creates events which the driver has the opportunity to respond to. As with AI events, driver events are identified by a name.
ParameterDescription
EventName: Name of the driver event.
Return:

{i} CreateGlancePoint ({s} GlancePointName, {p} Position, {f} Range, {f} Attractiveness)
Description:
Creates a glance point. Glance points are used preferentially as glance locations by characters that are searching, or have their AutoGlance mode switched on (see SetAutoGlance script command). The range determines the maximum range at which the glance point will be considered, and the attractiveness (0.0 to 1.0) determines how likely the character is to look at this point.
ParameterDescription
GlancePointName: The name to be given to the glance point.
Position: The position of the glance point.
Range: The range within which characters will consider the point, in cm.
Attractiveness: How likely characters will be to glance at the point, scaled from 0.0 to 1.0.
Return:

{v} CreateListenerSound ({s} SoundGroupName, {p} Location)
Description:
CreateListenerSound allows script writers to create their own sounds which will be listened to by the AI characters. See also CharacterCreateListenerSound for another method.
ParameterDescription
SoundGroupName: The group of sound to create (see AddSoundTypeToSoundGroup).
Location: The location of the sound to be created.
Return:

{v} CreateListenerSoundEx ({s} SoundGroupName, {p} Location, {i} TeamID)
Description:
CreateListenerSoundEx allows script writers to create their own sounds which will be listened to by the AI characters. This is an extended version of the CreateListenerSound command which allows the script writer to specify the team origin of the sound. See ListenToTeam for a description of the team IDs. See also CharacterCreateListenerSound for another method.
ParameterDescription
SoundGroupName: The group of sound to create (see AddSoundTypeToSoundGroup).
Location: The location of the sound to be created.
TeamID: The ID of the team that created the sound.
Return:

{p} D_ActivateDynamicFog ({i} Activate)
Description:
Activates or de-activates the dynamic fog that follows paths around the level
ParameterDescription
Activate: 1 = Activate the fog, 0 = De-activate it
Return:

{i} D_AddArmAnimation ({s} AnimationName, {s} AnimationFilename)
Description:
Adds the named KF animation to the list of extended animations for the player arms and loads the file. This allows the animation to be played by calling D_PlayArmAnimation() and passing the AnimationName
ParameterDescription
AnimationName: Name used to refer to the animation when playing
AnimationFilename: Filename of the KF file to load
Return:

{i} D_AddCameraAnimation ({s} AnimationName, {s} AnimationFilename)
Description:
Adds the named KF animation to the list of extended animations and loads the file. This allows the animation to be played by calling D_PlayCameraAnimation() and passing the AnimationName
ParameterDescription
AnimationName: Name used to refer to the animation when playing
AnimationFilename: Filename of the KF file to load
Return:

{i} D_AddEvent ({s} EventName, {s} ScriptName)
Description:
Adds an event which runs a script when triggered. Script events are global and not stored per virtual machine
ParameterDescription
EventName: Name of the event. When D_GenerateEvent is called with this name as a parameter the specified script will be run
ScriptName: Name of the gamescript to run when the event is generated. This uses the same format / paths as D_RunGameScript
Return:

{i} D_AddItemToBonusDob ({i} DOB ID, {i} Item ID, {i} Number to Add)
Description:
Adds an item to a given BonusItem Dob
ParameterDescription
DOB ID: ID of the BonusItem DOB to add the item to.
Item ID: ID of the inventory item to be added.
Number to Add: The number of items that will added.
Return:
No return value

{i} D_AddResumeEvent ({s} EventName)
Description:
Adds an event that is able to resume this script when D_WaitForResume has been called. These events can be raised by calling D_GenerateEvent (the same as script events). Resume events are specific to the virtual machine (and hence script) that it is called on, and hence will not allow other VMs to resume when the event is triggered
ParameterDescription
EventName: Name of the resume event add
Return:

{i} D_AddToInventory ({i} ItemName, {i} Quantity)
Description:
Adds a specified number of the specified item to the players inventory
ParameterDescription
ItemName: Name of the item(s) to add to the inventory
Quantity: Number of the specified items to add
Return:

{i} D_AddToJournal ({s} EntryID)
Description:
Adds the numbered entry to the journal. JML defines which entry corresponds to what text
ParameterDescription
EntryID: String representing the index number of the journal entry to be added. In form 3.1.2
Return:

{i} D_AnimatedModelPlay ({s} DobName)
Description:
Plays the animation associated with the named animated model DOB
ParameterDescription
DobName: Name of the animated model DOB to play the animation on
Return:

{i} D_AnimatedPhysicsEnableCollision ({s} DOBName, {i} Enable)
Description:
Enables / Disables collisions with the named animated physics DOBs physics geometry
ParameterDescription
DOBName: Name of the ANIMATEDPHYSICS DOB to modify
Enable: 1 = Enable, player will collide with physics rep of DOB, 0 = Disable, player will not collide with this DOBs physics rep
Return:
No return value

{i} D_AnimatedPhysicsEnableScript ({s} DOBName, {i} Enable)
Description:
Enables or disables the script to be executed when a collision is detected between the player and the ANIMATEDPHYSICS physics object. This flag is set to false each time the script is run to prevent multiple triggers as many collisions occur very rapidly
ParameterDescription
DOBName: The name of the ANIMATEDPHYSICS DOB
Enable: 1 = Script will be run on next collision, 0 = Script will not run on next collision
Return:
No return value

{i} D_AnimatedPhysicsPlay ({s} DOBName)
Description:
Plays the animation associated with the named ANIMATEDPHYSICS DOB
ParameterDescription
DOBName: Name of the ANIMATEDPHYSICS DOB to play
Return:
No return value

{i} D_AnimatedReachTargetMultiGetNextIndex ({s} DOBName)
Description:
Returns the index number of the animation state that will next play when the player actions the ANIMATEDREACHTARGETMULTI DOB
ParameterDescription
DOBName: Specifies which ANIMATEDREACHTARGETMULTI DOB to play
Return:
The next animation index that will play when actioned

{i} D_AnimatedReachTargetMultiPlayIndex ({s} DOBName, {i} Index, {i} RunActionScript, {i} PlaySound)
Description:
Tells the ANIMATEDREACHTARGETMULTI DOB to play the specified indexed animation without effecting the stored next state. You can specify whether the sound should be played and whether the action script should be run
ParameterDescription
DOBName: Specifies which ANIMATEDREACHTARGETMULTI DOB to play the specified index for
Index: Animation index, the first in the list is index 0
RunActionScript: 1 = run action script if one specified, 0 = do not run script
PlaySound: 1 = play sound if specified, 0 = do not play sound
Return:
No return value

{i} D_AnimatedReachTargetMultiSetNextIndex ({s} DOBName, {i} Index)
Description:
Tells the specified ANIMATEDREACHTARGETMULTI DOB to set its next animation state to be the one residing at the specified index. The first item in the list is index 0
ParameterDescription
DOBName: Specifies which ANIMATEDREACHTARGETMULTI DOB to play
Index: Animation index number, first in list is index 0
Return:
No return value

{i} D_AnimatedReachTargetMultiSimulateAction ({s} DOBName)
Description:
Performs exactly the same operation as the player walking up to the reach target and actioning it
ParameterDescription
DOBName: Specifies which ANIMATEDREACHTARGETMULTI DOB to simulate the player actioning
Return:
No return value

{i} D_AnimatedTextureEnable ({s} Dob name, {i} Enable)
Description:
Changes the settings on an animated texture.
ParameterDescription
Dob name: The name of the Animated Texture DOB
Enable: 0 = Disable, 1 = Enable
Return:
No return value

{i} D_AnimatedTextureSetFrame ({s} Dob name, {f} Time)
Description:
Freezes the animated texture at the given time.
ParameterDescription
Dob name: The name of the Animated Texture DOB
Time: Time in the animation that the animation will freeze at
Return:
No return value

{i} D_AnimatedTextureSetSpeed ({s} Dob name, {f} Secs Per Frame)
Description:
Sets the playback speed of the Animated Texture.
ParameterDescription
Dob name: The name of the Animated Texture DOB
Secs Per Frame: Sets the amount of time each image spends on the screen.
Return:
No return value

{i} D_AnimatedTextureSettings ({s} Dob name, {f} Start Time, {f} End Time, {s} Cycle Type)
Description:
Changes the settings on an animated texture.
ParameterDescription
Dob name: The name of the Animated Texture DOB
Start Time: The time that the anim starts at
End Time: Time that the anim ends at
Cycle Type: Should be one of the following values : CLAMP, LOOP, REVERSE
Return:
No return value

{i} D_AnimatedUVEnable ({s} Dob name, {i} Enable)
Description:
Turns the selected UV texture animation on or off.
ParameterDescription
Dob name: The name of the Animated UV DOB
Enable: 1 = Enabled, 0 = Disabled.
Return:
No return value

{i} D_AnimatedUVResetTime ({s} Dob name, {v} noname)
Description:
Resets the UV texture animation time index back to the start time specified.
ParameterDescription
Dob name: The name of the Animated UV DOB
:
Return:
No return value

{i} D_AnimatedUVSetEndTime ({s} Dob name, {f} End time)
Description:
Sets the end time for the selected UV texture animation.
ParameterDescription
Dob name: The name of the Animated UV DOB
End time: Time at which the animation will start, looping animations end at this time.
Return:
No return value

{i} D_AnimatedUVSetLooping ({s} Dob name, {i} Play type)
Description:
The UV texture animation can either be looping or play through once..
ParameterDescription
Dob name: The name of the Animated UV DOB
Play type: 0 = looping, 1 = Play through once.
Return:
No return value

{i} D_AnimatedUVSetStartTime ({s} Dob name, {f} Start time)
Description:
Sets the start time for the selected UV texture animation.
ParameterDescription
Dob name: The name of the Animated UV DOB
Start time: Time at which the animation will start, looping animations restart at this time.
Return:
No return value

{s} D_AppendToString ({s} OriginalString, {s} StringToAppend)
Description:
Appends the specified extra text to the end of the specified string
ParameterDescription
OriginalString: The string onto which you which StringToAppend to be added to the end of
StringToAppend: The text you wish to be added
Return:
Returns the string with the specified text appended

{i} D_Bind ({s} InputName, {s} ActionName, {i} ObserveModifiers, {s} Modifier)
Description:
Binds the named input to the named action in the game state
ParameterDescription
InputName: The name of the input that you wish to bind
ActionName: The name of the action to take when the input occurs
ObserveModifiers: If this value is 1 the input will only be triggered if the Modifier is correct, otherwise modifiers will be ignored. If an action is bound to KEY_S and another bound to CTRL + KEY_S both actions will be triggered on CTRL + KEY_S unless both bindings have this value set to 1
Modifier: CTRL, SHIFT, ALT, LMOUSE and RMOUSE are valid strings. Keyboard modifiers only work if bound to a keyboard input and mouse modifiers only work if bound to a mouse input
Return:
No return value

{i} D_CancelArmReach ()
Description:
Cancels the players reach arm, this only has an effect if an IK arm is currently reaching to grab something or is already locked on to something.
ParameterDescription
Return:

{i} D_ChangeSoundVolume ({i} SoundHandle, {f} Volume, {f} Interpolate)
Description:
Changes the specified sound from its current volume to the specified volume.
ParameterDescription
SoundHandle: The handle to the sound. Returned from any play sound command.
Volume: The volume to interpolate to. Valid range 0.0 - 1.0.
Interpolate: Time in seconds to interpolate to the specified volume.
Return:
Returns 0 if the sound is not playing.

{i} D_ClearBindings ()
Description:
Removes all input bindings for the game state
ParameterDescription
Return:
No return value

{s} D_ClearLastActionedCharacter ()
Description:
Resets the name of the last actioned character to 'none'. For more details see D_GetLastActionedCharacter
ParameterDescription
Return:

{i} D_CloseJournal ()
Description:
Closes the players journal if open
ParameterDescription
Return:

{i} D_CreateGlobalFloatArray ({s} VariableName, {i} Size)
Description:
Allocates an array of Float variables which can be referenced by the name provided and is of the size provided
ParameterDescription
VariableName: Name that can be used to refer to the array
Size: Number of elements to create in the array
Return:
No return value

{i} D_CreateGlobalIntArray ({s} VariableName, {i} Size)
Description:
Allocates an array of Int variables which can be referenced by the name provided and is of the size provided
ParameterDescription
VariableName: Name that can be used to refer to the array
Size: Number of elements to create in the array
Return:
No return value

{i} D_CreateGlobalPointArray ({s} VariableName, {i} Size)
Description:
Allocates an array of Point variables which can be referenced by the name provided and is of the size provided
ParameterDescription
VariableName: Name that can be used to refer to the array
Size: Number of elements to create in the array
Return:
No return value

{i} D_CreateTidalWave ({s} DOBName)
Description:
Tells a MOVINGWAVES DOB to make the next spawned wave a tidal wave. This is very specific and should only be used for the boat scene for which it was designed
ParameterDescription
DOBName: Name of the MOVINGWAVES DOB to trigger a tidal wave in
Return:
No return value

{i} D_CullGeometry ({s} NodeName, {i} Cull)
Description:
Shows or hides the named scene graph node
ParameterDescription
NodeName: Name of the scene graph node to Cull or Show
Cull: 1 = Hide object, 0 = Show object
Return:

{i} D_DOBCoronaEnable ({s} Dob name, {i} Enable)
Description:
Enables and disables a specified Corona.
ParameterDescription
Dob name: The name of the Corona DOB
Enable: 0 = Disable, 1 = Enable.
Return:
No return value

{i} D_DOBCoronaSetSpeed ({s} Dob name, {f} Fade Speed)
Description:
Sets the fade speed of the Corona, specified in Fadeatrons(tm). (1.0 / Fade Speed) = Time in seconds.
ParameterDescription
Dob name: The name of the Corona DOB
Fade Speed: <1.0 Faster, 1.0 = 1 second, >1.0 Slower
Return:
No return value

{i} D_DOBParticleSystemEnable ({s} Dob name, {i} Enable)
Description:
Changes the settings on a DOB Particle system.
ParameterDescription
Dob name: The name of the Particle system DOB
Enable: 0 = Disable, 1 = Enable
Return:
No return value

{i} D_DebugMessage ({s} Text)
Description:
Display a message box containing the specified text, but only if the debugger is active. Activate the debugger using D_EnableDebugger(1).
ParameterDescription
Text: Text to display in the message box
Return:

{i} D_DecNumberofItem ({i} ItemName, {i} DecreaseBy)
Description:
Decreases the number of the named item in the players inventory by the specified amount. This will have a minimum value of 0
ParameterDescription
ItemName: Type of item to decrease the quantity of
DecreaseBy: Amount to decrease the stored number by
Return:

{i} D_DeleteAllGlobals ()
Description:
Deletes all global variables and the strings that are associated. Should be called at the end of a level, or beginning of the next level after copying any required globals
ParameterDescription
Return:

{i} D_DeleteGlobalFloatArray ({s} VariableName)
Description:
Deletes the allocated memory for the named Int array, losing all values
ParameterDescription
VariableName: Name of the array to delete
Return:
No return value

{i} D_DeleteGlobalIntArray ({s} VariableName)
Description:
Deletes the allocated memory for the named Int array, losing all values
ParameterDescription
VariableName: Name of the array to delete
Return:
No return value

{i} D_DeleteGlobalPointArray ({s} VariableName)
Description:
Deletes the allocated memory for the named point array, losing all values
ParameterDescription
VariableName: Name of the array to delete
Return:
No return value

{s} D_DisableRenderer ()
Description:
Disables the rendering engine
ParameterDescription
Return:

{i} D_DobPickUpEnable ({s} DobName, {i} Enabled)
Description:
Sets the enabled status of a DOB pick up. 0 = Pick up disabled, 1 = Pick up enabled .
ParameterDescription
DobName: Name of the pick up dob to be set.
Enabled: 0 = Pick up disabled, 1 = Pick up enabled
Return:

{i} D_DumpAllDobMemberVariables ()
Description:
Tells each DOB currently loaded to display the values stored in all of its member variables. This will only have an effect if the DOB has implemented the feature.
ParameterDescription
Return:
The return value has no meaning.

{i} D_DumpDobMemberVariables ({s} DobName)
Description:
Tells the named DOB to display the values stored in all of its member variables. This will only have an effect if the DOB has implemented the feature.
ParameterDescription
DobName: Name of the DOB to dump member variable information about. The DOB can be of any type
Return:
The return value has no meaning.

{i} D_DumpGlobalVariables ()
Description:
Displays the value of every global variable in the output window.
ParameterDescription
Return:
The return value has no meaning.

{i} D_EmitterStart ({s} DobName)
Description:
Tells the named particle emitter DOB to begin emitting, or reset if already running
ParameterDescription
DobName: Name of the DOB to start emitting. Must be of type DOBPARTICLEEMITTER or an error will occur
Return:

{i} D_EmitterStop ({s} DobName)
Description:
Tells the named particle emitter DOB to stop emitting. Existing particles will continue moving until their death, and when all particles are dead the emitter will be de-activated
ParameterDescription
DobName: Name of the DOB to stop emitting
Return:

{i} D_EnableActionNode ({s} Dob name, {i} Enable)
Description:
Can be used to enable or disable an Action Node DOB.
ParameterDescription
Dob name: The name of the action node DOB
Enable: 1 = Enable, 0 = Disable
Return:
No return value

{i} D_EnableAiListener ({i} Enable)
Description:
Turns off the entire AI listener system.
ParameterDescription
Enable: 0 = AI Listeners Disabled, 1 = Enable AI Listeners
Return:

{i} D_EnableAnimatedReachTarget ({s} DOBName, {i} Enable)
Description:
Enables or disables the specified ANIMATEDREACHTARGET DOB. When an ANIMATEDREACHTARGET DOB is disabled the optional ON_ACTION_DISABLED script will be executed and the player arm will not reach for the object. The DOB is automatically disabled after the first time it is actioned
ParameterDescription
DOBName: Specifies which ANIMATEDREACHTARGET DOB to enable or disable
Enable: 1 = Enable, player can reach, 0 = Disable DOB, player will not reach when actioned, but disabled script will be run if specified
Return:
No return value

{i} D_EnableAnimatedReachTargetMulti ({s} DOBName, {i} Enable)
Description:
Enables or disables the specified ANIMATEDREACHTARGETMULTI DOB. When an ANIMATEDREACHTARGETMULTI DOB is disabled the optional ON_ACTION_DISABLED script will be executed and the player arm will not reach for the object
ParameterDescription
DOBName: Specifies which ANIMATEDREACHTARGETMULTI DOB to enable or disable
Enable: 1 = Enable, player can reach and next stage will be triggered, 0 = Disable DOB, player will not reach when actioned, but disabled script will be run if specified
Return:
No return value

{i} D_EnableCameraChangesInCutScenes ({i} Enable)
Description:
Call this function to suppress camera changes in cut scenes to facilitate lighting or allow you to view the cut scene for debugging
ParameterDescription
Enable: 1 = allow cut scenes to switch cameras, 0 = prevent camera switching
Return:
No return value

{i} D_EnableCylinderTrigger ({s} DobName, {i} Enable)
Description:
Enables / disables all transition triggers for the named cylinder trigger DOB
ParameterDescription
DobName: Name of the cylinder trigger DOB to enable / disable
Enable: 1 = Enable, 0 = Disable
Return:

{i} D_EnableDebugger ({i} Enable)
Description:
Enables the script debugger. Currently this only enables the D_DebugMessage() commands, but more debugger features may be added later.
ParameterDescription
Enable: 1 = Activates the debugger, 0 = Disable the debugger
Return:
No return value

{i} D_EnableEffect ({s} Effect name, {i} Enable)
Description:
Enables and disables specific effects. Note: when enabling an effect, this does not activate it but to allow it to happen. This function is used for preventing effects from happening.
ParameterDescription
Effect name: The name of the effect to enable/disable.
Enable: 0 = Disable, 1 = Enable.
Return:
No return value

{i} D_EnableFallingDamage ({i} Enable)
Description:
Switches on or off player falling damage
ParameterDescription
Enable: 1 = Allow the player to be damaged by falling, 0 = Do not allow falling damage
Return:

{i} D_EnableGroundFog ({i} Enable)
Description:
Enables and disables the ground fog effect.
ParameterDescription
Enable: 0 to disable, 1 to enable
Return:
No return value

{i} D_EnablePhysics ({i} Enable)
Description:
Switches player physics on / off. this is the equivelant of entering / leaving fly mode
ParameterDescription
Enable: 1 = Player is physics controlled and collides with physics objects, 0 = Player in fly mode and does not collide with physics objects
Return:

{i} D_EnablePlanarTrigger ({s} DobName, {i} Enable)
Description:
Enables / disables all transition triggers for the named planar trigger DOB
ParameterDescription
DobName: Name of the planar trigger DOB to enable / disable
Enable: 1 = Enable, 0 = Disable
Return:

{s} D_EnableRenderer ()
Description:
Enables the rendering engine
ParameterDescription
Return:

{i} D_EnableSanityLoss ({i} Enable)
Description:
Enables and disables sanity loss. If this value is set to zero, the player will not lose sanity through script commands or AI influence.
ParameterDescription
Enable: 0 = Disable, 1 = Enable.
Return:
No return value

{i} D_EnableShockEffect ({s} DOBName, {i} Enable)
Description:
Enables or disables the specified SHOCKEFFECT DOB. This will not cause the effect to trigger, but will allow it to trigger as the trigger position enters the view
ParameterDescription
DOBName: Specifies which SHOCKEFFECT DOB to enable or disable
Enable: 1 = Enable, effect will occur when next enters view, 0 = Disable DOB, the effect will never occur
Return:
No return value

{i} D_EnableShootTrigger ({s} DOBName, {i} Enable)
Description:
Enables or disables the specified SHOOTTARGET DOB. When disabled the shoot target will not run scripts when shot
ParameterDescription
DOBName: Specifies which SHOOTTARGET DOB to enable or disable
Enable: 1 = Enable, script will run when target shot, 0 = Disable DOB, scripts will never be run by the named DOB
Return:
No return value

{i} D_EnableStaminaLoss ({i} Enable)
Description:
Enables and disables player stamina loss
ParameterDescription
Enable: 1 = Player loses stamina when moving / jumping etc, 0 = The player does not lose stamina
Return:

{i} D_EnableTriggers ({i} Enable)
Description:
Enables and Disables triggers
ParameterDescription
Enable: 1 turns the triggers on and 0 turns the triggers off
Return:
The return value has no meaning.

{i} D_EnableVertigo ({i} Enable)
Description:
Enables the player vertigo effect. This allows the vertigo controller to set the values but does not necessarily trigger the effect
ParameterDescription
Enable: 1 = Enable vertigo effect, 0 = Disable it, preventing the vertigo effect from being visible
Return:

{i} D_EnableVisibilityTrigger ({s} DobName, {i} Enable)
Description:
Enables / disables all transition triggers for the named visibility trigger DOB
ParameterDescription
DobName: Name of the visibility trigger DOB to enable / disable
Enable: 1 = Enable, 0 = Disable
Return:

{i} D_FadeScreen ({f} Red, {f} Green, {f} Blue, {f} Alpha, {f} Time)
Description:
Fades the screen from whatever colour it is currently at to the specified colour and transparency over the time specified
ParameterDescription
Red: Red component of the colour to fade to (Range 0.0 to 1.0)
Green: Green component of the colour to fade to (Range 0.0 to 1.0)
Blue: Blue component of the colour to fade to (Range 0.0 to 1.0)
Alpha: Alpha component of the colour to fade to (Range 0.0 to 1.0). 0.0 is completely transparent
Time: Length of time to spend interpolating from current colour to specified colour
Return:

{p} D_FindGroundUnderPoint ({p} Point)
Description:
Performs a pick down from the specified point and returns the point at which the first intersection with a polygon from the scene occurs. It is important that the specified point should be above the ground
ParameterDescription
Point: World space location to pick down from
Return:
Returns the point at which the ground is below the specified point

{i} D_FireBullet ({p} Origin, {p} Direction, {s} WeaponName)
Description:
Fires a bullet as though the player has fired it himself, but from the specified location, in the direction provided and using the named weapon. The player cannot be hit by these bullets but NPCs, cloth, glass etc can
ParameterDescription
Origin: The location from which the shot should be fired
Direction: A vector representing the direction the bullet should be fired in from the origin
WeaponName: The name of the weapon to fire. For a list of weapon names see D_PlayerApplyDamage()
Return:

{i} D_FireBulletNoNPC ({p} Origin, {p} Direction, {s} WeaponName)
Description:
Fires a bullet from a specified location which will not intersect NPCs, the functionality the same D_FireBullet.
ParameterDescription
Origin: The location from which the shot should be fired
Direction: A vector representing the direction the bullet should be fired in from the origin
WeaponName: The name of the weapon to fire. For a list of weapon names see D_PlayerApplyDamage()
Return:

{i} D_FireTracerBullet ({p} Origin, {p} Direction, {s} WeaponName)
Description:
Fires a tracer bullet from a specified location, the functionality the same D_FireBullet.
ParameterDescription
Origin: The location from which the shot should be fired
Direction: A vector representing the direction the bullet should be fired in from the origin
WeaponName: The name of the weapon to fire. For a list of weapon names see D_PlayerApplyDamage()
Return:

{i} D_FireTracerBulletNoNPC ({p} Origin, {p} Direction, {s} WeaponName)
Description:
Fires a tracer bullet from a specified location which will not intersect NPCs, the functionality the same D_FireBullet.
ParameterDescription
Origin: The location from which the shot should be fired
Direction: A vector representing the direction the bullet should be fired in from the origin
WeaponName: The name of the weapon to fire. For a list of weapon names see D_PlayerApplyDamage()
Return:

{i} D_FlockAddBoidsToFlock ({s} Dob name, {s} Boid Type, {i} Number to Add)
Description:
Adds a number of boids to the flock specified by Flock Name.
ParameterDescription
Dob name: The name of the Flock DOB
Boid Type: Specifies the type of boid, and is the same value that is used in the Boid Type field in the Dob Tool.
Number to Add: Number of boids to add to the flock.
Return:
No return value

{i} D_FlockEnable ({s} Dob name, {i} Enable)
Description:
Enables the selected flock.
ParameterDescription
Dob name: The name of the Flock DOB
Enable: 0 = Disable, 1 = Enable
Return:
No return value

{i} D_FlockMakeRCBoidFromNode ({s} Dob name, {i} Is Predator, {s} Node Name)
Description:
Creates a Node based Remote Boid in the flock specified by Flock Name.
ParameterDescription
Dob name: The name of the Flock DOB
Is Predator: 0 = Prey, 1 = Predator.
Node Name: Name of the node to attach the RC Boid to.
Return:
No return value

{i} D_FlockMakeStaticRCBoid ({s} Dob name, {i} Is Predator, {f} X, {f} Y, {f} Z)
Description:
Creates a static Remote Boid in the flock specified by Flock Name.
ParameterDescription
Dob name: The name of the Flock DOB
Is Predator: 0 = Prey, 1 = Predator.
X: X position in world coordinates.
Y: Y position in world coordinates.
Z: Z position in world coordinates.
Return:
No return value

{i} D_ForceDoorOpen ({s} DobName)
Description:
Forces a door to the open position, regardless of its locked status.
ParameterDescription
DobName: Name of the door to be opened.
Return:

{i} D_ForceEffect ({s} EffectName, {f} Rate, {f} Value)
Description:
Tells the effect manager to set the desired level of the named effect to the specified value. The current value of the effect will drift towards the desired effect at the specified rate. This should be used to activate insanity and other effects manually
ParameterDescription
EffectName: Name of the effect to activate. This name should correspond exactly with the name in the effect tool. Currently supported names are: 'Muttering', 'Blurred Vision' and 'Tinitus'.
Rate: Rate at which the effect should change value. This effects how fast the effect will interpolate between new values
Value: Desired value for the effect. This will not immediately become the actual value, the current value will interpolate towards this value at the rate specified by Rate
Return:

{i} D_GenerateAiEvent ({s} EventName)
Description:
Generates an event that can trigger an action on an AI character. This does not have the same effect as D_GenerateEvent and cannot be used to trigger game script actions
ParameterDescription
EventName: Name of the event to trigger
Return:

{i} D_GenerateEvent ({s} EventName)
Description:
Generates the named event, causing any scripting events or resume events with the same name to be triggered
ParameterDescription
EventName: Name of the event to trigger
Return:

{i} D_GenerateGlobalEvent ({s} EventName)
Description:
Generates the named event, causing any scripting events or resume events with the same name to be triggered, and also sends the event to the AI event system which can trigger scripts on characters etc
ParameterDescription
EventName: Name of the event to trigger
Return:

{q} D_GetAngleForCameraToFacePoint ({p} WorldPos)
Description:
Returns the direction the camera must be set to face in order to point at the specified location. The direction is returned as a quaternion
ParameterDescription
WorldPos: The world position to calculate the facing vector for
Return:
The quaternion required to face the specified point

{p} D_GetCameraFacingVector ()
Description:
Returns a point representing the vector along which the current camera is facing
ParameterDescription
Return:
Current camera facing vector

{p} D_GetCameraLocationVector ()
Description:
Returns a point representing the world location of the current camera
ParameterDescription
Return:
Current camera location

{p} D_GetCameraRightVector ()
Description:
Returns a vector which represents the direction perpendicular (and to the right) of the camera facing direction
ParameterDescription
Return:
Returns the cameras right vector

{s} D_GetCurrentLevel ()
Description:
This function returns the name of the current level so that scripts can run differently depending upon the current game level
ParameterDescription
Return:
Returns the name of the current level

{i} D_GetDobBool ({s} DobName, {s} PropertyName)
Description:
Returns the boolean value stored in the named property of the named DOB, if the property is of the correct type
ParameterDescription
DobName: Name of the DOB to get the property value from
PropertyName: Name of the property to retrieve the value from. This must be of the correct type
Return:
Returns the boolean property value

{f} D_GetDobFloat ({s} DobName, {s} PropertyName)
Description:
Returns the float value stored in the named property of the named DOB, if the property is of the correct type
ParameterDescription
DobName: Name of the DOB to get the property value from
PropertyName: Name of the property to retrieve the value from. This must be of the correct type
Return:
Returns the float property value

{i} D_GetDobInt ({s} DobName, {s} PropertyName)
Description:
Returns the integer value stored in the named property of the named DOB, if the property is of the correct type
ParameterDescription
DobName: Name of the DOB to get the property value from
PropertyName: Name of the property to retrieve the value from. This must be of the correct type
Return:
Returns the integer property value

{i} D_GetDobLocation ({s} DobName)
Description:
Returns the world location of the named DOB. For DOBs that have no location (0.0,0.0,0.0) will be returned
ParameterDescription
DobName: Name of the DOB to query
Return:

{p} D_GetDobPoint ({s} DobName, {s} PropertyName)
Description:
Returns the point value stored in the named property of the named DOB, if the property is of the correct type
ParameterDescription
DobName: Name of the DOB to get the property value from
PropertyName: Name of the property to retrieve the value from. This must be of the correct type
Return:
Returns the point property value

{i} D_GetDoorBoltIsLocked ({i} DobName)
Description:
Returns 1 if the door associated with the door bolt is locked, and 0 if it is not
ParameterDescription
DobName: Name of the door bolt DOB to check
Return:
Locked status of the door with the named bolt attached

{i} D_GetDoorBreakStage ({s} DobName)
Description:
Returns the current break stage of the named breakable door.
ParameterDescription
DobName: Name of the BREAKABLEDOOR DOB to query. This DOB must be of this type or it will not be found
Return:
Returns the break stage of the breakable door. 0 = Not yet damaged

{i} D_GetDoorJammed ({s} DobName)
Description:
Returns 1 if the named door DOB is jammed and 0 if it is jammed
ParameterDescription
DobName: Name of the door DOB to query
Return:
Returns the door DOBs jammed status

{i} D_GetDoorLocked ({s} DobName)
Description:
Returns 1 if the named door DOB is locked and 0 if it is unlocked
ParameterDescription
DobName: Name of the door DOB to query
Return:
Returns the door DOBs locked status

{i} D_GetDoorOpen ({s} DobName)
Description:
Returns 1 if the named door DOB is open and 0 if it is closed
ParameterDescription
DobName: Name of the door DOB to query
Return:
Returns the door DOBs open status

{i} D_GetDoorWillJam ({s} DobName, {i} WhenOpening)
Description:
Returns 1 if the named door will jam when either opened or closed depending on the WhenOpening parameter. Please note that this is only true at the time of calling, and an object could potentially be moved into the way after the call but before the actual attempt to open, although it is very unlikely.
ParameterDescription
DobName: Name of the door dob to check
WhenOpening: If 1 the check is made trying to open the door, if 0 the check is made trying to close it
Return:
Function returns 1 if the door will jam, 0 if it will not

{f} D_GetGameTime ()
Description:
Gets the current elapsed time in seconds since the game started. This is subject to the time compression, and is not 'real' time. So if the time compression is 0.5 and 10 secs of game play has elapsed, then the game time will be 5 secs
ParameterDescription
Return:
The current game time in seconds

{f} D_GetGlobalFloatArrayEntry ({s} VariableName, {i} Index)
Description:
Gets the value from the specified index of the named Float array
ParameterDescription
VariableName: Name of the array to get the value from
Index: Index of the item to get the value from
Return:
Returns the Float value found at the specified index. If there is no element at this index or the element has not yet been set, a value of 0.0 will be returned

{f} D_GetGlobalFloat ({s} VariableName)
Description:
Returns the value stored in the named global float variable. If the named variable does not exist 0.0 will be returned and an error will be displayed in the output window
ParameterDescription
VariableName: Name of the float global variable to retrieve the value from
Return:
The floating point value contained by the named variable. 0.0 if it did not exist

{i} D_GetGlobalIntArrayEntry ({s} VariableName, {i} Index)
Description:
Gets the value from the specified index of the named Int array
ParameterDescription
VariableName: Name of the array to get the value from
Index: Index of the item to get the value from
Return:
Returns the Int value found at the specified index. If there is no element at this index or the element has not yet been set, a value of 0 will be returned

{i} D_GetGlobalInt ({s} VariableName)
Description:
Returns the value stored in the named global integer variable. If the named variable does not exist 0 will be returned and an error will be displayed in the output window
ParameterDescription
VariableName: Name of the integer global variable to retrieve the value from
Return:
The integer value contained by the named variable. 0 if it did not exist

{p} D_GetGlobalPoint ({s} VariableName)
Description:
Returns the value stored in the named global point variable. If the named variable does not exist (0.0,0.0,0.0) will be returned and an error will be displayed in the output window
ParameterDescription
VariableName: Name of the point global variable to retrieve the value from
Return:
The point value contained by the named variable. (0.0,0.0,0.0) if it did not exist

{p} D_GetGlobalPointArrayEntry ({s} VariableName, {i} Index)
Description:
Gets the value from the specified index of the named point array
ParameterDescription
VariableName: Name of the array to get the value from
Index: Index of the item to get the value from
Return:
Returns the Point value found at the specified index. If there is no element at this index or the element has not yet been set, a value of (0.0, 0.0, 0.0) will be returned

{i} D_GetInventoryItem ({i} Name)
Description:
Determines if the specified item exists in the inventory. Returns 1 if found, 0 if absent.
ParameterDescription
Name: Name of the inventory item - case specific.
Return:
Function returns 1 if items was found, 0 if absent.

{f} D_GetIomValue ({s} IomName, {f} Input)
Description:
Gets the value at the specified input value from the named IOM module. This must first be loaded using D_RegisterIoModule(...)
ParameterDescription
IomName: Identifying name to be assigned to this IOM in the lookup table. This is then used by D_IomGetValue(...)
Input: The input value to lookup. This is capped using the scaling values specified in the IOM file
Return:
Returns the output value found from the lookup

{s} D_GetLastActionedCharacter ()
Description:
Returns the name of the last character that was actioned. When the player presses action, the last actioned character is cleared to 'none'. If the action node is then determined to be a character, the last actioned character is filled with the name of the character. This is cleared again next time the user presses action, or if D_ClearLastActionedCharacter is called
ParameterDescription
Return:
The name of the character that was last actioned, since the last call to D_ClearLastActionedCharacter or a non-character reach target is actioned. If a character was not actioned, the value of the return string will be 'none'

{f} D_GetMaxSanity ()
Description:
Returns the players maximum sanity value. The players current sanity cannot rise above the max sanity level. Any calls to D_SetSanity() will be capped at the max sanity value
ParameterDescription
Return:
Returns max sanity value for the player. In range 0.0 to 1.0

{i} D_GetNifLoaded ({s} NIFName)
Description:
Returns 1 if the specified NIF is loaded and 0 if it is not. The NIF name should be in the format 02_STREETS_ONE \ SomeNif.nif. Note that the path is assumed to be relative to the backgrounds folder, and that the specified NIF should NOT be named with the _roomgeomatry (this is added by the code)
ParameterDescription
NIFName: Name of the background NIF to query to see if it is loaded. The NIF name should be in the format 02_STREETS_ONE \ SomeNif.nif. Note that the path is assumed to be relative to the backgrounds folder, and that the specified NIF should NOT be named with the _roomgeomatry (this is added by the code)
Return:
Returns 1 if the NIF is loaded and 0 if it is not

{i} D_GetPlayerCrouch ()
Description:
Returns 1 if the player is crouched and 0 if the player is not
ParameterDescription
Return:
Returns the players crouched status

{i} D_GetPlayerHoldingClingTarget ({s} DobName)
Description:
Returns 1 if the player is currently holding onto the named CLINGTARGET, and 0 if he is not
ParameterDescription
DobName: Name of the CLINGTARGET DOB to query
Return:
Returns 1 if the player is holding the CLINGTARGET and 0 if not

{i} D_GetPlayerMovementSpeed ()
Description:
Returns the players last recorded movement speed (Last frame)
ParameterDescription
Return:
0 = player not moving, 1 = player crawling, 2 = player walking, 3 = player running

{i} D_GetResourceFilename ({i} ResourceID)
Description:
Returns the filename value from the language resource with the specified ID. Each resource can have both a string and a filename. Both the generic and level specific resource tables are searched
ParameterDescription
ResourceID: Integer ID of the resource to locate the filename for
Return:
Returns the filename found in the resource table under the specified ID

{i} D_GetResourceString ({i} ResourceID)
Description:
Returns the string value from the language resource with the specified ID. Each resource can have both a string and a filename. Both the generic and level specific resource tables are searched
ParameterDescription
ResourceID: Integer ID of the resource to locate the string for
Return:
Returns the string found in the resource table under the specified ID

{f} D_GetSanity ()
Description:
Returns the players current sanity value. The players current sanity cannot rise above the max sanity level
ParameterDescription
Return:
Returns current sanity value for the player. In range 0.0 to 1.0

{f} D_GetTimeCompression ()
Description:
Returns the current time compression at which the game is running. See D_SetTimeCompression for a description of the relevant values
ParameterDescription
Return:
The current game time compression

{i} D_GetUserInputInt ({s} Prompt)
Description:
Displays an input box with the specified title to the user, and then suspends the virtual machine until the OK button is clicked. When the OK button is clicked, the LastReturnedValue is set to the number entered in the box. Only to be used for debug functionality
ParameterDescription
Prompt: Text to display on the title of the input dialog that appears
Return:
The return value has no meaning. GetLastReturned() must be called to find out the number entered

{i} D_HeartEnable ({i} Enable, {i} Interpolate)
Description:
Activates and deactivates control of the Heartbeat.
ParameterDescription
Enable: 0 = Deactivates the heart control and sounds, 1 = Enables heart control and sound.
Interpolate: 0 = Jumps from the game heart controller values, 1 = interpolate from the game controller values.
Return:

{i} D_HeartRelease ({i} Interpolate)
Description:
Releases script control of the Heartbeat back to the in game heartbeat controller.
ParameterDescription
Interpolate: 0 = jumps back to the in game heart controller values, 1 = interpolate to game controller values.
Return:

{i} D_HeartSetRate ({f} BPM, {f} Volume, {i} Interpolate)
Description:
Sets the rate of the heart beat in Beats Per Minute, and the volume to play the beats at, set the interpolate to scale from the current value instead of jumping.
ParameterDescription
BPM: The heart will beat at this rate
Volume: A value from 0 to 1 where, 0 = no sound, 1 = Full volume
Interpolate: 1 = Interpolate the volume and BPM, 0 = Volume and BPM jump to set values.
Return:

{i} D_HeartSkipBeats ({i} BeatsToSkip)
Description:
Causes the heart to skip by the specified number. note, the time taken to skip these beats is dependent on the BPM. Skipping 60 beats at 60 BPM will take 1 minute.
ParameterDescription
BeatsToSkip: The heart will beat at this rate
Return:

{i} D_IncNumberofItem ({i} ItemName, {i} IncreaseBy)
Description:
Increases the number of the named item in the players inventory by the specified amount. If the player has none of this item they will still be added
ParameterDescription
ItemName: Type of item to increase the quantity of
IncreaseBy: Amount to increase the stored number by
Return:

{i} D_InsanityActivateBlur ({i} Enable)
Description:
Activates / deactivates the blurred screen insanity effect
ParameterDescription
Enable: 1 = Enable, 0 = Disable
Return:

{i} D_IsEven ({i} Input Value)
Description:
Checks whether a value is even
ParameterDescription
Input Value: Value Check
Return:
True(1) for even, false(0) for odd.

{i} D_IsTorchOn ()
Description:
Returns 1 if the player torch is switched on and 0 if it is not
ParameterDescription
Return:
Returns the player torch on / off status

{i} D_KillAllScriptTimers ()
Description:
Kills all script timers created using D_SetScriptTimer. After this call no script timers will trigger and run a script unless D_SetScriptTimer is called again.
ParameterDescription
Return:
No return value

{i} D_KillScriptTimer ({s} TimerName)
Description:
Kills the named timer, preventing the script being run again by the timer (unless restarted)
ParameterDescription
TimerName: The identifying name of the timer to stop, as passed into D_SetScriptTimer()
Return:

{i} D_ListBindableActions ()
Description:
List the identifying strings of all actions that can be bound to
ParameterDescription
Return:
No return value

{i} D_ListBindableInputs ()
Description:
List the identifying strings of all inputs that can be bound to
ParameterDescription
Return:
No return value

{i} D_LitterEnable ({s} LitterDOBName, {i} Enable)
Description:
Enables or disables the named litter DOB
ParameterDescription
LitterDOBName: Name of the Rain dob to be Enabled
Enable: 1 = Litter Enabled, 0 = Litter Disabled
Return:
No return value

{i} D_LockRigidBody ({s} DobName, {i} Lock)
Description:
Locks or unlocks the named RIGIDBODY DOB. A locked RIGIDBODY cannot be pushed by the player, or by NPCs
ParameterDescription
DobName: Name of the rigid body DOB to lock / unlock
Lock: 1 = Lock rigid body, 0 = Unlock it
Return:

{p} D_MakeVectorWithLength ({p} Vector, {f} Length)
Description:
Unitizes the point value provided and then multiples it by the floating point length specified. The resulting vector is one pointing the same direction as the input vector but with the specified length
ParameterDescription
Vector: Point value representing a vector
Length: Length you wish the returned vector to be
Return:
Returns a vector in the same direction as the input vector but with the specified length

{i} D_Message ({s} Text)
Description:
Display a message box containing the specified text
ParameterDescription
Text: Text to display in the message box
Return:

{i} D_ModifySanity ({f} Amount)
Description:
Increases the players sanity by the specified amount. Enter a negative value to decrease the sanity. The value should be in the range 0.0 to 1.0
ParameterDescription
Amount: Amount by which to increase the insanity. In the range 0.0 to 1.0
Return:

{i} D_MovingFloorEnable ({s} DOBName, {i} Enable)
Description:
Enables / Disables the named MOVINGFLOOR DOB. If enabled the specified force in the DOB tool is applied to the player when standing on the floor
ParameterDescription
DOBName: Name of the MOVINGFLOOR DOB to be Enabled
Enable: 1 = Enable the moving floor force, 0 = Disable the moving floor force
Return:
No return value

{i} D_MovingFloorEnableScript ({s} DOBName, {i} Enable)
Description:
Enables or disables the script to be executed when a collision is detected between the player and the MOVINGFLOOR physics object. This flag is set to false each time the script is run to prevent multiple triggers as many collisions occur very rapidly
ParameterDescription
DOBName: The name of the MOVINGFLOOR DOB
Enable: 1 = Script will be run on next collision, 0 = Script will not run on next collision
Return:
No return value

{i} D_MusicChangeBank ({s} Bank Name)
Description:
Changes the music bank for the level.
ParameterDescription
Bank Name: The name of the bank to switch to.
Return:
No return value

{i} D_MusicPlayBase ({f} Volume, {f} Interpolate)
Description:
This plays the base music for the level
ParameterDescription
Volume: The volume to start the music track base loop, specifying a volume of 0.0 would turn it off
Interpolate: An Interpolate of 0.0 will make the change instantly, specifying a time period will make the change in volume over the time specified.
Return:
No return value

{i} D_MusicPlayOverlayIndex ({i} Index, {f} Volume, {f} Interpolate, {v} noname)
Description:
This plays an overlay music loop for the level
ParameterDescription
Index: The Index of the overlay to play.
Volume: The volume to start the music track base loop, specifying a volume of 0.0 would turn it off
Interpolate: An Interpolate of 0.0 will make the change instantly, specifying a time period will make the change in volume over the time specified.
:
Return:
No return value

{i} D_OpenJournal ({s} SectionString)
Description:
Opens the players journal at the specified section and subsection using the 2.1.2 notation
ParameterDescription
SectionString: Section number. Specified as a string, ensure you use quotes. Subsections can be specified using the format 3.1 or 2.2.1. If the specified section / subsection does not exist the journal will be opened at the main page.
0: Main index
1: Diary
2: Bestiary
3: Clues
Return:

{i} D_OutputToDebugRadio ({f} Frequency, {s} String)
Description:
Outputs the specified string on the specified frequency to the debug radio on screen info display. This will only be displayed if the radio is tuned to this frequency using the command D_SetDebugRadioFrequency(...)
ParameterDescription
Frequency: Floating point number representing the frequency to output to
String: Text value to output to the window if the radio is tuned to the correct frequency
Return:
No return value

{i} D_PauseKfAnimation ({s} DOBName, {i} Pause)
Description:
Pauses or unpauses a KFANIMATION DOB. Note that this command must be used instead of play. A paused Kf animation can be resumed and will continue playing from the point in the animation at which it was paused. Use this command with a Pause value of 0 to resume. Calling D_PlayKfAnimation will not unpause the animation if paused using this command
ParameterDescription
DOBName: Name of the KFANIMATION DOB to be paused / unpaused
Pause: 1 = Pause, 0 = UnPause
Return:
No return value

{i} D_PlaceModelAndFaceVector ({s} NifFilename, {p} Position, {p} Vector)
Description:
Loads the specified NIF file and attaches it to the scene graph at the specified location. This should be used for testing only. The model will not be portalled. The object will be rotated to face along the specified vector
ParameterDescription
NifFilename: Filename (relative to the engine folder) of the NIF to load
Position: World location at which the model should be placed
Vector: Vector indicating the direction along which the object should face
Return:

{i} D_PlaceModel ({s} NifFilename, {p} Position)
Description:
Loads the specified NIF file and attaches it to the scene graph at the specified location. This should be used for testing only. The model will not be portalled
ParameterDescription
NifFilename: Filename (relative to the engine folder) of the NIF to load
Position: World location at which the model should be placed
Return:

{i} D_PlayAnimatedLightbeam ({s} DOBName, {f} Duration)
Description:
Tells the ANIMATEDLIGHTBEAM DOB to play its animation once
ParameterDescription
DOBName: Name of the ANIMATEDLIGHTBEAM DOB to play.
Duration: Length of time to animate over. This determines the speed of interpolation
Return:
Return value has no meaning

{i} D_PlayArmAnimation ({s} AnimationName, {i} ReturnToBase)
Description:
Plays an arm animation which must first be added using D_AddArmAnimation() and optionally returns to playing the looping base animation that is currently active
ParameterDescription
AnimationName: Name of the animation to play
ReturnToBase: 1 = Return to looping base animation when finished, 0 = Do not return to base animation
Return:

{f} D_PlayCameraAnimation ({s} AnimationName, {i} ReturnToBase)
Description:
Plays a camera animation which must first be added using D_AddCameraAnimation() and optionally returns to playing the looping base animation that is currently active
ParameterDescription
AnimationName: Name of the animation to play
ReturnToBase: 1 = Return to looping base animation when finished, 0 = Do not return to base animation
Return:
Returns the duration of the animation in seconds

{f} D_PlayCameraShake ({s} DOBName)
Description:
Tells the specified CAMERASHAKE DOB to play its animation. Different effects can be achieved by creating different CAMERASHAKE DOBs and using different IOT files for each.
ParameterDescription
DOBName: Specifies which CAMERASHAKE DOB to play
Return:
Returns the duration of the animation or 0.0f if the animation will loop

{i} D_PlayDobCutScene ({s} DobName)
Description:
Triggers the named cut scene DOB and begins the sequence. If the DOB is not the end of a chain then it will continue triggering cut scene DOBs until the sequence is complete
ParameterDescription
DobName: Name of the cut scene DOB to begin playing
Return:

{i} D_PlayDobSound ({s} DobName, {i} NumLoops)
Description:
Tells the named sound DOB (Max or DOBTool generated) to start playing
ParameterDescription
DobName: Name of the sound DOB that is to be played
NumLoops: 0 = Loop forever, 1 = Play once
Return:

{i} D_PlayInsanityEffectController ({s} DOBName)
Description:
Tells the specified INSANITYEFFECTCONTROLLER DOB to play its animation. Different effects can be achieved by creating different INSANITYEFFECTCONTROLLER DOBs and using different IOT files for each. You can specify more than one effect to be triggered by a controller DOB. The IOT files specified in the DOB determine the length of time the animation lasts (taken from the maximum IOT length) and the magnitude of each specified effect in the list at any given time
ParameterDescription
DOBName: Specifies which INSANITYEFFECTCONTROLLER DOB to play
Return:
No return value

{i} D_PlayKfAnimationLoop ({s} DobName, {i} Loop Type, {i} Start Frame, {i} End Frame)
Description:
Locates the named DOB which should be of type DOBKfAnimation, and sets the animations loop type. Note: calling this will restart the anim if playing.
ParameterDescription
DobName: Name of the KfAnimation DOB to begin playing
Loop Type: Loop Type - 0 = Play once, 1 = Loop Animation.
Start Frame: Frame to start animation on.
End Frame: Frame to end animation on.
Return:

{i} D_PlayKfAnimationMulti ({s} DOBName, {i} AnimNum)
Description:
Tells the named KFANIMATIONMULTI DOB to play the numbered animation provided. If an animation is already playing a very fast blend will occur to the new animation
ParameterDescription
DOBName: Name of the KFANIMATIONMULTI DOB to tell to play
AnimNum: Index of the animation to play. 0 is the first item (nItems-1 is the last)
Return:
No return value

{i} D_PlayKfAnimation ({s} DobName)
Description:
Locates the named DOB which should be of type DOBKfAnimation, and sets the animation to play from the beginning. N.B. This command cannot be used to resume a paused KFANIMATION DOB. See D_PauseKfAnimation for more details on how to do this
ParameterDescription
DobName: Name of the KfAnimation DOB to begin playing
Return:

{i} D_PlaySoundAmbient ({s} SoundName, {f} Volume, {i} NumLoops)
Description:
Plays an ambient sound which has no positional information and is at a constant volume regardless of the players location
ParameterDescription
SoundName: Filename of the sound to play. Relative to the cthulhu alpha folder
Volume: In the range 0.0 to 1.0
NumLoops: 0 = Loop forever, 1 = Play once
Return:
Returns an integer representing a handle to the sound for use with D_StopSound and the pitch shifting / volume functions

{i} D_PlaySoundAmbientFadeWait ({i} SoundCue, {f} StartVolume, {f} EndVolume, {f} Interpolate, {i} NumLoops)
Description:
Plays an ambient sound, fading from the start volume to the end volume. If the volume ends at 0, then the sound will end.
ParameterDescription
SoundCue: The numerical index of the sound.
StartVolume: Volume the sound starts out. Valid range 0.0 - 1.0.
EndVolume: Volume the sound ends at. Valid range 0.0 - 1.0.
Interpolate: Time required to interpolate between the start and end volume, in seconds.
NumLoops: The number of times the sound loops by, 0 = loops infinatly.
Return:
Returns a handle to the sound.

{i} D_PlaySoundAmbientFade ({i} SoundCue, {f} StartVolume, {f} EndVolume, {f} Interpolate, {i} NumLoops)
Description:
Plays an ambient sound, fading from the start volume to the end volume. If the volume ends at 0, then the sound will end.
ParameterDescription
SoundCue: The numerical index of the sound.
StartVolume: Volume the sound starts out. Valid range 0.0 - 1.0.
EndVolume: Volume the sound ends at. Valid range 0.0 - 1.0.
Interpolate: Time required to interpolate between the start and end volume in seconds.
NumLoops: The number of times the sound loops by, 0 = loops infinatly.
Return:
Returns a handle to the sound.

{i} D_PlaySoundAmbientWait ({s} SoundName, {f} Volume, {i} NumLoops)
Description:
Plays an ambient sound which has no positional information and is at a constant volume regardless of the players location and does not continue to the next script command until the sound has finished playing
ParameterDescription
SoundName: Filename of the sound to play. Relative to the cthulhu alpha folder
Volume: In the range 0.0 to 1.0
NumLoops: 0 = Loop forever, 1 = Play once
Return:
Returns an integer representing a handle to the sound for use with D_StopSound and the pitch shifting / volume functions

{i} D_PlaySoundFadeObject ({i} SoundCue, {i} ObjectID, {f} StartVolume, {f} EndVolume, {f} Interpolate, {i} NumLoops, {f} Range)
Description:
Plays a positional sound which tracks the specified object.
ParameterDescription
SoundCue: The numerical index of the sound.
ObjectID: The Object which the sound will be attached to.
StartVolume: Volume the sound starts out. Valid range 0.0 - 1.0.
EndVolume: Volume the sound ends at. Valid range 0.0 - 1.0.
Interpolate: Time required to interpolate between the start and end volume, in seconds.
NumLoops: The number of times the sound loops by, 0 = loops infinatly.
Range: The audiable range of the sound.
Return:
Returns a handle to the sound.

{i} D_PlaySoundFadeObjectWait ({i} SoundCue, {i} ObjectID, {f} StartVolume, {f} EndVolume, {f} Interpolate, {i} NumLoops, {f} Range)
Description:
Plays a positional sound which tracks the specified object, the script will wait until the sound finishes.
ParameterDescription
SoundCue: The numerical index of the sound.
ObjectID: The Object which the sound will be attached to.
StartVolume: Volume the sound starts out. Valid range 0.0 - 1.0.
EndVolume: Volume the sound ends at. Valid range 0.0 - 1.0.
Interpolate: Time required to interpolate between the start and end volume in seconds.
NumLoops: The number of times the sound loops by, 0 = loops infinatly.
Range: The audiable range of the sound.
Return:
Returns a handle to the sound.

{i} D_PlaySoundObjectWait ({s} SoundName, {s} ObjectName, {f} Volume, {f} MaxRange, {i} NumLoops)
Description:
Plays a positional sound specified by filename at the location of the named object, tracking the object if it moves and does not continue to the next script command until the sound has finished playing
ParameterDescription
SoundName: Filename of the sound to play. Relative to the cthulhu alpha folder
ObjectName: Name of the scene graph node to track. This sound will be emitted from the objects origin
Volume: In the range 0.0 to 1.0
MaxRange: Maximum range at which the sounds volume first becomes 0
NumLoops: 0 = Loop forever, 1 = Play once
Return:
Returns an integer representing a handle to the sound for use with D_StopSound and the pitch shifting / volume functions

{i} D_PlaySoundObject ({s} SoundName, {s} ObjectName, {f} Volume, {f} MaxRange, {i} NumLoops)
Description:
Plays a positional sound specified by filename at the location of the named object, tracking the object if it moves
ParameterDescription
SoundName: Filename of the sound to play. Relative to the cthulhu alpha folder
ObjectName: Name of the scene graph node to track. This sound will be emitted from the objects origin
Volume: In the range 0.0 to 1.0
MaxRange: Maximum range at which the sounds volume first becomes 0
NumLoops: 0 = Loop forever, 1 = Play once
Return:
Returns an integer representing a handle to the sound for use with D_StopSound and the pitch shifting / volume functions

{i} D_PlaySoundPositional ({s} SoundName, {p} Position, {f} Volume, {f} MaxRange, {i} NumLoops)
Description:
Plays a positional sound specified by filename at the location provided
ParameterDescription
SoundName: Filename of the sound to play. Relative to the cthulhu alpha folder
Position: Point value specifying the world space location from which the sound is emitted
Volume: In the range 0.0 to 1.0
MaxRange: Maximum range at which the sounds volume first becomes 0
NumLoops: 0 = Loop forever, 1 = Play once
Return:
Returns an integer representing a handle to the sound for use with D_StopSound and the pitch shifting / volume functions

{i} D_PlaySoundPositionalFade ({i} SoundCue, {p} Position, {f} StartVolume, {f} EndVolume, {f} Interpolate, {i} NumLoops, {f} Range)
Description:
Plays a positional sound.
ParameterDescription
SoundCue: The numerical index of the sound.
Position: The Object which the sound will be attached to.
StartVolume: Volume the sound starts out. Valid range 0.0 - 1.0.
EndVolume: Volume the sound ends at. Valid range 0.0 - 1.0.
Interpolate: Time required to interpolate between the start and end volume, in seconds.
NumLoops: The number of times the sound loops by, 0 = loops infinatly.
Range: The audiable range of the sound.
Return:
Returns a handle to the sound.

{i} D_PlaySoundPositionalFadeWait ({i} SoundCue, {p} Position, {f} StartVolume, {f} EndVolume, {f} Interpolate, {i} NumLoops, {f} Range)
Description:
Plays a positional sound, the script will wait until the sound finishes.
ParameterDescription
SoundCue: The numerical index of the sound.
Position: The Location which the sound will eminate from.
StartVolume: Volume the sound starts out. Valid range 0.0 - 1.0.
EndVolume: Volume the sound ends at. Valid range 0.0 - 1.0.
Interpolate: Time required to interpolate between the start and end volume in seconds.
NumLoops: The number of times the sound loops by, 0 = loops infinatly.
Range: The audiable range of the sound.
Return:
Returns a handle to the sound.

{i} D_PlaySoundPositionalWait ({s} SoundName, {p} Position, {f} Volume, {f} MaxRange, {i} NumLoops)
Description:
Plays a positional sound specified by filename at the location provided and does not continue to the next script command until the sound has finished playing
ParameterDescription
SoundName: Filename of the sound to play. Relative to the cthulhu alpha folder
Position: Point value specifying the world space location from which the sound is emitted
Volume: In the range 0.0 to 1.0
MaxRange: Maximum range at which the sounds volume first becomes 0
NumLoops: 0 = Loop forever, 1 = Play once
Return:
Returns an integer representing a handle to the sound for use with D_StopSound and the pitch shifting / volume functions

{f} D_PlayStandardCameraAnimation ({i} AnimationIndex, {i} ReturnToBase)
Description:
Plays one of the stock camera animations loaded for use in every level and optionally returns to playing the looping base animation that is currently active. See a coder for a list of these indexes
ParameterDescription
AnimationIndex: Index of the animation to play. 0 - caNone, 1 - caWalk, 2 - caInjuredWalk, 3 - caRun, 4 - caBreathLight, 5 - caBreathHeavy, 6 - caShakeHead, 7 - caHitFront, 8 - caDeath, 9 - caShoot, 10 - caJump, 11 - caAimShoot, 12 - caLandingNormal, 13 - caLandingHeavy, 14 - caVertigo
ReturnToBase: 1 = Return to looping base animation when finished, 0 = Do not return to base animation
Return:
Returns the duration of the animation in seconds

{i} D_PlayerApplyDamage ({s} ZoneName, {s} WeaponName, {f} DamageLevel)
Description:
Simulates the player being hit in the specified body part with the specified weapon and casuing the specified damage. The player can be killed using this command by passing in a zone of “head” with any weapon and a large damage I,e, 1.0. A damage level of 1.0 is the damage required to kill the player if he is 100 6.139378e-318althy. 0.0 is the min, 1.0 is the max
ParameterDescription
ZoneName: Name of the body part that is to be hit. This can be: 'head', 'torso', 'leftarm', 'rightarm', 'leftleg', 'rightleg'
WeaponName: The weapon that is used to hit the player. This can be: 'crowbar', 'nightstick', 'knife', 'spear', 'lantern', 'bayonet', 'leadpipe', 'claws', 'fist', 'coltrevolver', 'coltsemi', 'mauserpistol', 'shotgundouble', 'shotgundoublesawn', 'shotgunpump', 'springfieldrifle', 'elephantgun', 'browningrifle', 'tommygun', 'lewisgun', 'grenade', 'lightninggun', 'shipmountedgun', 'flamethrower'
DamageLevel: Damage level, in range 0.0 to 1.0
Return:

{i} D_PlayerApplyForce ({p} Direction, {f} Magnitude)
Description:
Applys a force to the players physics rep. This will allow explosions and scenery movements to be simulated.
ParameterDescription
Direction: A vector representing the direction in which to apply the force. This will be unitized by the code
Magnitude: The magnitude of the force to apply in the specified direction
Return:
No return value

{i} D_PlayerApplyImpulse ({p} Direction, {f} Magnitude)
Description:
Applys a momentary force to the players physics rep. This will allow explosions and scenery movements to be simulated.
ParameterDescription
Direction: A vector representing the direction in which to apply the force. This will be unitized by the code
Magnitude: The magnitude of the force to apply in the specified direction
Return:
No return value

{i} D_PlayerCrouch ()
Description:
Causes the player to enter crouch mode. The player will be able to toggle back to stand unless the script locks their movement using one of the provided commands
ParameterDescription
Return:

{f} D_PlayerGlance ({s} StartIom, {s} EndIom, {f} WaitTime, {f} AngularVelocity, {q} Direction)
Description:
Causes the player camera to glance in the specified direction. The system uses the StartIom to determine the rate at which to interpolate to face in the direction and the EndIom to determine the rate at which to interpolate to the start direction. The WaitTime specifies the length of time to stay looking in the specified direction in between the two interpolations. If the two IOMs do not join together, an interpolation will occur to ensure a smooth match. This interpolation occurs during the wait time
ParameterDescription
StartIom: The input processor module to use to interpolate from the current camera facing to the desired glance direction
EndIom: The input processor module to use to interpolate from the glance direction back to the original facing
WaitTime: Length of time to hold the glance in the specified direction
AngularVelocity: Angular velocity to rotate at (average)
Direction: Direction to glance in
Return:
The duration of the entire glance animation including the wait time

{f} D_PlayerGlanceAtCharacter ({s} StartIom, {s} EndIom, {f} WaitTime, {f} AngularVelocity, {s} Character)
Description:
Causes the player camera to glance in the direction of the specified character. The system uses the StartIom to determine the rate at which to interpolate to face in the direction and the EndIom to determine the rate at which to interpolate to the start direction. The WaitTime specifies the length of time to stay looking in the specified direction in between the two interpolations. If the two IOMs do not join together, an interpolation will occur to ensure a smooth match. This interpolation occurs during the wait time
ParameterDescription
StartIom: The input processor module to use to interpolate from the current camera facing to the desired glance direction
EndIom: The input processor module to use to interpolate from the glance direction back to the original facing
WaitTime: Length of time to hold the glance in the specified direction
AngularVelocity: Angular velocity to rotate at (average)
Character: Character to glance at. This character will be tracked over the duration of the glance
Return:
The duration of the entire glance animation including the wait time

{f} D_PlayerGlanceAtObject ({s} StartIom, {s} EndIom, {f} WaitTime, {f} AngularVelocity, {s} Object)
Description:
Causes the player camera to glance in the direction of the specified object. The system uses the StartIom to determine the rate at which to interpolate to face in the direction and the EndIom to determine the rate at which to interpolate to the start direction. The WaitTime specifies the length of time to stay looking in the specified direction in between the two interpolations. If the two IOMs do not join together, an interpolation will occur to ensure a smooth match. This interpolation occurs during the wait time
ParameterDescription
StartIom: The input processor module to use to interpolate from the current camera facing to the desired glance direction
EndIom: The input processor module to use to interpolate from the glance direction back to the original facing
WaitTime: Length of time to hold the glance in the specified direction
AngularVelocity: Angular velocity to rotate at (average)
Object: Object to glance at. This object will be tracked over the duration of the glance
Return:
The duration of the entire glance animation including the wait time

{i} D_PlayerGlideNoRotate ({p} Position, {f} T)
Description:
Animates the camera location to that specified. Can be used to interpolate over any duration of time. A time of 0.0 causes a teleport with no interpolation. The camera rotation will remain unchanged
ParameterDescription
Position: Position to move the camera to
T: Length of time to interpolate over. 0.0 to teleport without interpolation
Return:

{i} D_PlayerGlide ({p} Position, {f} X, {f} Y, {f} Z, {f} W, {f} T)
Description:
Animates the camera location and rotation to those specified. Can be used to interpolate over any duration of time. A time of 0.0 causes a teleport with no interpolation
ParameterDescription
Position: Position to move the camera to
X: X component of the quaternion defining the cameras rotation
Y: Y component of the quaternion defining the cameras rotation
Z: Z component of the quaternion defining the cameras rotation
W: W component of the quaternion defining the cameras rotation
T: Length of time to interpolate over. 0.0 to teleport without interpolation
Return:

{i} D_PlayerGlideToDob ({s} DOB Name)
Description:
Causes the player camera to glide to the named GLIDELOCATION DOB. This allows accurate positioning of a glide target by artists. This has the exact same effect as using D_PlayerGlide or D_PlayerGlideNoRotate (depending on the settings in the DOB) but takes the position and rotation information from the DOB itself
ParameterDescription
DOB Name: Name of the GLIDELOCATION DOB to glide to
Return:
Return value has no meaning

{i} D_PlayerLockMoveAndRotate ()
Description:
Prevents the player from moving or looking around
ParameterDescription
Return:

{i} D_PlayerLockMove ()
Description:
Prevents the player from moving, while still allowing them to look around
ParameterDescription
Return:
No return value

{i} D_PlayerLockToNode ({s} Node Name)
Description:
Attaches the player to a node. The player will maintain the same relative position to the object as it moves, the player will be able to rotate the view but the position will be determined by the object
ParameterDescription
Node Name: Name of the node to attach to
Return:
No return value

{i} D_PlayerLookAtObject ({s} ObjectName, {f} Time)
Description:
Animates the camera facing over the specified time to face the origin of the named object.
ParameterDescription
ObjectName: Name of the object to look at
Time: Length of time to interpolate for
Return:

{i} D_PlayerLookAtPoint ({p} Point, {f} Time)
Description:
Animates the camera facing over the specified time to face the origin of the named object.
ParameterDescription
Point: World location to rotate the camera to look at
Time: Length of time to interpolate for
Return:

{f} D_PlayerMoveExt ({s} IomName, {p} Destination, {f} Speed)
Description:
Moves the player camera at the specified average speed (in cm per second) towards the specified position. The time taken is returned, it is calculated by dividing the distance from the players current location by the specified speed. The time value is then run through the named input processor to calculate the current proportion of the way along the path
ParameterDescription
IomName: Name of an IOM file to be used. This must be first registered using D_RegisterIoModule(...). This is the name passed to this function not the filename
Destination: The destination location for the camera to reach
Speed: The desired average speed for the camera to move at in cm per second
Return:
Returns the length of time this interpolation will take at the specified speed

{f} D_PlayerNod ({i} NumTimes)
Description:
Causes the player camera to 'nod' the number of times specified This is simulating the player indicating 'YES' through head movements
ParameterDescription
NumTimes: Number of times for the player to nod in a row
Return:

{i} D_PlayerReleaseWatch ()
Description:
Cancels calls to D_PlayerWatchNpc or D_PlayerWatchObject when called with the Track parameter set to 1
ParameterDescription
Return:

{f} D_PlayerRotateExt ({s} IomName, {q} Rotation, {f} AngularVelocity, {i} ProportionalSpeed)
Description:
Rotates the player camera at the specified angular velocity towards the specified rotation. The time taken is returned, it is calculated by dividing the angle from the players current rotation by the specified angular velocity. The time value is then run through the named input processor to calculate the current proportion of the way through the rotation
ParameterDescription
IomName: Name of an IOM file to be used. This must be first registered using D_RegisterIoModule(...). This is the name passed to this function not the filename
Rotation: The destination rotation for the camera to reach
AngularVelocity: The desired average angular velocity for the camera to rotate at
ProportionalSpeed: If this value is 1, the angle is square rooted before calculating the duration. This will require larger values, but the result is that the further view must be rotated, the faster the view will rotate
Return:
Returns the length of time this interpolation will take at the specified angular velocity

{f} D_PlayerShake ({i} NumTimes)
Description:
Causes the player camera to 'shake' the number of times specified. This is simulating the player indicating 'NO' through head movements
ParameterDescription
NumTimes: Number of times for the player to shake in a row
Return:

{i} D_PlayerStand ()
Description:
Causes the player to leave crouch mode (if active). The player will be able to toggle back to crouch unless the script locks their movement using one of the provided commands
ParameterDescription
Return:

{i} D_PlayerTeleport ({p} Position, {f} X, {f} Y, {f} Z, {f} W)
Description:
Instantly transports the camera location to that specified. The camera rotation will be set to the specified quaternion
ParameterDescription
Position: Position to move the camera to
X: X component of the quaternion defining the cameras rotation
Y: Y component of the quaternion defining the cameras rotation
Z: Z component of the quaternion defining the cameras rotation
W: W component of the quaternion defining the cameras rotation
Return:

{i} D_PlayerUnlock ()
Description:
Unlocks the player, allowing them to both move and look around again
ParameterDescription
Return:

{i} D_PlayerWatchNpc ({s} CharacterName, {i} Track, {s} IomName)
Description:
Causes the player camera to rotate to face the head of the named character, and optionally continue to watch it until instructed not to using D_PlayerReleaseWatch(). The character name is the one specified by SetStausString in the startup script of each character
ParameterDescription
CharacterName: Name of the scene graph node to look at
Track: 1 to have the player continue looking at the character if he or the object moves. 0 To rotate to look in the direction the character is at at the time of calling the function, but not track it
IomName: Name of a registered IO module to control the speed of rotation at a given angle or error
Return:

{i} D_PlayerWatchObject ({s} ObjectName, {i} Track, {s} IomName)
Description:
Causes the player camera to rotate to face the origin of the named object, and optionally continue to watch it until instructed not to using D_PlayerReleaseWatch()
ParameterDescription
ObjectName: Name of the scene graph node to look at
Track: 1 to have the player continue looking at the object if he or the object moves. 0 To rotate to look in the direction the object is at at the time of calling the function, but not track it
IomName: Name of a registered IO module to control the speed of rotation at a given angle or error
Return:

{p} D_PointAdd ({p} Point1, {p} Point2)
Description:
Adds the two point together and returns the result
ParameterDescription
Point1: The first point to be added
Point2: The second point to be added
Return:
Returns Point1 + Point2

{f} D_PointGetX ({p} Point)
Description:
Returns the x component of the specified point
ParameterDescription
Point: The point from which to extract the x value
Return:
Returns the points x component

{f} D_PointGetY ({p} Point)
Description:
Returns the y component of the specified point
ParameterDescription
Point: The point from which to extract the y value
Return:
Returns the points y component

{f} D_PointGetZ ({p} Point)
Description:
Returns the z component of the specified point
ParameterDescription
Point: The point from which to extract the z value
Return:
Returns the points z component

{p} D_PointSetX ({p} Point, {f} Value)
Description:
Sets the x value of the point provided to the specified floating point value and returns the result as a new point
ParameterDescription
Point: The point whos x value should be set
Value: The new x value for the point
Return:
Returns the resulting point after the x value has been set

{p} D_PointSetY ({p} Point, {f} Value)
Description:
Sets the y value of the point provided to the specified floating point value and returns the result as a new point
ParameterDescription
Point: The point whos y value should be set
Value: The new y value for the point
Return:
Returns the resulting point after the y value has been set

{p} D_PointSetZ ({p} Point, {f} Value)
Description:
Sets the z value of the point provided to the specified floating point value and returns the result as a new point
ParameterDescription
Point: The point whos z value should be set
Value: The new z value for the point
Return:
Returns the resulting point after the z value has been set

{p} D_PointSubtract ({p} Point1, {p} Point2)
Description:
Subtracts the second point from the first and then returns the result
ParameterDescription
Point1: The first point
Point2: The second point (subtracts this from Point1)
Return:
Returns Point1 - Point2

{i} D_Print ({s} Text)
Description:
Display text in the output window and console window if one exists
ParameterDescription
Text: Text to display in the output window and console
Return:

{i} D_Quit ()
Description:
Quits the game immediately. To be used only for exhibition builds
ParameterDescription
Return:
No return value

{i} D_RainEnable ({s} Rain Dob name, {i} Enable)
Description:
Sets the opening time of the Given Door.
ParameterDescription
Rain Dob name: Name of the Rain dob to be Enabled
Enable: 0 = Rain Off, 1 = Rain On
Return:
No return value

{i} D_RainReset ({s} Rain Dob name)
Description:
Sets the opening time of the Given Door.
ParameterDescription
Rain Dob name: Name of the Rain dob to be Enabled
Return:
No return value

{i} D_RainSetPlayerInside ({s} RainDOBName, {i} IsInternal)
Description:
Tells the rain system that the player is in an internal location. This should be used if the player starts inside on level start up, or the player is teleported to an internal location when it is raining.
ParameterDescription
RainDOBName: Name of the Rain dob to be Enabled
IsInternal: 1 = Player is in an internal location, 0 = Player is in an external location
Return:
No return value

{i} D_RattleBreakableDoor ({s} DobName)
Description:
Tells the named breakable door DOB to play its rattle animation. This does not effect the break stage and can be played at any stage
ParameterDescription
DobName: Name of the breakable door DOB to rattle. The named DOB must be a breakable door, this function will not work for normal dob doors or any other type
Return:

{i} D_RegisterIoModule ({s} IomName, {s} Filename)
Description:
Loads the specified IO module file from disk and adds it to a lookup table for retrieval later. This can be used on its own or the name can be passed to certain other functions such as D_PlayerRotateExt
ParameterDescription
IomName: Identifying name to be assigned to this IOM in the lookup table. This is then used by D_GetIomValue(...)
Filename: The name of the IOM file to load. Specified relative to the engine folder (usually ../IOFiles/SubFolder/File.iom)
Return:
No return value

{i} D_ReleaseEffect ({s} EffectName)
Description:
Releases the named effect if it has been forced using the command D_ForceEffect(). This will allow the automatic managers (i.e. insanity manager) to again adjust the values of this effect and trigger incompatible effects again
ParameterDescription
EffectName: Name of the effect to release control of. Currently supported names are: 'Muttering', 'Blurred Vision' and 'Tinitus'.
Return:

{i} D_ReleaseViewRestriction ()
Description:
Cancels any view restriction that has been applied
ParameterDescription
Return:
No return value

{i} D_ReloadWeapon ({s} WeaponName)
Description:
Reloads the named player weapon if possible given the players current inventory items
ParameterDescription
WeaponName: Name of the weapon to add. For a list of weapon names see D_PlayerApplyDamage
Return:

{i} D_RemoveAllOfItem ({i} ItemName)
Description:
Removes all the items of the named type from the players inventory
ParameterDescription
ItemName: Type of item to remove all of
Return:

{i} D_RemoveAllResumeEvents ()
Description:
Removes all the resume events for this virtual machine only
ParameterDescription
Return:

{i} D_RemoveEvent ({s} EventName)
Description:
Removes an event which will ensure it is never triggered
ParameterDescription
EventName: Name of the event to remove
Return:

{i} D_RemoveExtendedArmAnimations ()
Description:
Unloads all the extended arm animations loaded using D_AddArmAnimation()
ParameterDescription
Return:

{i} D_RemoveExtendedCameraAnimations ()
Description:
Unloads all the extended camera animations loaded using D_AddCameraAnimation()
ParameterDescription
Return:

{i} D_RemoveResumeEvent ({s} EventName)
Description:
Removes the named resume event so that it may no longer resume this virtual machine
ParameterDescription
EventName: Name of the resume event to remove
Return:

{i} D_RestrictViewAngleToCharacterDirection ({s} CharacterName, {f} ToleranceAngle)
Description:
Restricts the players viewing angle to the quaternion which indicates the direction to the named characters head, plus a cone which extends the specified number of degrees in every direction from the specified quaternion. An angle of 10 degrees will be 10 degrees every side of the quaternion, giving a 20 degree total cone width. If the player is currently not looking within this cone, the view will be rotated automatically using the same functionality as the D_PlayerWatchNpc function. WARNING: If the specified cone is very small it is possible that the view may never rotate to the specified direction depending on the settings of the IOM file for the watch controller. The Character will be tracked, and hence the restriction will move
ParameterDescription
CharacterName: Name of the character to rotate to track and restrict to
ToleranceAngle: The angle in any direction by which the view cone may deviate from the specified angle
Return:
No return value

{i} D_RestrictViewAngleToObjectDirection ({s} ObjectName, {f} ToleranceAngle)
Description:
Restricts the players viewing angle to the quaternion which indicates the direction to the named object, plus a cone which extends the specified number of degrees in every direction from the specified quaternion. An angle of 10 degrees will be 10 degrees every side of the quaternion, giving a 20 degree total cone width. If the player is currently not looking within this cone, the view will be rotated automatically using the same functionality as the D_PlayerWatchNpc function. WARNING: If the specified cone is very small it is possible that the view may never rotate to the specified direction depending on the settings of the IOM file for the watch controller. The Object will be tracked, and hence the restriction will move
ParameterDescription
ObjectName: Name of the object to rotate to track and restrict to
ToleranceAngle: The angle in any direction by which the view cone may deviate from the specified angle
Return:
No return value

{i} D_RestrictViewAngle ({q} Direction, {f} ToleranceAngle)
Description:
Restricts the players viewing angle to the specified quaternion, plus a cone which extends the specified number of degrees in every direction from the specified quaternion. An angle of 10 degrees will be 10 degrees every side of the quaternion, giving a 20 degree total cone width. If the player is currently not looking within this cone, the view will be rotated automatically using the same functionality as the D_PlayerWatchNpc function. WARNING: If the specified cone is very small it is possible that the view may never rotate to the specified direction depending on the settings of the IOM file for the watch controller
ParameterDescription
Direction: Viewing angle to restrict to. This is the centre of the cone specified by the angle
ToleranceAngle: The angle in any direction by which the view cone may deviate from the specified angle
Return:
No return value

{i} D_RigidBodyApplyImpulse ({s} DobName, {p} WorldPoint, {p} Impulse)
Description:
Applies an impulse to the named rigid body DOB in the specified direction and at the specified location. The magnitude of the impulse is determined by the length of the Impulse vector
ParameterDescription
DobName: Name of the static physics DOB to adjust
WorldPoint: The world location representing the point at which the force is applied. Need not necessarily be a point on the object
Impulse: Vector representing the direction and magnitude of the impulse to apply
Return:

{i} D_RigidBodyShow ({s} DobName, {i} Show)
Description:
Makes the visible object for the named rigid body DOB to visible or invisible depending on the specified value
ParameterDescription
DobName: Name of the rigid body DOB to show / hide
Show: 1 = Show the object, 0 = Hide the object
Return:

{i} D_RunGameScript ({s} ScriptName)
Description:
Runs the game script with the specified name on a new virtual machine
ParameterDescription
ScriptName: Name of the gamescript to run. This should be an hfs file and must include the file extension. The file must reside in a subdirectory of the 'cthulhu alpha\gamescript' folder or in the folder itself. E.g. To run the script: 'c:\cthulhu alpha\gamescripts\Jailhouse\Test.cpp', the call would be D_RunGameScript('Jailhouse\Test.cpp');
Return:

{i} D_SceneryMorphEnable ({s} Dob name, {i} Enable)
Description:
Turns the selected scenery morphing animation on or off.
ParameterDescription
Dob name: The name of the Scenery Morph DOB
Enable: 1 = Enabled, 0 = Disabled.
Return:
No return value

{i} D_SceneryMorphResetTime ({s} Dob name)
Description:
Resets the morphing animation time index back to the start time specified.
ParameterDescription
Dob name: The name of the Scenery Morph DOB
Return:
No return value

{i} D_SceneryMorphSetEndTime ({s} Dob name, {f} End time)
Description:
Sets the end time for the morphing animation.
ParameterDescription
Dob name: The name of the Scenery Morph DOB
End time: Time at which the animation will start, looping animations end at this time.
Return:
No return value

{i} D_SceneryMorphSetLooping ({s} Dob name, {i} Play type)
Description:
The morphing animation can either be looping or play through once..
ParameterDescription
Dob name: The name of the Scenery Morph DOB
Play type: 0 = looping, 1 = Play through once.
Return:
No return value

{i} D_SceneryMorphSetStartTime ({s} Dob name, {f} Start time)
Description:
Sets the start time for the morphing animation.
ParameterDescription
Dob name: The name of the Scenery Morph DOB
Start time: Time at which the animation will start, looping animations restart at this time.
Return:
No return value

{i} D_SetAllGlobalFloatArrayEntries ({s} VariableName, {f} FloatValue)
Description:
Sets all elements of the named Float array to the specified value
ParameterDescription
VariableName: Name of the array variable to set the values to
FloatValue: Value to set to every element of the named array
Return:
No return value

{i} D_SetAllGlobalIntArrayEntries ({s} VariableName, {i} IntValue)
Description:
Sets all elements of the named Int array to the specified value
ParameterDescription
VariableName: Name of the array variable to set the values to
IntValue: Value to set to every element of the named array
Return:
No return value

{i} D_SetAllGlobalPointArrayEntries ({s} VariableName, {p} PointValue)
Description:
Sets all elements of the named point array to the specified value
ParameterDescription
VariableName: Name of the array variable to set the values to
PointValue: Value to set to every element of the named array
Return:
No return value

{i} D_SetCameraShakeMagnitudeMultiplier ({s} DOBName, {f} Magnitude, {f} Time)
Description:
Sets the magnitude constant of the specified CAMERASHAKE DOB to the specified value, this does not take effect immediately (unless Time is passed as 0.0) DOB interpolates from the current value to the specified value over the specified time
ParameterDescription
DOBName: Specifies which CAMERASHAKE DOB to set the magnitude for
Magnitude: Usually a value between 0.0 and 1.0 although it can be bigger than 1.0 and possibly smaller than 0.0
Time: The current magnitude will be interpolated to the specified magnitude over this amount of time (in seconds)
Return:
No return value

{i} D_SetClearBackbuffer ({i} Clear)
Description:
Switches backbuffer clearing on or off
ParameterDescription
Clear: 1 = Clear backbuffer, 0 = don't clear backbuffer
Return:
No return value

{i} D_SetDebugLightBrightness ({f} Brightness, {v} noname)
Description:
Sets the brightness of the scene debug light. If the light does not exist it is created. If the brightness is less than 0.0001 the light will be removed entirely from the scene graph and will no longer have any effect at all.
ParameterDescription
Brightness: The desired brightness of the debug light. A large number such as 100000 will ensure everything in the scene is visible. To remove the light call this function with a brightness of 0.0
:
Return:
No return value

{i} D_SetDebugRadioFrequency ({f} Frequency)
Description:
Tunes the debug radio to listen to the specified frequency. Any messages sent on this frequency will then be displayed in the debug radio view of the on screen info
ParameterDescription
Frequency: Floating point number representing the frequency to tune to. This must match exactly the desired output values
Return:
No return value

{i} D_SetDobBool ({s} DobName, {s} PropName, {i} TrueFalse)
Description:
Sets the specified property on the specified DOB to the specified boolean value. There is no error checking, it is the responsibility of the scripter to ensure the property being set is indeed of the correct type
ParameterDescription
DobName: Name of the DOB to set the property in
PropName: Name of the property to set the value of
TrueFalse: Value to set to. 1 for true, 0 for false
Return:

{i} D_SetDobFloat ({s} DobName, {s} PropName, {f} Value)
Description:
Sets the specified property on the specified DOB to the specified floating point value. There is no error checking, it is the responsibility of the scripter to ensure the property being set is indeed of the correct type
ParameterDescription
DobName: Name of the DOB to set the property in
PropName: Name of the property to set the value of
Value: Value to set to
Return:

{i} D_SetDobInt ({s} DobName, {s} PropName, {i} Value)
Description:
Sets the specified property on the specified DOB to the specified integer value. There is no error checking, it is the responsibility of the scripter to ensure the property being set is indeed of the correct type
ParameterDescription
DobName: Name of the DOB to set the property in
PropName: Name of the property to set the value of
Value: Value to set to
Return:

{i} D_SetDobPoint ({s} DobName, {s} PropertyName, {i} Value)
Description:
Sets the named property of the named DOB to the specified point value if the property is a point
ParameterDescription
DobName: Name of the DOB whos property is to be set
PropertyName: Name of the property to set
Value: Point value to set the property to have
Return:

{i} D_SetDoorAutoClose ({s} DobName, {i} AutoClose)
Description:
Sets whether or not the named DOBDOOR will close automatically when it moves out of range
ParameterDescription
DobName: Name of the DOBDOOR that is to be modified
AutoClose: 1 = Door will auto-close, 0 = Door will not auto-close
Return:

{i} D_SetDoorBoltEnable ({s} DobName, {i} Enable)
Description:
Enabled / disables the named door bolt DOB, preventing it from being actioned by the player
ParameterDescription
DobName: Name of the door bolt DOB to enable / disable
Enable: 1 = Enable the bolt, 0 = Disable it
Return:

{i} D_SetDoorBoltLock ({s} DobName, {i} Lock)
Description:
Locks / unlocks the door associated with the named door bolt DOB
ParameterDescription
DobName: Name of the door bolt DOB to lock or unlock
Lock: 1 = Lock the door, 0 = Unlock it
Return:

{i} D_SetDoorBreakStage ({s} DobName, {i} Stage)
Description:
Tells the named breakable door to play the animation associated with the specified break stage and to enter that stage. This does not play the previous animations in sequence. There are 4 break stages, 0 being 1001242624nbroken, and 3 being smashed. The named DOB must be a breakable door, this function will not work for normal dob doors or any other type
ParameterDescription
DobName: Name of the breakable door DOB to set the break stage for
Stage: Break stage to move to. In the range 0 - 3
Return:

{i} D_SetDoorForceCulled ({s} DOBName, {i} ForceCulled)
Description:
Sets the flag that forces a door DOB of any door type to be hidden. If this is set to true the door will never be visible. If this value is false, the door will be visible only if either of the two rooms it adjoins is currently visible
ParameterDescription
DOBName: Specifies which door DOB to force the cull mode of. This can be of any door type
ForceCulled: 1 = Hide door always, 0 = Door visibility determined by visibility of adjoining rooms
Return:
No return value

{i} D_SetDoorLocked ({s} DobName, {i} Lock)
Description:
Can be used to either lock or unlock a DOBDOOR with the specified name
ParameterDescription
DobName: Name of the DOBDOOR that is to be modified
Lock: 1 = Lock the door, 0 = Unlock the door
Return:

{i} D_SetDoorNextBreakStage ({s} DobName)
Description:
Tells the named breakable door DOB to advance to the next break stage. There are four beak stages, this will have no effect if the DOB is on the last stage or the next stage has no animation supplied in the DOB properties
ParameterDescription
DobName: Name of the breakable door DOB to break more
Return:

{i} D_SetDoorOpeningSpeed ({s} Door Dob name, {f} Time)
Description:
Sets the opening time of the Given Door.
ParameterDescription
Door Dob name: Name of the door dob to be affected
Time: Time to open, in seconds
Return:
No return value

{i} D_SetDoorOpen ({s} DobName, {i} Open)
Description:
Can be used to either open or close a DOBDOOR with the specified name. The function suspends the virtual machine until it knows the outcome of the command. This means the script will not continue onto the next line until either: The door successfully opens or closes (sets last return value to 1): or the door is locked (sets last return value to 0): or the door jams when opening or closing (sets the last return value to 2).
ParameterDescription
DobName: Name of the DOBDOOR that is to be modified
Open: 1 = Open the door, 0 = Close the door
Return:
Returns 0 if the door is locked, 1 if the operation succeeds or 2 if the door is jammed

{i} D_SetDoorReachTargetsEnabled ({s} DobName, {i} Enable)
Description:
Enables or disables the doors reach targets. Disabling the reach targets will prevent the player reaching for the door, or attempting to action it in any way.
ParameterDescription
DobName: Name of the door DOB to modify the reach target status for
Enable: 1 = enable the reach targets, 0 = disable them to prevent actioning
Return:
No return value

{i} D_SetGlobalFloatArrayEntry ({s} VariableName, {i} Index, {f} FloatValue)
Description:
Sets a value to one of the elements in the named global array of Float variables
ParameterDescription
VariableName: Name of the array to modify
Index: Index of the item to assign a value to
FloatValue: Value to assign to the Float variable at the specified index
Return:
No return value

{i} D_SetGlobalFloat ({s} VariableName, {f} Value)
Description:
Stores the specified floating point value in the named global variable. If the variable does not exist it is created
ParameterDescription
VariableName: Name of the float variable to store the value in
Value: Floating point value to store
Return:

{i} D_SetGlobalInt ({s} VariableName, {i} Value)
Description:
Stores the specified integer value in the named global variable. If the variable does not exist it is created
ParameterDescription
VariableName: Name of the integer variable to store the value in
Value: Integer value to store
Return:

{i} D_SetGlobalIntArrayEntry ({s} VariableName, {i} Index, {i} IntValue)
Description:
Sets a value to one of the elements in the named global array of Int variables
ParameterDescription
VariableName: Name of the array to modify
Index: Index of the item to assign a value to
IntValue: Value to assign to the Int variable at the specified index
Return:
No return value

{i} D_SetGlobalPoint ({s} VariableName, {p} Value)
Description:
Stores the specified point value in the named global variable. If the variable does not exist it is created
ParameterDescription
VariableName: Name of the point variable to store the value in
Value: Point value to store
Return:

{i} D_SetGlobalPointArrayEntry ({s} VariableName, {i} Index, {p} PointValue)
Description:
Sets a value to one of the elements in the named global array of point variables
ParameterDescription
VariableName: Name of the array to modify
Index: Index of the item to assign a value to
PointValue: Value to assign to the point variable at the specified index
Return:
No return value

{i} D_SetLanguage ({s} LanguageName)
Description:
Sets the language the game is currently running in the the named language. This will unload all resources from the current language and attempt to load the resources for the new language
ParameterDescription
LanguageName: Name of the language to set the game to
Return:

{i} D_SetLevelName ({s} LevelName)
Description:
Stores the name of the current level. This function is obsolete, the level name is calculated by the game based on the filename of the LVL file
ParameterDescription
LevelName: Name to set for the current level
Return:

{i} D_SetLightOn ({s} DOBName, {i} On)
Description:
Allows a realtime light to be switched ON or OFF. The specified DOB name must be the name of an OMNI, DIRECTIONAL, SPOT or AMBIENT DOB.
ParameterDescription
DOBName: Specifies which light DOB to switch ON or OFF
On: 1 = Switch ON, 0 = Switch OFF
Return:
No return value

{i} D_SetMaxSanity ({f} Value)
Description:
Sets the players max sanity to the specified value. The players current sanity cannot rise above the max sanity level. Any calls to D_SetSanity() will be capped at the max sanity value. The value should be in the range 0.0 to 1.0
ParameterDescription
Value: Value to set the players max sanity to
Return:

{i} D_SetNextCutScene ({s} DOBName, {s} NextDOBName)
Description:
Sets the name of the next CUTSCENE DOB for the specified CUTSCENE. This allows cut scenes to be directed fromt he script dynamically
ParameterDescription
DOBName: Name of the CUTSCENE DOB to set the next DOB for
NextDOBName: Name of the CUTSCENE DOB that should follow DOBName in the sequence
Return:
No return value

{i} D_SetNextFallFatal ({i} ForceFatality)
Description:
Sets or clears a flag indicating whether the player should die on next contact with the ground. If this value is set to 1 the player will die immediately when they next touch the ground. If this value is set to 0 the player will only die when they touch the ground if the fall was determined high enough.
ParameterDescription
ForceFatality: 1 = Next fall fatal, 0 = Next fall fatal only if drop long enough
Return:
No return value

{i} D_SetNifPriority ({s} NifName, {i} Priority)
Description:
Sets the load priority of the named NIF to the specified value. This can trigger streaming or block loading. The NIF name should be in the format 02_STREETS_ONE \ SomeNif.nif. Note that the path is assumed to be relative to the backgrounds folder, and that the specified NIF should NOT be named with the _roomgeomatry (this is added by the code)
ParameterDescription
NifName: Name of the NIF to modify the priority for
Priority: The new priority for the named NIF. This can have any of the following values:
0: NIF is not required and will be added to the unload queue
1: NIF is low priority and will be streamed in gradually (at a lower priority than any 2 / 3)
2: NIF is HIGH priority and will be streamed in before any low priority NIFs
3: NIF is required, the game will pause while the specified NIF is loaded
Return:
No return value

{i} D_SetNumberofItem ({i} ItemName, {i} NumItems)
Description:
Ensures that the players inventory contains exactly the specified number of the named item
ParameterDescription
ItemName: Type of item to set the number of
NumItems: Number of the named items to set the player inventory to contain
Return:

{i} D_SetRoomFogData ({s} Room name, {f} Near, {f} Far, {f} Proportion, {f} Red, {f} Green, {f} Blue, {i} Enable)
Description:
Sets a given rooms fog data and clipping plane data.
ParameterDescription
Room name: Name of the Room to be affected
Near: Near Clipping Plane distance - recommend 10.0
Far: Far Clipping Plane distance
Proportion: Proportion between the near and far clipping planes that the fog starts at. 1.0 starts at near clip. 0.0 starts at Far Clip
Red: Red Colour Value of Fog, between 1.0 -> 0.0
Green: Green Colour Value of Fog, between 1.0 -> 0.0
Blue: Blue Colour Value of Fog, between 1.0 -> 0.0
Enable: 1 = Clip fog enabled , 0 = Clip fog off
Return:
No return value

{i} D_SetSanity ({f} Value)
Description:
Sets the players current sanity to the specified value. This will not effect the max sanity value. The value should be in the range 0.0 to 1.0 and will be capped if it is not
ParameterDescription
Value: Value to set the players current sanity to
Return:

{i} D_SetSanityLossScale ({f} Scale)
Description:
Sets the scaling value for any sanity loss (script and AI). Any sanity loss/gain incurred is multiplied by the scale to give a new sanity loss/gain. The default value is 1 which does not change the value.
ParameterDescription
Scale: The amount to multiply the sanity loss/gain by.
Return:
No return value

{i} D_SetSanityRecoveryTime ({f} Seconds)
Description:
Sets the amount of time (in seconds) before sanity and effects are recovered. The default value is 15 second.
ParameterDescription
Seconds: The number of seconds before recovering sanity/effects.
Return:
No return value

{i} D_SetSceneAmbientColour ({f} Red, {f} Green, {f} Blue, {i} BackgroundOnly)
Description:
Sets the ambient colour of all material properties in the entire scene to the specified value. If objects are added to the scene after this call, they will not be affected by this change. If BackgroundOnly is 1 only the node will be recursed, if it is 0 the entire scene will be affected
ParameterDescription
Red: The red component of the colour (range 0 - 1)
Green: The green component of the colour (range 0 - 1)
Blue: The blue component of the colour (range 0 - 1)
BackgroundOnly: 1 to only set materials for the backgrounds, 0 to set everything in the scene
Return:
No return value

{i} D_SetSceneDiffuseColour ({f} Red, {f} Green, {f} Blue, {i} BackgroundOnly)
Description:
Sets the diffuse colour of all material properties in the entire scene to the specified value. If objects are added to the scene after this call, they will not be affected by this change. If BackgroundOnly is 1 only the node will be recursed, if it is 0 the entire scene will be affected
ParameterDescription
Red: The red component of the colour (range 0 - 1)
Green: The green component of the colour (range 0 - 1)
Blue: The blue component of the colour (range 0 - 1)
BackgroundOnly: 1 to only set materials for the backgrounds, 0 to set everything in the scene
Return:
No return value

{i} D_SetScreenColour ({f} Red, {f} Green, {f} Blue, {f} Alpha)
Description:
Sets the screen colour (ppoly in front of rendered scene) to the specified colour and transparency immediately. Useful for setting colour at the beginning of a fade in
ParameterDescription
Red: Red component of the colour to fade to (Range 0.0 to 1.0)
Green: Green component of the colour to fade to (Range 0.0 to 1.0)
Blue: Blue component of the colour to fade to (Range 0.0 to 1.0)
Alpha: Alpha component of the colour to fade to (Range 0.0 to 1.0). 0.0 is completely transparent
Return:

{i} D_SetScriptTimer ({s} TimerName, {s} ScriptName, {f} Interval, {i} TimesToTrigger)
Description:
Creates a script timer which executes the named script each time the timer elapses. The timer can be stopped by calling D_KillScriptTimer, or it can be set to operate for a given number of times. If TimesToTrigger is 0 the timer will continue triggering forever (or until D_KillScriptTimer is called). Otherwise, TimesToTrigger is the number of times that the script will be run. Interval is the time that must elapse before each time the script is run
ParameterDescription
TimerName: Name of the timer. Used to refer to the timer when using D_KillScriptTimer
ScriptName: Name of the script to run each time the timer elapses
Interval: Time in seconds to wait each time before triggering the script
TimesToTrigger: Number of times to allow the timer to elapse before deleting the timer. 0 will continue forever until D_KillScriptTimer is called
Return:

{i} D_SetSkyDomeBrightness ({f} Brightness, {f} Time)
Description:
Interpolates the brightness of the skydome over a set period of time.
ParameterDescription
Brightness: Level to set the brightness from 0 to 1.
Time: Time that the brightness change will occur over.
Return:

{i} D_SetSkyDomeEnabled ({i} Enable)
Description:
Turns off all Sky Dome processing and hides the Sky Dome.
ParameterDescription
Enable: 1 = enable and show the sky dome , 0 = disable and hide the skydome
Return:
No return value

{i} D_SetStaticPhysicsCollidable ({s} DobName, {i} PlayerCollide, {i} NpcCollide)
Description:
Makes the named static physics DOB collidable to the player, NPCs, both or neither
ParameterDescription
DobName: Name of the static physics DOB to adjust
PlayerCollide: 1 = Collide with player, 0 = Player can pass through
NpcCollide: 1 = Collide with NPCs, 0 = NPCs can pass through
Return:

{i} D_SetStaticPhysicsVisible ({s} DobName, {i} Visible)
Description:
Makes a static physics DOBs visual representation visible or hidden
ParameterDescription
DobName: Filename of the sound to play. Relative to the cthulhu alpha folder
Visible: 1 = Show the object, 0 = Hide the object
Return:

{i} D_SetTimeCompression ({f} Compression)
Description:
Sets the current time compression. This can speed up or slow down the gameplay. 1.0 will play the game at normal speed. Less than 1.0 will slow down the game, and greater than 1.0 will speed up the game. The minimum value is 0.0001, and the maximum is 10000.0, however you need not check for this as the code automatically caps the value
ParameterDescription
Compression: Sets the time compression to speed up or slow down the gameplay (or restore to normal)
1.0 – Set game to run at normal speed
0.0001– Minimum value. Set game to run super slow mo
10000.0 – Maximum value. Set game to run in ultra fast mode
Return:

{i} D_SkipDobCutScene ({s} DobName)
Description:
Stops the named cut scene DOB but if the DOB is not last in the chain the next cut scene DOB will be started. This will have no effect if the cut scene DOB named is not playing
ParameterDescription
DobName: Name of the cut scene DOB to skip playing
Return:

{i} D_StopAllGameScripts ()
Description:
Terminates all running gamescripts EXCEPT the one that calls this command (if called from a gamescript).
ParameterDescription
Return:
The return value has no meaning.

{i} D_StopCameraShake ({s} DOBName)
Description:
Tells the specified CAMERASHAKE DOB to stop its animation. The stop is immediate
ParameterDescription
DOBName: Specifies which CAMERASHAKE DOB to stop
Return:
No return value

{i} D_StopDobCutScene ({s} DobName)
Description:
Stops the named cut scene DOB and returns to the normal camera. This will have no effect if the DOB is not playing. This will NOT continue to the next DOB in the sequence, it will abort the entire sequence. To continue to the next DOB use D_SkipDobCutScene()
ParameterDescription
DobName: Name of the cut scene DOB to stop playing
Return:

{i} D_StopDobSound ({s} DobName)
Description:
Stops the sound played by the named DOB if tat sound is currently playing. Otherwise it has no effect
ParameterDescription
DobName: Name of the sound DOB that is to be stopped
Return:

{i} D_StopGameScript ({s} ScriptName)
Description:
Terminates the named gamescript if it is running. If the script is not running, nothing will happen
ParameterDescription
ScriptName: Name of the script to stop. This must match exactly the name of the script used when calling D_RunGameScript(...). For more information see D_RunGameScript. If the script is run from a DOB, then the name must match the one used in the DOB tool
Return:
The return value has no meaning.

{i} D_StopKfAnimationMulti ({s} DOBName)
Description:
Tells the named KFANIMATIONMULTI DOB to stop playing all animations
ParameterDescription
DOBName: Name of the KFANIMATIONMULTI DOB to tell to stop
Return:
No return value

{i} D_StopKfAnimation ({s} DobName)
Description:
Locates the named DOB which should be of type DOBKfAnimation, and stops the animation if playing.
ParameterDescription
DobName: Name of the KfAnimation DOB to begin playing
Return:

{i} D_StopSound ({i} Handle, {f} Interpolate)
Description:
Stops a sound that was started from script. You cannot stop DOB sounds using this command. To do this, look at function D_StopDobSound
ParameterDescription
Handle: Handle of the sound to stop. The handle is returned by the play sound functions
Interpolate: Time to interpolate the sound down to 0, setting the time to 0.0 turns the sound off instantly.
Return:

{s} D_ToStringCharacter ({c} Character)
Description:
Formats the specified character variable into a displayable string, this will basically be the characters name
ParameterDescription
Character: Character variable to convert the name of
Return:
Returns the formatted string

{s} D_ToStringFloat ({f} Float, {i} NumDecimals)
Description:
Formats the specified floating point number into a displayable string with the specified number of decimal places
ParameterDescription
Float: The number to convert into a display string
NumDecimals: Number of decimal places to display
Return:
Returns the formatted string

{s} D_ToStringInt ({i} Integer)
Description:
Formats the specified integer into a displayable string
ParameterDescription
Integer: The number to convert into a display string
Return:
Returns the formatted string

{s} D_ToStringPoint ({p} Point, {i} NumDecimals)
Description:
Formats the specified point into a displayable string, using the specified number of decimal places for each component of the point
ParameterDescription
Point: Point value to convert
NumDecimals: Number of decimal places to display
Return:
Returns the formatted string

{s} D_ToStringQuaternion ({q} Quaternion, {i} NumDecimals)
Description:
Formats the specified quaternion variable into a displayable string, using the specified number of decimal places for each component of the quaternion
ParameterDescription
Quaternion: The quaternion variable to convert into a displayable string
NumDecimals: Number of decimal places to display
Return:
Returns the formatted string

{i} D_WaitForResume ()
Description:
Suspend this script until a resume event for this script is received. Be careful with this, you could end up with your script suspended indefinately
ParameterDescription
Return:

{i} D_WaitUntilCutSceneFrame ({s} DOBName, {i} FrameNum)
Description:
Causes the calling script to be suspended until the named CUTSCENE DOB reaches the specified keyframe. Be cautious using this, because if the CUTSCENE DOB never reaches this frame the script will be permanantly suspended
ParameterDescription
DOBName: Name of the CUTSCENE DOB to wait for
FrameNum: Frame number to wait for. Note: This is converted into a time value internally and does not represent the exact frame of the animation.
Return:
No return value

{i} DeactivateCharacter ({c} CharacterToDeactivate)
Description:
In order to achieve better performance, characters can be deactivated and activated (for instance when the player is a long way away). In the deactivated state, no processing occurs on the character and its model is released, and thus can be unloaded (see UnloadModel).
ParameterDescription
CharacterToDeactivate: The character to be deactivated.
Return:

{i} DeleteCharacter ({c} Character)
Description:
Deletes an AI character. Note that the model is not automatically deleted with the AI character, and can be reused by other AI characters or unloaded.
ParameterDescription
Character: The character to be deleted.
Return:

{i} DoesCharacterExist ({s} CharacterName)
Description:
DoesCharacterExist searches through the list of currently active characters and determines whether any exist with the name given. This can be useful when deciding what to do according to which characters are still alive in the level.
ParameterDescription
CharacterName: The name of the character to determine whether exists (as set by SetStatusString on the Name status).
Return:
Returns whether the character exists (1 or 0).

{i} DoesCharacterExistEx ({s} CharacterName)
Description:
DoesCharacterExistEx searches through the list of currently active characters and determines whether any exist with the name given. This can be useful when deciding what to do according to which characters are still alive in the level. In addition this extended command only returns 1 if the character exists AND its experience StartupFinished is set to 1.0. This makes it easy for scripters to make sure they only find characters that have been fully constructed (simply set the experience StartupFinished to 1.0 at the end of the character construction).
ParameterDescription
CharacterName: The name of the character to determine whether exists (as set by SetStatusString on the Name status).
Return:
Returns whether the character exists and has finished startup(1 or 0).

{i} DropWeapon ({c} Character, {s} WeaponName)
Description:
Removes a weapon from a characters inventory. At the moment weapons do not appear on the ground after dropping. If the weapon dropped is that currently selected by the character, another weapon will be substituted. If none exists the default (fists) weapon will be selected.
ParameterDescription
Character: The character to drop the weapon.
WeaponName: See the AddWeapon command for a list of names.
Return:

{i} EndSafeBlock ()
Description:
Ends a safe block. See BeginSafeBlock for more info.
ParameterDescription
Return:

{i} ExcludeZone ({c} Character, {s} ZoneName, {i} AddOrRemove)
Description:
ExcludeZone (and SetZone) allows the user to specify exactly which waypoints in the nodemap that a character will treat as travellable. They allow characters to be limited to moving within specific areas. A character can be allowed to travel within one or more zones, and excluded from one or more zones. ExcludeZone can be used to add or remove zones from the excluded list.
ParameterDescription
Character: The character to exclude the zones on.
ZoneName: The zone to be added or removed from the exclusion list.
AddOrRemove: 1 to add this zone to the exclusion list, 0 to remove it.
Return:

{i} Exit ()
Description:
Exits and terminates the current script.
ParameterDescription
Return:

{i} FireWeaponAtCharacter ({c} Shooter, {c} Target, {s} Firing pose, {i} Whether the shot should hit the target, {i} Whether to auto apply damage if the target is hit, {s} AreaOfBodyHit, {f} Time to fire for or Rounds fired)
Description:
This command allows script writers to script action sequences without relying on the Attack command. FireWeaponAtCharacter provides more functionality than FireWeapon.. it allows different firing poses, will display bullet tracers and gunsmoke and muzzle flash, and will also optionally damage the character hit.
ParameterDescription
Shooter: The character doing the shooting.
Target: The character being shot at.
Firing pose: The type of animation used when firing. One of :
FIRE_HIGH
FIRE_LOW
FIRE_RIGHT
FIRE_LEFT
Whether the shot should hit the target: 1 is hit, 0 is miss.
Whether to auto apply damage if the target is hit: 1 is apply damage, 0 is don't.
AreaOfBodyHit: One of :
TORSO
HEAD
RIGHT_ARM
LEFT_ARM
RIGHT_LEG
LEFT_LEG
RANDOM
Time to fire for or Rounds fired: For multi-fire weapons this allows an indication of how much ammo to fire.
Return:

{i} FireWeaponAtLocation ({c} Shooter, {s} Firing pose, {f} Time to fire for or Rounds fired)
Description:
This command allows script writers to script action sequences without relying on the Attack command. FireWeaponAtLocation provides more functionality than FireWeapon.. it allows different firing poses, will display bullet tracers and gunsmoke and muzzle flash. The direction of fire must be set prior to shooting using a PointAt command.
ParameterDescription
Shooter: The character doing the shooting.
Firing pose: The type of animation used when firing. One of :
FIRE_HIGH
FIRE_LOW
FIRE_RIGHT
FIRE_LEFT
Time to fire for or Rounds fired: For multi-fire weapons this allows an indication of how much ammo to fire.
Return:

{i} FireWeapon ({f} Time, {i} WhetherHit)
Description:
FireWeapon executes the firing action of the currently selected weapon. This usually entails playing a firing animation, making a firing sound and decrementing the ammo in the weapon. This command will not apply any damage to any possible targets, and is included to allow the script writer the ability to pre-can certain action sequences.
ParameterDescription
Time: Time to fire for.
WhetherHit: Sometimes different actions can occur depending on whether a weapon fire has been judged to be successful or otherwise. This value should be set to 0 (no hit) or 1 (hit) to enable this descrimination.
Return:

{i} Follow ({c} Target, {f} Priority, {i} SpeedMode)
Description:
Creates a hard coded follow script. The hard coded script, when active forces the character state machine into follow mode. It is important to note that the follow script has a priority and will be overrided if other scripts exist at a higher priority. In follow state a character will do its best to run after a target character. It is however possible for the target character to lose the follower, by exploiting hard to navigate areas of the level. Note that if a character is told to follow a target from a different part of the level, it will instantly have knowledge of where that target is and thus be able to follow.
ParameterDescription
Target: The character to follow.
Priority: The hard coded follow script priority.
SpeedMode: 0 is walk, 1 is run.
Return:

{v} ForceSeeingCharacter ({c} Looker, {c} Target)
Description:
Enables the scripter to create the same effects as if a character had seen another character. EnteredView events will be created and thus any EventResponses to these events will be run. Note however that this command is not two way, i.e. the looker sees the target character, but the target does not see the looker.
ParameterDescription
Looker: The character who sees the other character.
Target: The character who is seen by the looking character.
Return:

{v} GetArg ()
Description:
When manually starting a script using RunScript or RunScriptEx, it is possible to pass one or more user arguments (of any type) to the newly created script. This is analagous to passing arguments to a function in another programming language. GetArg is used to pull these arguments (in order) off of the function stack.

An example is :

In the calling script :

RunScript("MyScript", 0.5, "Tree", 4);

In the new script :

String MyString;
MyString = GetArg();

ParameterDescription
Return:
Returns an argument from the function stack.

{c} GetCharacterByName ({s} Name)
Description:
Gets a pointer (reference) to the character named, if the character exists. Character pointers are used as arguments in several scripting functions.
ParameterDescription
Name: The name of the character.
Return:
Returns the pointer to the character (type Character).

{s} GetCharacterName ({c} Character)
Description:
Gets the string name of the desired character.
ParameterDescription
Character: The character to find the name of.
Return:
Returns the string name.

{f} GetDistanceFromCharacterToCharacter ({c} Character, {c} Character)
Description:
Gets the distance between two characters.
ParameterDescription
Character: The character to measure the distance from.
Character: The character to measure the distance to.
Return:
Returns the distance between in cm.

{f} GetDistanceFromCharacterToDob ({c} Character, {s} DobName)
Description:
Gets the distance between a character and a dob.
ParameterDescription
Character: The character to measure the distance from.
DobName: The Dob to measure the distance to.
Return:
Returns the distance between in cm.

{i} GetExperienceInt ({c} CharacterToGetExperienceFrom, {s} ExperienceName)
Description:
Gets the int value of a experience property attached to a character. See properties.
ParameterDescription
CharacterToGetExperienceFrom: The character to get the experience int from.
ExperienceName: The name of the experience property to get the int from.
Return:
Returns the experience int.

{s} GetExperienceString ({c} CharacterToGetExperienceFrom, {s} ExperienceName)
Description:
Gets the string value of a experience property attached to a character. See properties.
ParameterDescription
CharacterToGetExperienceFrom: The character to get the experience string from.
ExperienceName: The name of the experience property to get the string from.
Return:
Returns the experience string.

{f} GetExperience ({c} CharacterToGetExperienceFrom, {s} ExperienceName)
Description:
Gets the floating point value of an experience property attached to a character. See properties.
ParameterDescription
CharacterToGetExperienceFrom: The character to get the experience value from.
ExperienceName: The name of the experience property to get the value of.
Return:
Returns the experience value.

{v} GetLastMode ({c} Character)
Description:
This command is identicle to GetMode except that if any HC_Attack is running, it will report a 1 or 2 to indicate whether the HC_Attack is in attack or search mode respectively, regardless of whether another script is running at a higher priority than the HC_Attack. If no hard coded tasks are running it will report being in script mode (0).
ParameterDescription
Character: The character to get the last mode from.
Return:

{i} GetLastReturned ()
Description:
Some functions cannot return their result immediately to the virtual machine (on the same line of code). An example is MoveToPosition. If the move fails or succeeds the movement module will return a code to the virtual machine which can be tested by way of this function.

MoveToPosition return codes are :
0 - Path blocked
1 - Movement successful

ParameterDescription
Return:
Returns the last value returned to the Virtual Machine.

{i} GetMode ({c} Character)
Description:
Gets the mode that the character is currently in.

Modes are currently :

0 - Script controlled mode (even when no scripts running)
1 - Attack mode
2 - Search mode

ParameterDescription
Character: The character to get the current mode from.
Return:
The mode code number.

{p} GetPositionOfCharacterHead ({c} Character)
Description:
GetPositionOfCharacterHead returns the world translate xyz position of the head of the requested character.
ParameterDescription
Character: The character to get the head position of.
Return:
Returns the head position as a point.

{p} GetPositionOfCharacter ({c} Character)
Description:
GetPositionOfCharacter returns the world translate xyz position of the root node of the requested character. Note that the position of the root node usually corresponds with the position of the characters feet.
ParameterDescription
Character: The character to get the position of.
Return:
Returns the position as a point.

{s} GetRoomWithin ({c} Character)
Description:
Gets the name of the NiRoom that a character within.
ParameterDescription
Character: Which character to get the NiRoom of.
Return:
Returns the name of the NiRoom, or the string 'None' if the character is not within an NiRoom.

{f} GetStatus ({c} CharacterToGetStatusFrom, {s} StatusName)
Description:
Gets the floating point value of a status property attached to a character. See properties. Note that some of these status values (e.g. Health) are special (quickstatus values) and can be altered by the game code as well as the scripts.
ParameterDescription
CharacterToGetStatusFrom: The character to get the status value from.
StatusName: The name of the status property to get the value of.
Return:
Returns the status value.

{i} GetStatusInt ({c} CharacterToGetStatusFrom, {s} StatusName)
Description:
Gets the int value of a status property attached to a character. See properties.
ParameterDescription
CharacterToGetStatusFrom: The character to get the status int from.
StatusName: The name of the status property to get the int from.
Return:
Returns the status int.

{s} GetStatusString ({c} CharacterToGetStatusFrom, {s} StatusName)
Description:
Gets the string value of a status property attached to a character. See properties.
ParameterDescription
CharacterToGetStatusFrom: The character to get the status string from.
StatusName: The name of the status property to get the string from.
Return:
Returns the status string.

{i} IsCharInView ({c} Looker, {c} Lookee)
Description:
Determines whether a character is in view (or view memory) of the head of another character. In view memory means that although the character may not currently be in view, the amount of time specified by LostTrackOfTime has not yet expired so the character will still know where the other character is.
ParameterDescription
Looker: The character doing the looking.
Lookee: The character being looked at.
Return:
Returns :

2 - if the lookee is not in view but is in view memory
1 - if the lookee is in view
0 - if he is not in view or view memory

Note that initially a simple pick test is performed, not taking into account distance, and not taking into account the view cone. This will return 1 if no geometry is in between the two characters. If this failed, the in view table is queried to see whether the looker has a memory of seeing the lookee. This will return 2 if the lookee is still in view memory, or 0 if the lookee is not in view memory.

This means that results can sometimes be confusing when the lookee is outside the vision range of the looker. A character may thus be in view using the pick test (1) but not in view memory because it is outside the vision range.


{i} IsCharacterDead ({c} Character)
Description:
Sometimes it is useful to know whether a character is dead, for example to stop him playing new animations. IsCharacterDead returns this information.
ParameterDescription
Character: The character to be tested.
Return:
Returns 1 if the character is dead, or 0 if the character is still alive.

{i} IsCharacterMoving ({c} Character)
Description:
Finds out whether the MoveAI reports that a character is moving i.e. walking or running along a path, or standing still. Note that this command does not take into account effects from outside the MoveAI, such as physics. Thus a drowning baboon may return 0 even though it is sinking in water.
ParameterDescription
Character: The character to be checked.
Return:
Returns 1 if the character is moving, and 0 if it is standing still.

{i} IsPlayerSafe ()
Description:
Detects whether there are any enemies in the vicinity of the player. This is useful to know before entering into a conversation, to ensure that the player will not be attacked during the conversation. This is ideally used in conjunction with the PauseAllEnemies command.
ParameterDescription
Return:
Returns 1 if the player is safe, 0 if he is not.

{i} Kill ({c} Character)
Description:
When Kill is called on a character, the character is immediately deactivated, and enters dead mode. In dead mode no scripts can be run. After 20 seconds or so, the corpse will decay into the ground and the character will be permanently deleted. Note that the Kill command will not cause a death animation or dying sound to be played, the script writer is responsible for that when creating a custom death in this way.
ParameterDescription
Character: The character to be killed.
Return:

{v} ListenToSoundGroup ({c} Character, {s} SoundGroupName, {i} bListen)
Description:
Turns on or off the AI listener for a particular sound group on a character. The sound groups are defined in the file Data/AI/AI_SoundGroups.ini.
ParameterDescription
Character: The character to change the listener settings on.
SoundGroupName: The sound group to change the settings for.
bListen: Whether this sound group should be listened to or not (1 is listen, 0 is ignore).
Return:

{v} ListenToTeam ({c} Character, {i} Team, {i} bListen)
Description:
Turns on or off the AI listener for a particular team.

The teams are :

0 - Undefined (environment)
1 - Player
2 - Friendlies (to the player)
3 - Enemies (to the player)

ParameterDescription
Character: The character to change the listener settings on.
Team: The team to change the settings for.
bListen: Whether this team should be listened to or not (1 is listen, 0 is ignore).
Return:

{f} LocationSayWithoutSuspend ({p} Location, {i} SpeechCode, {f} VocalRange)
Description:
Allows a speech to be made at a location, rather than specifying a character who will make the speech. The speech code is specified outside the AI subsystem, and will determine the string which appears on screen, the sound played, and the animation played. Note that the script will not be suspended using this command (see LocationSay).
ParameterDescription
Location: The location where the speech will be made.
SpeechCode: The code determining what speech is made.
VocalRange: The distance within which the subtitle will be displayed.
Return:
Returns the time of the speech, in seconds.

{f} LocationSay ({p} Location, {i} SpeechCode, {f} VocalRange)
Description:
Allows a speech to be made at a location, rather than specifying a character who will make the speech. The speech code is specified outside the AI subsystem, and will determine the string which appears on screen, the sound played, and the animation played. Note that the script will be suspended until the speech has been completed (see LocationSayWithoutSuspend).
ParameterDescription
Location: The location where the speech will be made.
SpeechCode: The code determining what speech is made.
VocalRange: The distance within which the subtitle will be displayed.
Return:
Returns the time of the speech, in seconds.

{v} LockCharacter ({c} Char, {i} bLock)
Description:
Locks a character in place so that it cannot be moved by other characters. Note that the character will be automatically unlocked if the MoveAI is used to attempt to move him, whether by a command such as MoveToPosition, or the use of an Attack or Search or similar.
ParameterDescription
Char: The character to lock or unlock.
bLock: 1 is to lock the character, 0 is to unlock.
Return:

{p} MakePoint ({f} x, {f} y, {f} z)
Description:
Creates a point structure with the contents specified.
ParameterDescription
x: The point x value.
y: The point y value.
z: The point z value.
Return:
Returns the point.

{q} MakeQuaternion ({f} w, {f} x, {f} y, {f} z)
Description:
Creates a quaternion structure with the contents specified.
ParameterDescription
w: The quaternion w value.
x: The quaternion x value.
y: The quaternion y value.
z: The quaternion z value.
Return:
Returns the quaternion.

{i} MoveToPosition ({p} Position, {i} Mode)
Description:
Moves the character to the position specified. Note that the script is suspended until the destination is reached (see MoveToPositionWithoutSuspend).

Sometimes a MoveToPosition command will fail to reach the destination. You can use the GetLastReturned script command to find the result of a MoveToPosition command.

Note the actual physical speed can be set up in the Data/AI/AI_SpeedSettings.ini file. The file describes the speed to be used for different movements by each animator type ( e.g. hybrid, human). The first line is the number of animator types to be described, which is followed by a section for each animator type. The format of the file is as follows :

NUM_TYPES 3

ID 0
WALK 1.0
RUN 2.5
CRAWL 0.75
WOUNDED_WALK 0.8
BACK_FAST 1.0
BACK_SLOW 1.0
STRAFE_FAST 2.0
STRAFE_SLOW 1.0

ID 1
etc. (for 3 types)

ParameterDescription
Position: The position to move to.
Mode: The movement mode to use. 0 is walking, 1 is running, 2 is crawling.
Return:

{i} MoveToPositionExWithoutSuspend ({c} Character, {p} Position, {i} Mode)
Description:
Moves the character specified to the position specified. Note that the calling script is not suspended. Note also that with this extended command, any current movements taking place on the character specified will be terminated, and their calling tasks resumed, prior to activating the new MoveToPositionEx command. Script writers should therefore take particular care that their remote control of another character does not interfere with scripts already running on that character.
ParameterDescription
Character: The character to move.
Position: The position to move to.
Mode: The movement mode to use. 0 is walking, 1 is running.
Return:

{i} MoveToPositionEx ({c} Character, {p} Position, {i} Mode)
Description:
Moves the character specified to the position specified. Note that the calling script is suspended until the destination is reached. Note also that with this extended command, any current movements taking place on the character specified will be terminated, and their calling tasks resumed, prior to activating the new MoveToPositionEx command. Script writers should therefore take particular care that their remote control of another character does not interfere with scripts already running on that character.
ParameterDescription
Character: The character to move.
Position: The position to move to.
Mode: The movement mode to use. 0 is walking, 1 is running.
Return:

{i} MoveToPositionForPreCannedAnimation ({c} Character, {s} AnimName, {i} MovementSpeedMode)
Description:
In order to play a pre-canned animation with a smooth blend, a character should first move into the approximate position and orientation for the start of the animation. This command performs this functionality.
ParameterDescription
Character: Character to move into position to play the animation.
AnimName: The name of the precanned animation.
MovementSpeedMode: 0 is walk and 1 is run.
Return:

{i} MoveToPositionWithoutSuspend ({p} Position, {i} Mode)
Description:
Moves the character to the position specified without suspending the calling script (see MoveToPosition).
ParameterDescription
Position: The position to move to.
Mode: The movement mode to use. 0 is walking, 1 is running.
Return:

{i} PauseAllEnemies ()
Description:
Pauses the activity of all enemies in the game. This can be used during a conversation (see IsPlayerSafe) to ensure that the player will not be attacked while talking.
ParameterDescription
Return:

{f} PlayAnim ({s} AnimTypeString, {i} AnimParameter)
Description:
PlayAnim is used to play animations on the character running the command. The animation type string is passed directly to the Animation module (consult the animation documentation for details on which animation type strings are available). The animation parameter is again passed directly to the animation module, consult animation documentation for details.
ParameterDescription
AnimTypeString: This determines which (if any) animation will be played.
AnimParameter: This value is passed directly to the animation module.

0 = Don't loop
1 = Loop
2 = Default

Return:
Returns the time (in seconds) that the animation lasts for.

{f} PlayAnimEx ({c} AnimationPlayer, {s} AnimTypeString, {i} AnimParameter)
Description:
An extended version of the PlayAnim command which allows animations to be played on characters other than that running the script.
ParameterDescription
AnimationPlayer: This determines which character will play the animation.
AnimTypeString: This determines which (if any) animation will be played.
AnimParameter: This value is passed directly to the animation module.

0 = Don't loop
1 = Loop
2 = Default

Return:
Returns the time (in seconds) that the animation lasts for.

{f} PlayPreCannedAnimationWithoutSuspend ({c} Player, {s} AnimName, {i} PreCannedMode)
Description:
Similar to PlayPreCannedAnimation but does not suspend the virtual machine until the animation has finished.
ParameterDescription
Player: The character to play the precanned animation.
AnimName: The precanned animation name (see animation documentation).
PreCannedMode: The mode used to play the pre canned (see PlayPreCannedAnimation, except only modes 1 and 3 are applicable).
Return:
Returns the time (in seconds) the animation will take to play to completion.

{f} PlayPreCannedAnimation ({c} Player, {s} AnimName, {i} PreCannedMode)
Description:
Plays a precanned animation starting from the characters current location. Characters should be moved into position prior to calling this command using MoveToPositionOfPreCannedAnimation. The command suspends the virtual machine until the animation has been completed. If characters dont seem to come out of precanned mode after the animation, play a normal animation to force them into normal mode (e.g. Stand).
ParameterDescription
Player: The character to play the precanned animation.
AnimName: The precanned animation name (see animation documentation).
PreCannedMode: The mode used to play the pre canned (see animation documentation).

0 - AI resumes control after precanned, and character is back in physics mode (a passive anim will be played automatically)
1 - Character remains in precanned mode after the precanned animation so more precanned animations can be played straight after
2 - Character remains in precanned mode in order to play a non-looping precan, but then the original precan is returned to (assuming it was a loop). Eg. guy is fiddling underneath a car in a loop, but then is interupted to fetch a spanner, but then continues original loop
3 - Character does NOTHING after the precan eg. you want him to just lie dead

Return:
Returns the time (in seconds) the animation will take to play to completion.

{i} PlaySound ({s} Filename, {f} Volume, {f} Range)
Description:
Plays a positional sound at the location of the calling character by filename.
ParameterDescription
Filename: The filename of the sound to play.
Volume: The volume (0.0 - 1.0).
Range: The range over which the sound can be heard (cm).
Return:

{i} PlayerInView ()
Description:
Determines whether the player is in view (or view memory) of the head of the character running the script. In view memory means that although the character may not currently be in view, the amount of time specified by LostTrackOfTime has not yet expired so the character will still know where the player is.
ParameterDescription
Return:
Returns :

2 - if the player is not in view but is in view memory
1 - if the player is in view
0 - if he is not in view or view memory


{f} PlayerSay ({i} SpeechCode)
Description:
Makes the player say the specified speech. The speech code is specified outside the AI subsystem, and will determine the string which appears on screen, the sound played, and the animation played. Note that the script will be suspended until the speech has been completed (see PlayerSayWithoutSuspend).
ParameterDescription
SpeechCode: The code determining what speech is made.
Return:
Returns the time of the speech, in seconds.

{f} PlayerSayWithoutSuspend ({i} SpeechCode)
Description:
Makes the player say the specified speech. The speech code is specified outside the AI subsystem, and will determine the string which appears on screen, the sound played, and the animation played. Note that the script will not be suspended (see PlayerSay).
ParameterDescription
SpeechCode: The code determining what speech is made.
Return:
Returns the time of the speech, in seconds.

{i} PointAtAngle ({c} Character, {f} Angle, {f} Time, {i} Mode)
Description:
Points a character at the specified angle. Note that guaranteeing the orientation of the legs can only achieved by using mode 2, and that mode 0 can fail to look at the desired area if it is behind the character, because there is a limit to the rotation of the spine.
ParameterDescription
Character: The character to point.
Angle: The angle to look at (radians, from -PI to +PI).
Time: The time in seconds to point for.
Mode: 0 - Head and torso
1 - Head, torso and legs
2 - Whole body
Return:

{i} PointAtCharacter ({c} Character, {c} Character, {f} Time, {i} Mode)
Description:
Points a character at another character. Note that guaranteeing the orientation of the legs can only achieved by using mode 2, and that mode 0 can fail to look at the desired area if it is behind the character, because there is a limit to the rotation of the spine.
ParameterDescription
Character: The character to point.
Character: The character to point at.
Time: The time in seconds to point for.
Mode: 0 - Head and torso
1 - Head, torso and legs
2 - Whole body
Return:

{i} PointAtLocation ({c} Character, {p} TargetLoc, {f} Time, {i} Mode)
Description:
Points a character at an xyz location. Note that guaranteeing the orientation of the legs can only achieved by using mode 2, and that mode 0 can fail to look at the desired area if it is behind the character, because there is a limit to the rotation of the spine.
ParameterDescription
Character: The character to point.
TargetLoc: The location to point at.
Time: The time in seconds to point for.
Mode: 0 - Head and torso
1 - Head, torso and legs
2 - Whole body
Return:

{i} PointInView ({p} Point)
Description:
Determines whether a point is in view of the head of the character running the script.
ParameterDescription
Point: The point to check whether is in view.
Return:
Returns 1 if the point is in view, 0 if it is not.

{f} PointLength ({p} Point)
Description:
Finds the length of a Point type (3d vector).
ParameterDescription
Point: The point to find the length of.
Return:
The length of the point.

{p} PointUnitize ({p} Point)
Description:
Unitizes a point. What this means is that a new Point is created in exactly the same direction as the original point, but with a length of 1.0. Note that if a Point of value 0.0, 0.0, 0.0 is used, the unitized point will also be 0.0, 0.0, 0.0 because it is impossible to unitize such a point, because it has no direction.
ParameterDescription
Point: The point to unitize.
Return:
The new unitized point.

{v} PrintTasks ({c} Character)
Description:
For debug purposes, this command OutputDebugStrings (to the IDE window) a list of the tasks currently running on a character, along with their priorities. For convenience, the character name is also displayed.
ParameterDescription
Character: The character to print the task list from.
Return:

{v} PrintZones ({c} Character)
Description:
For debugging purposes, PrintZones prints a description of the current include and exclude zones to the output debug window. This is useful when trying to work out why a character is refusing to move where you want.. it can often be because his zone setup doesnt allow it. This is a common pitfall because it can be difficult to keep good track of what zones you set on a character when multiple scripts are running.
ParameterDescription
Character: The character to print the list of include and exclude zones for.
Return:

{i} RandomInt ({i} iMin, {i} iMax)
Description:
Creates a random integer, in the range iMin to iMax inclusive.
ParameterDescription
iMin: The minimum value that the random number could be.
iMax: The maximum value that the random number could be.
Return:
Returns the random number.

{f} Random ({f} fMin, {f} fMax)
Description:
Creates a random floating point number, in the range fMin to fMax inclusive.
ParameterDescription
fMin: The minimum value that the random number could be.
fMax: The maximum value that the random number could be.
Return:
Returns the random number.

{p} RandomlyAffectPosition ({p} Point, {f} Radius)
Description:
Apply a randomization effect to a point. A point is chosen at random to be returned that is within an area centered on the input point, but within the radius specified.
ParameterDescription
Point: The centre of the area for the point to be chosen from.
Radius: The radius of the area for the point to be chosen from (in cms).
Return:
Returns the randomized point.

{i} RemoveEventResponseEx ({c} Character, {s} EventName)
Description:
The character specified will remove any event responses to the event named. This means that scripts will no longer be triggered in response to this event (if any have been set up using SetEventResponse).
ParameterDescription
Character: The character to remove event responses from.
EventName: The name of the event to remove responses to.
Return:

{i} RemoveEventResponse ({s} EventName)
Description:
The character running this command will remove any event responses to the event named. This means that scripts will no longer be triggered in response to this event (if any have been set up using SetEventResponse).
ParameterDescription
EventName: The name of the event to remove responses to.
Return:

{i} RemoveFromWatchList ({c} Watcher, {c} Watchee)
Description:
Stops a character from looking out for a specific other character. See AddToWatchList for more info.
ParameterDescription
Watcher: The character doing the watching.
Watchee: The character to be no longer watched for.
Return:

{v} ResetVoiceRange ({c} Character)
Description:
Resets the maximum range at which character say commands will be displayed on screen to the default value (currently 20000 cm).
ParameterDescription
Character: The character to reset the voice range on.
Return:

{i} ResumeAllEnemies ()
Description:
Resumes the activity of all enemies in the game (after a PauseAllEnemies). This can be used during a conversation (see IsPlayerSafe) to ensure that the player will not be attacked while talking.
ParameterDescription
Return:

{i} RunGameScriptEx ({s} GameScriptName)
Description:
RunGameScriptEx is an extended version of RunGameScript, which allows a variable number of user-defined arguments to be passed to the virtual machine running the gamescript. The first argument of RunGameScriptEx is always the name of the script to run. After that, any number of optional arguments (of any type) can be added. The script can retrieve these arguments (in order) using the command GetArg().

Note that the last argument to this command must always be the total number of arguments used. Thus when no optional arguments are passed, the number of arguments will be two. With one optional argument the number of arguments will be three, and so on.

e.g.

RunGameScriptEx("MyScript.hfs", 2);

RunGameScriptEx("MyScript.hfs", "Spam", 3); // passes the string Spam to the script

In MyScript.hfs :

String MyString;
MyString = GetArg();
Print(MyString);

*VM_PrintString* Spam

Parameters

ScriptName : The name of the script to be run.
NumberOfArgs : The total number of arguments (including non-optional) in the call. This would be 2 with no optional arguments.

ParameterDescription
GameScriptName: The name of the gamescript to be run.
Return:

{i} RunGameScript ({s} ScriptName)
Description:
This command is used to run game scripts. Game scripts are very similar to normal AI scripts except for a few important differences:

1) Gamescripts do not run on (and are not associated with) any particular character.

2) Gamescripts do not have priorities.. when a gamescript is run, it will always be executed, regardless of what else is happening in the game.

3) Because gamescripts are not associated with characters, certain AI script commands are not available from gamescript.

ParameterDescription
ScriptName: Filename of the gamescript to be run.
Return:

{i} RunScript ({s} ScriptName)
Description:
RunScript allows a character to set off the execution of another script on it. Note that if the script calling RunScript is of higher priority than the script invoked, the new script will only be run upon termination of the calling script.

This command is one of a special few in the scripting language which can take a variable number of arguments. The first two arguments are always the script name to run and the priority, however any number of optional arguments (of any type) can be added after these two, which will be passed to the script which has been run. The script can retrieve these arguments (in order) using the command GetArg().

Note that the last argument to this command must always be the total number of arguments issued. Thus when no optional arguments are passed the number of arguments will be three. With one optional argument the arguments will be four, and so on.

e.g.

RunScript("MyScript.hfs", 0.5, 3);

RunScript("MyScript.hfs", 0.5, "Spam", 4); // passes the string Spam to the script

In MyScript.hfs :

String MyString;
MyString = GetArg();
Print(MyString);

*VM_PrintString* Spam

Parameters

ScriptName : The name of the script to be run.
Priority : The priority of the script to be run.
NumberOfArgs : The total number of arguments (including non-optional) in the call. This would be 3 with no optional arguments.

ParameterDescription
ScriptName: The name of the script to be run.
Return:

{i} RunScriptEx ({c} Character)
Description:
An extended version of RunScript which allows running scripts on other characters. See RunScript. The arguments are similar to RunScript except for the first being the character to run the script. Note also that the number of args argument will now be 4 with no optional arguments. See GetArg() for more information on retrieving arguments from the stack.

e.g.

Character Barry;
Barry = GetCharacterByName("Barry");
RunScriptEx(Barry, "MyScript.hfs", 0.5, "Spam", 5); // passes the string Spam to the script

Parameters

Character : The character to run the script
ScriptName : The name of the script to be run.
Priority : The priority of the script to be run.
NumberOfArgs : The total number of arguments (including non-optional) in the call. This would be 4 with no optional arguments.

ParameterDescription
Character: The character to run the script.
Return:

{f} SayWithoutSuspend ({c} Sayer, {i} SpeechCode)
Description:
Makes the character specified say the specified speech. The speech code is specified outside the AI subsystem, and will determine the string which appears on screen, the sound played, and the animation played. Note that the script will not be suspended (see Say).
ParameterDescription
Sayer: The character doing the saying.
SpeechCode: The code determining what speech is made.
Return:
Returns the time of the speech, in seconds.

{f} Say ({c} Sayer, {i} SpeechCode)
Description:
Makes the character specified say the specified speech. The speech code is specified outside the AI subsystem, and will determine the string which appears on screen, the sound played, and the animation played. Note that the script will be suspended until the speech has been completed (see SayWithoutSuspend).
ParameterDescription
Sayer: The character doing the saying.
SpeechCode: The code determining what speech is made.
Return:
Returns the time of the speech, in seconds.

{i} SearchZone ({c} Target, {f} Priority, {s} ZoneName)
Description:
Creates a hard coded search script. The hard coded script, when active forces the character state machine into search mode, and causes the character to search the zone requested. It is important to note that the search script has a priority and will be overrided if other scripts exist at a higher priority. The search script is similar to an attack script except that it forces a search if the target is not in view memory. Once the target is found, the character will go into normal attack mode..

Note that problems may occur if a character is told to search a zone outside the range allowed by its current SetZone and ExcludeZone settings.

ParameterDescription
Target: The character to search for.
Priority: The hard coded search script priority.
ZoneName: The zone to be searched.
Return:

{i} Search ({c} Target, {f} Priority)
Description:
Creates a hard coded search script. The hard coded script, when active forces the character state machine into search mode. It is important to note that the search script has a priority and will be overrided if other scripts exist at a higher priority. The search script is similar to an attack script except that it forces a search if the target is not in view memory. Once the target is found, the character will go into normal attack mode..
ParameterDescription
Target: The character to search for.
Priority: The hard coded search script priority.
Return:

{i} SelectWeapon ({c} Character, {s} WeaponName)
Description:
SelectWeapon selects which weapon is put in a characters hands. This weapon will be used for combat. Note that the weapon selected must have previously been added using AddWeapon, otherwise SelectWeapon will have no effect.
ParameterDescription
Character: The character to select the weapon.
WeaponName: Which weapon should be selected. See the AddWeapon command for a list of names.
Return:

{i} SendEvent ({c} Character, {s} EventName)
Description:
The SendEvent command sends an AI event directly to a particular character. A character can be set up to respond to an AI event by running a script, see SetEventResponse. This command is a more specific version of the GenerateEvent command.
ParameterDescription
Character: The character to send the event to.
EventName: The name of the event to send.
Return:

{i} SendEventEx ({c} Character)
Description:
SendEventEx is an extended version of the SendEvent command which allows a variable number of arguments to be passed to any event response scripts. The method of specifying the arguments is similar to that used with the command RunScript (see RunScript). After the first two arguments which are mandatory, the user can insert any number of user arguments, followed by a count of the total number of arguments in the call. These arguments can be retrieved in the event response script using GetArg.

e.g.

Character Bob;
Bob = GetCharacterByName("Bob");
SendEventEx(Bob, "Spotted", 20.0, 4)

This sends an event Spotted to Bob, and in his event response script 20.0 can be removed from the stack using the command GetArg() :

BobSpotted.hfs :
Print("Ive been spotted!");
Float fMyVar;
fMyVar = GetArg();
Print(fMyVar);

This would print :
Ive been spotted!
20.0

ParameterDescription
Character: The character to send the event to.
Return:

{v} SetActionableRange ({c} Character, {f} Range)
Description:
Sets the distance that the player needs to be within in order to action the specified character.
ParameterDescription
Character: The character to set the actionable range on.
Range: The range in cm.
Return:

{i} SetAlertStatus ({c} Character, {i} AlertStatus)
Description:
Sets the alert status of a character as used by the animator. The modes are as follows :

0 - Not alert
1 - Alert
2 - Auto mode

Every time the animator is told to stand or crouch, it checks the alert status to decide whether to use an aiming pose, or a passive pose. Auto mode allows the game to automatically manage the alertness ... a character will be more alert if it has recently seen the player. The other modes allow the scripter precise control over alertness. Remember that it is necessary to call a PlayAnim to stand or crouch after this command in order to see any instantaneous effects.

ParameterDescription
Character: The character to set the alert status of.
AlertStatus: The desired mode, as described above.
Return:

{i} SetAutoGlance ({c} Character, {i} On)
Description:
Turns on and off auto glancing on characters. When not in state machine mode (i.e. not in attack search etc) characters will automatically glance about periodically if AutoGlance mode is turned on. The frequency of glancing is controlled by the quick status value Glancing (see SetStatus script command).
ParameterDescription
Character: The character to set the autoglance mode on.
On: 1 turns autoglance on, 0 turns it off.
Return:

{i} SetCharacterPhysicsRadius ({c} Character, {f} Radius)
Description:
Sets the physics radius of an AI character, in cm. This determines the distance away from other characters that collisions occur, and how close a character can get to the environment before collisions occur. Note however that when increasing the radius above 50cm, characters will often have to be zoned to specific areas, in order to stop them getting stuck between door frames (the MoveAI assumes a radius of 50cm).
ParameterDescription
Character: The character to set the physics radius of.
Radius: The new radius in cm.
Return:

{v} SetDebug ({c} Character, {i} Parameter, {s} String)
Description:
Sets the debug mode of a character.

e.g.

SetDebug(Me, 0, ""); // turns off my npc info

SetDebug(Me, 1, ""); // turns on my npc info

SetDebug(Me, 2, "Hello"); // sets my npc info user string to Hello.

Note that setting a user string just prints the string in the debug window for a character. This can be very useful when debugging (as opposed to a Print) in order to track what stage an npc is at through your scripts.

N.B. D_EnableDebugger must be set to 1 for the npc info windows to show up.

ParameterDescription
Character: The character to set the debug mode on.
Parameter: Debug parameter.
String: DebugString.
Return:

{v} SetDropListRemovalTime ({c} Character, {f} RemovalTime)
Description:
When characters die they can be set to drop items in a DOB pickup. This command allows the script writer to specify how long the pickup should remain on the ground before being automatically removed. -1.0 can be used to indicate the pickup should never be removed unless it is picked up.
ParameterDescription
Character: The character to change the droplist removal time on.
RemovalTime: The new droplist removal time in seconds (defaults to -1.0, i.e. never).
Return:

{i} SetEventResponse ({s} EventName, {s} ScriptName, {f} Priority)
Description:
AI characters make most of their responses to AI Events (such as seeing the player) by running scripts to deal with these situations. This command allows you to set up which script will be run upon a named AI event. It also allows you to set the priority of the script which will be run.

Some events are hard coded into the game to occur in certain circumstances, and the script writer can hijack these to key their own custom responses :

PlayerEnteredView

This event is created whenever the player enters the view of a character, and it is not already in view memory (characters remember that they have seen the player for a certain amount of time (the LostTrackOfTime, see SetStatus) after they have left their view).

LostTrackOfPlayer

This event is created when the main player has been out of view of an npc for a specific, user-definable time (LostTrackOfTime, see SetStatus). This is usually used automatically for purposes such as switching monsters from attack to search mode.

Entered NiRoom01
Exited NiRoom01

These two events respectively are created on entering and on leaving every NiRoom, and can be used easily to trigger AI actions when entering and leaving locations.

Death

This event is created when a character dies (health reaches zero). Note however that if an event response is set for Death, the script writer is responsible for actually deleting the character, which they should do by using the command Kill(Me); at the end of the Death script (see Kill command).

HeardSound

This event is generated on npcs any time a sound is heard and they make a response by looking at the sound.

ShotByPlayer

This event is generated on an AI character when it is shot by the player. In addition the amount of damage (as a float) is passed to the event response script and can be retrieved using the GetArg command.

ParameterDescription
EventName: The name of the AI event which is to be responded to.
ScriptName: The name of the script which will be called upon this event occurring.
Priority: The priority of the script that will be called.
Return:

{i} SetEventResponseEx ({c} Character, {s} EventName, {s} ScriptName, {f} Priority)
Description:
This is an extended version of the SetEventResponse command which allows setting event responses on other characters. AI characters make most of their responses to AI Events (such as seeing the player) by running scripts to deal with these situations. This command allows you to set up which script will be run upon a named AI event. It also allows you to set the priority of the script which will be run.

Some events are hard coded into the game to occur in certain circumstances, and the script writer can hijack these to key their own custom responses :

PlayerEnteredView

This event is created whenever the player enters the view of a character, and it is not already in view memory (characters remember that they have seen the player for a certain amount of time (the LostTrackOfTime, see SetStatus) after they have left their view).

LostTrackOfPlayer

This event is created when the main player has been out of view of an npc for a specific, user-definable time (LostTrackOfTime, see SetStatus). This is usually used automatically for purposes such as switching monsters from attack to search mode.

Entered NiRoom01
Exited NiRoom01

These two events respectively are created on entering and on leaving every NiRoom, and can be used easily to trigger AI actions when entering and leaving locations.

Death

This event is created when a character dies (health reaches zero). Note however that if an event response is set for Death, the script writer is responsible for actually deleting the character, which they should do by using the command Kill(Me); at the end of the Death script (see Kill command).

ParameterDescription
Character: The character to set the event response on.
EventName: The name of the AI event which is to be responded to.
ScriptName: The name of the script which will be called upon this event occurring.
Priority: The priority of the script that will be called.
Return:

{i} SetExperienceInt ({c} CharacterToGetExperienceFrom, {s} ExperienceName, {i} Value)
Description:
Sets the integer value of a experience property attached to a character. If the experience property does not exist already, it will be created. See properties.
ParameterDescription
CharacterToGetExperienceFrom: The character to get the experience value from.
ExperienceName: The name of the experience property to set the value of.
Value: The value to set the experience property to.
Return:

{i} SetExperienceString ({c} CharacterToSetExperience, {s} ExperienceName, {s} String)
Description:
Sets the string value of a experience property attached to a character. If the experience property does not exist already, it will be created. See properties.
ParameterDescription
CharacterToSetExperience: The character to set the experience string on.
ExperienceName: The name of the experience property to set the string on.
String: The string to set on the experience property.
Return:

{i} SetExperience ({c} CharacterToGetExperienceFrom, {s} ExperienceName, {f} Value)
Description:
Sets the floating point value of a experience property attached to a character. If the experience property does not exist already, it will be created. See properties.
ParameterDescription
CharacterToGetExperienceFrom: The character to get the experience value from.
ExperienceName: The name of the experience property to set the value of.
Value: The value to set the experience property to.
Return:

{i} SetStatus ({c} CharacterToGetStatusFrom, {s} StatusName, {f} Value)
Description:
Sets the floating point value of a status property attached to a character. If the status property does not exist already, it will be created. See properties. Note that some of these status values (e.g. Health) are special (quickstatus values) and can be altered by the game code as well as the scripts.

Quickstatus values

Health (0.0 - ~100.0)
LosingTrackTime (seconds)(defaults to 10 seconds)
Friendly (0.0 or 1.0)
Accuracy (0.0 to 1.0)
Intelligence (0.0 to 1.0)
Courage (0.0 to 1.0)
VisionRange (in cm)
Sniping (0.0 to 1.0)
Glancing (0.0 to 1.0) (never to very frequently, sliding scale)
DodgeTime (minimum dodge time in seconds) (defaults to 3.0)
UnloadModelOnDelete (0.0 or 1.0)
SoundSensitivity (0.0 to 1.0)

Hittable (0.0 or 1.0) (determines whether a character can be hit, defaults to 1.0)

Body Areas (setting these causes the animator to play injured walks etc)

HeadHealth (0.0 to 1.0)
TorsoHealth (0.0 to 1.0)
LeftArmHealth (0.0 to 1.0)
RightArmHealth (0.0 to 1.0)
LeftLegHealth (0.0 to 1.0)
RightLegHealth (0.0 to 1.0)

ParameterDescription
CharacterToGetStatusFrom: The character to get the status value from.
StatusName: The name of the status property to set the value of.
Value: The value to set the status property to.
Return:

{i} SetStatusInt ({c} CharacterToGetStatusFrom, {s} StatusName, {i} Value)
Description:
Sets the integer value of a status property attached to a character. If the status property does not exist already, it will be created. See properties.
ParameterDescription
CharacterToGetStatusFrom: The character to get the status value from.
StatusName: The name of the status property to set the value of.
Value: The value to set the status property to.
Return:

{i} SetStatusString ({c} CharacterToSetStatus, {s} StatusName, {s} String)
Description:
Sets the string value of a status property attached to a character. If the status property does not exist already, it will be created. See properties. Note that some of these status values (e.g. Health) are special (quickstatus values) and can be altered by the game code as well as the scripts.

Quickstatus values

Name (used with the command GetCharacterByName to reference characters after their creation)
WoundingSound (filename string)
DyingSound (filename string)
WoundingSoundSet (one of HybridStage1Wounded, DeepOneWounded or HumanWounded)

Explanation : Scripters can determine the sound set used for wounding sounds by using the WoundedSoundSet quickstatus value (these sets are determined in the sounds dcf). If more precise control is needed, and for particular situations, scripters can control which sound is made by using either the WoundingSound quickstatus or DyingSound, along with the filename of the sound they want to use.

ParameterDescription
CharacterToSetStatus: The character to set the status string on.
StatusName: The name of the status property to set the string on.
String: The string to set on the status property.
Return:

{v} SetViewAngle ({c} Character, {f} Angle)
Description:
Enables the scripter to customize the angle used to decide whether another object (including characters) is in its view. The angle should be supplied in degrees, with 0 degrees indicating the smallest view cone and 360 degrees indicating all round vision (eyes in the back of the head(!)).
ParameterDescription
Character: The character to set the view angle on.
Angle: The view cone angle in degrees (0.0 - 360.0).
Return:

{v} SetVoiceRange ({c} Character, {f} Distance)
Description:
Sets the maximum range at which character say commands will be displayed on screen. Defaults to 5000.0 cm.
ParameterDescription
Character: The character to set the voice range on.
Distance: The maximum distance the voice will be heard, in cm.
Return:

{i} SetZone ({c} Character, {s} ZoneName, {i} AddOrRemove)
Description:
SetZone (and ExcludeZone) allows the user to specify exactly which waypoints in the nodemap that a character will treat as travellable. They allow characters to be limited to moving within specific areas. A character can be allowed to travel within one or more zones, and excluded from one or more zones. SetZone can be used to add or remove zones from the travellable list.
ParameterDescription
Character: The character to set the zones on.
ZoneName: The zone to be added or removed from the travellable list.
AddOrRemove: 1 to add this zone to the travellable list, 0 to remove it.
Return:

{v} ShowTorch ({c} Character, {i} OnOrOff)
Description:
Shows and hides the torch on an NPC. Note that the torch will be automatically hidden in attack mode, but brought out again (if necessary) when the attack target is lost track of.
ParameterDescription
Character: The character to show or hide his torch.
OnOrOff: Whether the torch should be shown or hidden. 1 is show, 0 is hide.
Return:

{v} StopAllAnimations ({c} Character)
Description:
Stops all animations (including pre-canned) running on the specified character.
ParameterDescription
Character: The character to stop all the animations on.
Return:

{v} StopAllScripts ({c} Character)
Description:
Stops all scripts running on the specified character (including hard-coded tasks), except for the script from which StopAllScripts was called.
ParameterDescription
Character: The character to stop all the scripts on.
Return:

{i} StopScript ({s} ScriptName)
Description:
The character calling this command will terminate and delete any scripts with the name requested on the character running the script.

Note that script names contain a path (e.g. Jailbreak/MyScript.hfs) except for the special hard coded tasks :

HC_Attack (caused by the commands Attack or Search or Snipe)
HC_Hide (cause by the command Hide)

ParameterDescription
ScriptName: The name of the script to be deleted.
Return:

{i} StopScriptEx ({c} Character, {s} ScriptName)
Description:
Terminates and deletes any scripts (tasks) with the name requested on the character requested.
ParameterDescription
Character: The character to delete the script / scripts from.
ScriptName: The name of the script to be deleted.
Return:

{i} TeleportToPositionEx ({c} Character, {p} Pos)
Description:
Teleports the character specified to the position specified. If the character is teleported into the air, he will drop to the ground. If the character is teleported into collision with geometry, unpredictable results may occur. It is best to teleport characters to positions slightly above the ground.
ParameterDescription
Character: The character to teleport.
Pos: The position to teleport the character to.
Return:

{i} TeleportToPosition ({p} Pos)
Description:
Teleports the character running the script to the position specified. Note that this must be run from an AI script. If the character is teleported into the air, he will drop to the ground. If the character is teleported into collision with geometry, unpredictable results may occur. It is best to teleport characters to positions slightly above the ground.
ParameterDescription
Pos: The position to teleport the character to.
Return:

{i} TerminateMotion ({c} Character)
Description:
Immediately terminates any MoveToPosition and similar commands currently running. Note that any scripts currently suspended as a result of a MoveToPosition or similar command will be resumed upon calling this command.
ParameterDescription
Character: The character to terminate the motion on.
Return:

{i} Wait ({f} Time)
Description:
Suspends the virtual machine for approximately the time specified.
ParameterDescription
Time: The time to wait in seconds.
Return: