Both sides previous revision Previous revision Next revision | Previous revision | ||
hpl3:community:scripting:script_functions [2015/10/27 13:49] mudbill |
hpl3:community:scripting:script_functions [2015/10/29 07:26] (current) romulator |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Engine Scripts ====== | ====== Engine Scripts ====== | ||
- | This page is here as a reference documentation available online covering the main script functions within HPL3. The Basic Code section contains scripts that are available by default and found within the **hps_api.hps** file located in the SOMA game directory. Under "Helper Files" you will find the functions referenced in the specific helper files which require a script import from the script folder. | + | <note>This page is no longer being maintained, as all the Engine functions which this page was aiming to document have since been created. If you wish to view them, they can be found in HPL3 Documentation/game/Scripting/function_reference by using the sidebar, or you can use [[hpl3:game:scripting:function_reference:hps_api|this link]] to access the hps_api functions and view them from there. |
- | **Note: This is a work-in-progress page. In time, it will contain much more, including all built-in functions, helper files and possibly more.** | + | This page will eventually be removed. (10-29-2015, Romulator)</note> |
+ | |||
+ | This page is here as a reference documentation available online covering the main script functions within HPL3. The Basic Code section contains scripts that are available by default and found within the **hps_api.hps** file located in the SOMA game directory. Under "Helper Files" you will find the functions referenced in the specific helper files which require a script import from the script folder. | ||
+ | {{:hpl3:community:scripting:wip-icon.png?nolink&}}**Note: This is a work-in-progress page. In time, it will contain much more, including all built-in functions, helper files and possibly more.** | ||
===== Basic Code ===== | ===== Basic Code ===== | ||
Line 11: | Line 14: | ||
==== Main ==== | ==== Main ==== | ||
- | <code =c++> | + | <code =c++>#include <helper.hps> |
- | #include <helper.hps> | + | |
</code> | </code> | ||
Used to include scripts and referencing from various helper files created outside of the Base Scripts. (Eventually) All the helper files as found in SOMA/script/helpers/ will be included below the main scripts. | Used to include scripts and referencing from various helper files created outside of the Base Scripts. (Eventually) All the helper files as found in SOMA/script/helpers/ will be included below the main scripts. | ||
+ | |||
<code =c++> | <code =c++> | ||
class cScrMap : iScrMap { } | class cScrMap : iScrMap { } | ||
Line 22: | Line 25: | ||
A declaration of a class where the map (cScrMap) is able to access functions and reference material from scripts (iScrMap). Your code for your map should go within the braces of this declaration. | A declaration of a class where the map (cScrMap) is able to access functions and reference material from scripts (iScrMap). Your code for your map should go within the braces of this declaration. | ||
- | <code =c++> | + | <code =c++>void Setup(){ } |
- | void Setup(){ } | + | |
</code> | </code> | ||
Used when the map is being loaded/prepared/set up for the player. Called before OnStart();. Useful for setting up variables in the level. | Used when the map is being loaded/prepared/set up for the player. Called before OnStart();. Useful for setting up variables in the level. | ||
- | <code =c++> | + | |
- | void OnStart(){ } | + | <code =c++>void OnStart(){ } |
</code> | </code> | ||
Called when the player first enters the map, and only on this first occasion. Useful for setting up callbacks. | Called when the player first enters the map, and only on this first occasion. Useful for setting up callbacks. | ||
- | <code =c++> | + | |
- | void OnEnter(){ } | + | <code =c++>void OnEnter(){ } |
</code> | </code> | ||
Called when the player enters and re-enters the map. Useful for setting up variables and "hub" levels ("hub" meaning, levels that branch off into others). | Called when the player enters and re-enters the map. Useful for setting up variables and "hub" levels ("hub" meaning, levels that branch off into others). | ||
- | <code =c++> | + | |
- | void OnLeave(){ } | + | <code =c++>void OnLeave(){ } |
</code> | </code> | ||
Called when the player exits the level. Useful for ending certain events which occurred in the previous level (Using Music_Stop() for example). | Called when the player exits the level. Useful for ending certain events which occurred in the previous level (Using Music_Stop() for example). | ||
- | <code =c++> | + | |
- | void OnAction(){ } | + | <code =c++>void OnAction(){ } |
</code> | </code> | ||
Called when an action is completed. Often used by Frictional Games to debug and test certain events. | Called when an action is completed. Often used by Frictional Games to debug and test certain events. | ||
- | Other callbacks which can be used to perform certain actions [[hpl3:game:scripting#base_classes|can be found here]]. | + | Other callbacks which can be used to perform certain actions [[:hpl3:game:scripting|can be found here]]. |
- | + | ||
- | {{:hpl3:community:scripting:wip-icon.png?nolink|}} WORK IN PROGRESS {{:hpl3:community:scripting:wip-icon.png?nolink|}} | + | |
==== Billboard ==== | ==== Billboard ==== | ||
- | <code=c++> | + | <code =c++>void Billboard_SetVisible(const tString &in asBillboardName, bool abVisible); |
- | void Billboard_SetVisible(const tString &in asBillboardName, bool abVisible); | + | |
</code> | </code> | ||
Sets whether a billboard should be rendered or not. | Sets whether a billboard should be rendered or not. | ||
- | //asBillboardName// - name of the billboard. Wildcards * supported.\\ | + | //asBillboardName// - name of the billboard. Wildcards %%*%% supported.\\ |
//abVisible// - true = visible, false = invisible. | //abVisible// - true = visible, false = invisible. | ||
- | |||
==== Body ==== | ==== Body ==== | ||
- | <code=c++> | + | <code =c++>void Body_AddForce(const tString &in asBodyName, const cVector3f &in avForce, bool abLocalSpace); |
- | void Body_AddForce(const tString &in asBodyName, const cVector3f &in avForce, bool abLocalSpace); | + | |
</code> | </code> | ||
Line 74: | Line 71: | ||
//avForce// - the push force to apply.\\ | //avForce// - the push force to apply.\\ | ||
//abLocalSpace// - true = local force, false = global force. | //abLocalSpace// - true = local force, false = global force. | ||
- | |||
==== Button ==== | ==== Button ==== | ||
- | <code=c++> | + | <code =c++>void Button_SetSwitchedOn(const tString& in asName, bool abState, bool abEffects); |
- | void Button_SetSwitchedOn(const tString& in asName, bool abState, bool abEffects); | + | |
</code> | </code> | ||
Line 86: | Line 81: | ||
//abState// - true = on, false = off.\\ | //abState// - true = on, false = off.\\ | ||
//abEffects// - whether the change should use effects associated with it. If false, the player will not be apparent to the change. | //abEffects// - whether the change should use effects associated with it. If false, the player will not be apparent to the change. | ||
- | |||
==== EnergySource ==== | ==== EnergySource ==== | ||
- | <code=c++> | + | <code =c++>void EnergySource_SetEnergy(const tString &in asName, float afX); |
- | void EnergySource_SetEnergy(const tString &in asName, float afX); | + | |
</code> | </code> | ||
Line 97: | Line 90: | ||
//asName// - name of the energy source.\\ | //asName// - name of the energy source.\\ | ||
//afX// - the energy amount. | //afX// - the energy amount. | ||
- | |||
==== Entity ==== | ==== Entity ==== | ||
Line 116: | Line 108: | ||
Set whether an entity is active (visible and functioning) or not. | Set whether an entity is active (visible and functioning) or not. | ||
- | //asName //- the name of the entity (wildcards * are supported).\\ | + | //asName //- the name of the entity (wildcards %%*%% are supported).\\ |
//abActive //- if active or not. | //abActive //- if active or not. | ||
<code =c++> | <code =c++> | ||
Line 124: | Line 116: | ||
Check if an entity is active (visible and functioning) or not. | Check if an entity is active (visible and functioning) or not. | ||
- | //asName// - the name of the entity (wildcards * are supported). | + | //asName// - the name of the entity (wildcards %%*%% are supported). |
<code =c++>void Entity_SetInteractionDisabled(const tString &in asEntityName, bool abX); | <code =c++>void Entity_SetInteractionDisabled(const tString &in asEntityName, bool abX); | ||
</code> | </code> | ||
Line 130: | Line 122: | ||
Sets whether an entity can be interacted with by the player or not. | Sets whether an entity can be interacted with by the player or not. | ||
- | //asEntityName// - the name of the entity (wildcards * are supported).\\ | + | //asEntityName// - the name of the entity (wildcards %%*%% are supported).\\ |
//abX// - true = interaction disabled | false = interaction enabled. | //abX// - true = interaction disabled | false = interaction enabled. | ||
<code =c++>void Entity_SetMaxInteractionDistance(const tString &in asEntityName, float afDistance); | <code =c++>void Entity_SetMaxInteractionDistance(const tString &in asEntityName, float afDistance); | ||
Line 137: | Line 129: | ||
Override the default max distance an entity can be interacted with. | Override the default max distance an entity can be interacted with. | ||
- | //asEntityName// - the name of the entity (wildcards * are supported).\\ | + | //asEntityName// - the name of the entity (wildcards %%*%% are supported).\\ |
//afDistance// - the distance (in meters) the entity can be interacted with from. | //afDistance// - the distance (in meters) the entity can be interacted with from. | ||
<code =c++> | <code =c++> | ||
Line 151: | Line 143: | ||
Forces the entity to sleep. This disables Update and PostUpdate. Has no effect if entity is already sleeping. | Forces the entity to sleep. This disables Update and PostUpdate. Has no effect if entity is already sleeping. | ||
- | //asName// - the name of the entity (wildcards * are supported). | + | //asName// - the name of the entity (wildcards %%*%% are supported). |
<code =c++>void Entity_WakeUp(const tString &in asName); | <code =c++>void Entity_WakeUp(const tString &in asName); | ||
</code> | </code> | ||
Line 157: | Line 149: | ||
Wakes a sleeping entity. This enabled Update and PostUpdate. Has no effect if entity is already awake. | Wakes a sleeping entity. This enabled Update and PostUpdate. Has no effect if entity is already awake. | ||
- | //asName// - the name of the entity (wildcards * are supported). | + | //asName// - the name of the entity (wildcards %%*%% are supported). |
<code =c++> | <code =c++> | ||
bool Entity_IsSleeping(const tString &in asName); | bool Entity_IsSleeping(const tString &in asName); | ||
Line 170: | Line 162: | ||
Sets whether an entity should automatically sleep when it doesn't require updates. | Sets whether an entity should automatically sleep when it doesn't require updates. | ||
- | //asName// - the name of the entity (wildcards * are supported).\\ | + | //asName// - the name of the entity (wildcards %%*%% are supported).\\ |
//abX// - enabled or disabled. | //abX// - enabled or disabled. | ||
<code =c++> | <code =c++> | ||
Line 184: | Line 176: | ||
Set whether an entity is an occluder. | Set whether an entity is an occluder. | ||
- | //asName// - the name of the entity (wildcards * are supported).\\ | + | //asName// - the name of the entity (wildcards %%*%% are supported).\\ |
//abOccluder// - enabled or disabled. | //abOccluder// - enabled or disabled. | ||
<code =c++> | <code =c++> | ||
Line 204: | Line 196: | ||
Sets a value of an entity variable. | Sets a value of an entity variable. | ||
- | //asName// - the name of the entity (wildcards * are supported).\\ | + | //asName// - the name of the entity (wildcards %%*%% are supported).\\ |
//asVarName// - the name of the variable for the entity.\\ | //asVarName// - the name of the variable for the entity.\\ | ||
//aX// - the value of the variable. | //aX// - the value of the variable. | ||
Line 215: | Line 207: | ||
Increments a value of an entity variable. | Increments a value of an entity variable. | ||
- | //asName// - the name of the entity (wildcards * are supported).\\ | + | //asName// - the name of the entity (wildcards %%*%% are supported).\\ |
//asVarName// - the name of the variable for the entity.\\ | //asVarName// - the name of the variable for the entity.\\ | ||
//aX// - the value to add. | //aX// - the value to add. | ||
Line 232: | Line 224: | ||
//asName// - the name of the entity.\\ | //asName// - the name of the entity.\\ | ||
//asVarName// - the name of the variable for the entity. | //asVarName// - the name of the variable for the entity. | ||
- | + | <code =c++> | |
- | <code=c++> | + | |
bool Entity_AddCollideCallback(const tString &in asParentName, const tString &in asChildName, const tString &in asFunction); | bool Entity_AddCollideCallback(const tString &in asParentName, const tString &in asChildName, const tString &in asFunction); | ||
</code> | </code> | ||
- | Adds a callback between two entities (objects, areas, player etc) when they collide with each other. Collisions include when "uncolliding" as well. Wildcards * are supported in names. | + | Adds a callback between two entities (objects, areas, player etc) when they collide with each other. Collisions include when "uncolliding" as well. Wildcards %%*%% are supported in names. |
//asParentName// - the first entity (for player collisions, this is always the player)\\ | //asParentName// - the first entity (for player collisions, this is always the player)\\ | ||
Line 244: | Line 235: | ||
Callback syntax:\\ | Callback syntax:\\ | ||
- | **FunctionName(const tString &in asParent, const tString &in asChild, int alState)**\\ | + | **FunctionName(const tString &in asParent, const tString &in asChild, int alState)** \\ |
- | //alState// - 1 = colliding, -1 = uncolliding, 0 = both.\\ | + | //alState// - 1 = colliding, -1 = uncolliding, 0 = both. |
**Returns** a boolean of whether the callback is repeated upon completetion. If true, callback can be called again. If false, callback is removed.\\ | **Returns** a boolean of whether the callback is repeated upon completetion. If true, callback can be called again. If false, callback is removed.\\ | ||
Abbreviation syntax for the callback function code snippet: **clbCollide** | Abbreviation syntax for the callback function code snippet: **clbCollide** | ||
- | + | <code =c++> | |
- | <code=c++> | + | |
bool Entity_RemoveCollideCallback(const tString &in asParentName, const tString &in asChildName); | bool Entity_RemoveCollideCallback(const tString &in asParentName, const tString &in asChildName); | ||
</code> | </code> | ||
- | Removes a callback for entity collisions. Wildcards * supported in names. | + | Removes a callback for entity collisions. Wildcards %%*%% supported in names. |
//asParentName// - the first entity (for player collisions, this is always player)\\ | //asParentName// - the first entity (for player collisions, this is always player)\\ | ||
//asChildName// - the second entity. | //asChildName// - the second entity. | ||
- | + | <code =c++> | |
- | <code=c++> | + | |
bool Entity_GetCollide(const tString &in asEntityA, const tString &in asEntityB); | bool Entity_GetCollide(const tString &in asEntityA, const tString &in asEntityB); | ||
</code> | </code> | ||
- | Check whether two entities are already colliding. Wildcards * are NOT supported. | + | Check whether two entities are already colliding. Wildcards %%*%% are NOT supported. |
//asEntityA// - the first entity.\\ | //asEntityA// - the first entity.\\ | ||
Line 270: | Line 259: | ||
Returns true if colliding, else false. | Returns true if colliding, else false. | ||
- | <code=c++> | + | <code =c++>void Entity_SetCollideCharacter(const tString &in asEntityName, bool abActive); |
- | void Entity_SetCollideCharacter(const tString &in asEntityName, bool abActive); | + | |
</code> | </code> | ||
Enable/disable an entity's collision with a character for all bodies in the entity. | Enable/disable an entity's collision with a character for all bodies in the entity. | ||
- | //asEntityName// - the name of the entity. Wildcards * are supported.\\ | + | //asEntityName// - the name of the entity. Wildcards %%*%% are supported.\\ |
//abActive// - true = collision on, false = collision off. | //abActive// - true = collision on, false = collision off. | ||
- | + | <code =c++>void Entity_SetCollide(const tString &in asEntityName, bool abActive); | |
- | <code=c++> | + | |
- | void Entity_SetCollide(const tString &in asEntityName, bool abActive); | + | |
</code> | </code> | ||
Enable/disable an entity's collision for all bodies in the entity. | Enable/disable an entity's collision for all bodies in the entity. | ||
- | //asEntityName// - the name of the entity. Wildcards * are supported.\\ | + | //asEntityName// - the name of the entity. Wildcards %%*%% are supported.\\ |
//abActive// - true = collision on, false = collision off. | //abActive// - true = collision on, false = collision off. | ||
- | + | <code =c++>void Entity_SetEffectsActive(const tString &in asEntityName, bool abActive, bool abFadeAndPlaySounds); | |
- | <code=c++> | + | |
- | void Entity_SetEffectsActive(const tString &in asEntityName, bool abActive, bool abFadeAndPlaySounds); | + | |
</code> | </code> | ||
Enables/disables whether an entity uses effects. | Enables/disables whether an entity uses effects. | ||
- | //asEntityName// - name of the entity/prop. Wildcards * are supported.\\ | + | //asEntityName// - name of the entity/prop. Wildcards %%*%% are supported.\\ |
//abActive// - true = activates effects, false = deactivates effects.\\ | //abActive// - true = activates effects, false = deactivates effects.\\ | ||
//abFadeAndPlaySounds// - if effects should fade in/out and play sounds. | //abFadeAndPlaySounds// - if effects should fade in/out and play sounds. | ||
- | + | <code =c++>void Entity_SetReflectionVisibility(const tString &in asEntityName, bool abVisibleInReflection, bool abVisibleInWorld); | |
- | <code=c++> | + | |
- | void Entity_SetReflectionVisibility(const tString &in asEntityName, bool abVisibleInReflection, bool abVisibleInWorld); | + | |
</code> | </code> | ||
Sets whether an entity is drawn in reflections or not, and/or in the real world or not. | Sets whether an entity is drawn in reflections or not, and/or in the real world or not. | ||
- | //asEntityName// - the name of the entity. Wildcards * are supported.\\ | + | //asEntityName// - the name of the entity. Wildcards %%*%% are supported.\\ |
//abVisibleInReflection// - whether the entity is drawn in reflections.\\ | //abVisibleInReflection// - whether the entity is drawn in reflections.\\ | ||
//abVisibleInWorld// - whether the entity is drawn in the real world. | //abVisibleInWorld// - whether the entity is drawn in the real world. | ||
- | + | <code =c++>void Entity_SetEffectBaseColor(const tString &in asEntityName, const cColor&in aColor); | |
- | <code=c++> | + | |
- | void Entity_SetEffectBaseColor(const tString &in asEntityName, const cColor&in aColor); | + | |
</code> | </code> | ||
Sets the base color for the entity's effects. | Sets the base color for the entity's effects. | ||
- | //asEntityName// - the name of the entity. Wildcards * are supported.\\ | + | //asEntityName// - the name of the entity. Wildcards %%*%% are supported.\\ |
//aColor// - the color all effects will be multiplied with. | //aColor// - the color all effects will be multiplied with. | ||
- | + | <code =c++>void Entity_FadeEffectBaseColor(const tString &in asEntityName, const cColor&in aColor, float afTime); | |
- | <code=c++> | + | |
- | void Entity_FadeEffectBaseColor(const tString &in asEntityName, const cColor&in aColor, float afTime); | + | |
</code> | </code> | ||
Fades the base color for the entity's effects. | Fades the base color for the entity's effects. | ||
- | //asEntityName// - the name of the entity. Wildcards * are supported.\\ | + | //asEntityName// - the name of the entity. Wildcards %%*%% are supported.\\ |
//aColor// - the color all effects will be faded to.\\ | //aColor// - the color all effects will be faded to.\\ | ||
//afTime// - the time in seconds the fade takes to finish. | //afTime// - the time in seconds the fade takes to finish. | ||
- | + | <code =c++>void Entity_SetColorMul(const tString &in asEntityName, const cColor&in aColor); | |
- | <code=c++> | + | |
- | void Entity_SetColorMul(const tString &in asEntityName, const cColor&in aColor); | + | |
</code> | </code> | ||
Sets the color multiplier of the entity. | Sets the color multiplier of the entity. | ||
- | //asEntityName// - the name of the entity. Wildcards * are supported.\\ | + | //asEntityName// - the name of the entity. Wildcards %%*%% are supported.\\ |
//aColor// - the color to set the multiplier to. | //aColor// - the color to set the multiplier to. | ||
- | + | <code =c++>void Entity_AddForce(const tString &in asEntityName, const cVector3f &in avForce, bool abLocalSpace, bool abOnlyMainBody); | |
- | <code=c++> | + | |
- | void Entity_AddForce(const tString &in asEntityName, const cVector3f &in avForce, bool abLocalSpace, bool abOnlyMainBody); | + | |
</code> | </code> | ||
Adds a push force to the entity. | Adds a push force to the entity. | ||
- | //asEntityName// - the name of the entity. Wildcards * are supported.\\ | + | //asEntityName// - the name of the entity. Wildcards %%*%% are supported.\\ |
//avForce// - the force to add.\\ | //avForce// - the force to add.\\ | ||
//abLocalSpace// - true = local force is added relative to the rotation of the entity, false = global force is added in a world space\\ | //abLocalSpace// - true = local force is added relative to the rotation of the entity, false = global force is added in a world space\\ | ||
//abOnlyMainBody// - true = force is added only to the main body of the entity, false = force is added to all bodies of the entity. | //abOnlyMainBody// - true = force is added only to the main body of the entity, false = force is added to all bodies of the entity. | ||
- | + | <code =c++>void Entity_AddForceFromEntity(const tString &in asEntityName, const tString &in asForceEntityName, float afForce, bool abOnlyMainBody); | |
- | <code=c++> | + | |
- | void Entity_AddForceFromEntity(const tString &in asEntityName, const tString &in asForceEntityName, float afForce, bool abOnlyMainBody); | + | |
</code> | </code> | ||
Adds a push force to the entity away from another entity. | Adds a push force to the entity away from another entity. | ||
- | //asEntityName// - the name of the entity. Wildcards * are supported.\\ | + | //asEntityName// - the name of the entity. Wildcards %%*%% are supported.\\ |
//asForceEntityName// - the name of the entity to push away from.\\ | //asForceEntityName// - the name of the entity to push away from.\\ | ||
//afForce// - magnitude of the force. Negative values attract the entity to the force entity. | //afForce// - magnitude of the force. Negative values attract the entity to the force entity. | ||
- | |||
==== FogArea ==== | ==== FogArea ==== | ||
- | <code=c++> | + | <code =c++>void FogArea_SetVisible(const tString &in asFogAreaName, bool abActive); |
- | void FogArea_SetVisible(const tString &in asFogAreaName, bool abActive); | + | |
</code> | </code> | ||
Line 367: | Line 337: | ||
//asFogAreaName// - name of the fog area.\\ | //asFogAreaName// - name of the fog area.\\ | ||
//abActive// - true = active, false = inactive. | //abActive// - true = active, false = inactive. | ||
- | |||
==== Grab ==== | ==== Grab ==== | ||
- | <code=c++> | + | <code =c++>void Grab_SetForceMul(const tString& in asName, float afForceMul); |
- | void Grab_SetForceMul(const tString& in asName, float afForceMul); | + | |
</code> | </code> | ||
Line 378: | Line 346: | ||
//asName// - name of the grab prop.\\ | //asName// - name of the grab prop.\\ | ||
//afForceMul// - the new multiplier. | //afForceMul// - the new multiplier. | ||
- | |||
==== IrradianceSet ==== | ==== IrradianceSet ==== | ||
- | <code=c++> | + | <code =c++>void IrradianceSet_FadeIn(const tString &in asSet, float afTime); |
- | void IrradianceSet_FadeIn(const tString &in asSet, float afTime); | + | |
</code> | </code> | ||
Line 389: | Line 355: | ||
//asSet// - the set to fade in.\\ | //asSet// - the set to fade in.\\ | ||
//afTime// - how long it should take until the fade is done. | //afTime// - how long it should take until the fade is done. | ||
- | |||
==== Joint ==== | ==== Joint ==== | ||
- | <code=c++> | + | <code =c++> |
bool Joint_IsBroken(const tString &in asJointName); | bool Joint_IsBroken(const tString &in asJointName); | ||
</code> | </code> | ||
Line 399: | Line 364: | ||
//asJointName// - the name of the joint. | //asJointName// - the name of the joint. | ||
- | |||
==== Lamp ==== | ==== Lamp ==== | ||
- | <code=c++> | + | <code =c++>void Lamp_SetLit(const tString& in asName, bool abLit, bool abEffects); |
- | void Lamp_SetLit(const tString& in asName, bool abLit, bool abEffects); | + | |
</code> | </code> | ||
Line 411: | Line 374: | ||
//abLit// - true = lamp is lit, false = lamp is unlit.\\ | //abLit// - true = lamp is lit, false = lamp is unlit.\\ | ||
//abEffects// - whether the change should use effects associated with it. If false, the change will not be apparent to the player. | //abEffects// - whether the change should use effects associated with it. If false, the change will not be apparent to the player. | ||
- | |||
==== LensFlare ==== | ==== LensFlare ==== | ||
- | <code=c++> | + | <code =c++>void LensFlare_SetVisible(const tString &in asLensFlareName, bool abVisible); |
- | void LensFlare_SetVisible(const tString &in asLensFlareName, bool abVisible); | + | |
</code> | </code> | ||
Sets if a lens flare should be rendered or not. | Sets if a lens flare should be rendered or not. | ||
- | //asLensFlareName// - name of lens flare. Wildcards * supported.\\ | + | //asLensFlareName// - name of lens flare. Wildcards %%*%% supported.\\ |
//abVisible// - true = visible, false = invisible. | //abVisible// - true = visible, false = invisible. | ||
- | |||
==== LevelDoor ==== | ==== LevelDoor ==== | ||
- | <code=c++> | + | <code =c++>void LevelDoor_SetLocked(const tString& in asName, bool abState); |
- | void LevelDoor_SetLocked(const tString& in asName, bool abState); | + | |
</code> | </code> | ||
Line 433: | Line 392: | ||
//asName// - name of the level door.\\ | //asName// - name of the level door.\\ | ||
//abState// - true = locked, false = unlocked. | //abState// - true = locked, false = unlocked. | ||
- | |||
==== Lever ==== | ==== Lever ==== | ||
- | <code=c++> | + | <code =c++>int Lever_GetState(const tString& in asName); |
- | int Lever_GetState(const tString& in asName); | + | |
</code> | </code> | ||
Line 448: | Line 405: | ||
==== Light ==== | ==== Light ==== | ||
- | <code=c++> | + | <code =c++>void Light_FadeTo(const tString &in asLightName, const cColor &in acColor, float afRadius, float afTime); |
- | void Light_FadeTo(const tString &in asLightName, const cColor &in acColor, float afRadius, float afTime); | + | |
</code> | </code> | ||
Fades one or more light objects to a specified color and radius. | Fades one or more light objects to a specified color and radius. | ||
- | //asLightName// - name of the light(s). Wildcards * supported.\\ | + | //asLightName// - name of the light(s). Wildcards %%*%% supported.\\ |
//acColor// - the color to fade to.\\ | //acColor// - the color to fade to.\\ | ||
//afRadius// - the radius to fade to. If lower than 0, the current radius is used.\\ | //afRadius// - the radius to fade to. If lower than 0, the current radius is used.\\ | ||
//afTime// - how long it should take until the fade is done. | //afTime// - how long it should take until the fade is done. | ||
- | |||
==== Map ==== | ==== Map ==== | ||
- | <code=c++> | + | <code =c++> |
bool Map_GetParticleSystemArray(const tString &in asName, array<cParticleSystem@> &inout avOutParticles); | bool Map_GetParticleSystemArray(const tString &in asName, array<cParticleSystem@> &inout avOutParticles); | ||
</code> | </code> | ||
Line 467: | Line 422: | ||
Creates an array of particle systems with a given name. | Creates an array of particle systems with a given name. | ||
- | //asName// - name of particle systems. Wildcards * supported.\\ | + | //asName// - name of particle systems. Wildcards %%*%% supported.\\ |
//avOutParticles// - reference to array that will be filled with particle systems. | //avOutParticles// - reference to array that will be filled with particle systems. | ||
- | |||
==== Material ==== | ==== Material ==== | ||
- | <code=c++> | + | <code =c++>void Material_Preload(const tString &in asFile); |
- | void Material_Preload(const tString &in asFile); | + | |
</code> | </code> | ||
Line 479: | Line 432: | ||
//asFile// - the .mat material file to preload. | //asFile// - the .mat material file to preload. | ||
- | |||
==== Meter ==== | ==== Meter ==== | ||
- | <code=c++> | + | <code =c++>void Meter_SetState(const tString& in asName, float afState, bool abFadeToState = true); |
- | void Meter_SetState(const tString& in asName, float afState, bool abFadeToState = true); | + | |
</code> | </code> | ||
Line 489: | Line 440: | ||
//asName// - name of meter object.\\ | //asName// - name of meter object.\\ | ||
- | //afState// - percentage of where the needle should be. 0-1 (minimum position - maximum position). | + | //afState// - percentage of where the needle should be. 0-1 (minimum position - maximum position). //abFadeToState// - if true, then the needle will fade to the state instead of skipping to it. |
- | //abFadeToState// - if true, then the needle will fade to the state instead of skipping to it. | + | |
==== MoveObject ==== | ==== MoveObject ==== | ||
- | <code=c++> | + | <code =c++>void MoveObject_SetState(const tString& in asName, float afState); |
- | void MoveObject_SetState(const tString& in asName, float afState); | + | |
</code> | </code> | ||
Line 502: | Line 450: | ||
//asName// - name of the move object.\\ | //asName// - name of the move object.\\ | ||
//afState// - the state to set the move object to at speeds defined in the entity file. | //afState// - the state to set the move object to at speeds defined in the entity file. | ||
- | |||
==== MovingButton ==== | ==== MovingButton ==== | ||
- | <code=c++> | + | <code =c++>void MovingButton_SetSwitchedOn(const tString& in asName, bool abState, bool abEffects); |
- | void MovingButton_SetSwitchedOn(const tString& in asName, bool abState, bool abEffects); | + | |
</code> | </code> | ||
Line 514: | Line 460: | ||
//abState// - true = on, false = off.\\ | //abState// - true = on, false = off.\\ | ||
//abEffects// - whether the change should use effects associated with it. If false, the player will not be apparent to the change. | //abEffects// - whether the change should use effects associated with it. If false, the player will not be apparent to the change. | ||
- | |||
==== ParticleSystem ==== | ==== ParticleSystem ==== | ||
- | <code=c++> | + | <code =c++> |
cParticleSystem@ ParticleSystem_CreateAtEntity(const tString &in asPSName, const tString &in asPSFile, const tString &in asEntity, bool abAttach); | cParticleSystem@ ParticleSystem_CreateAtEntity(const tString &in asPSName, const tString &in asPSFile, const tString &in asEntity, bool abAttach); | ||
</code> | </code> | ||
Line 532: | Line 477: | ||
==== PhysicsSlideDoor ==== | ==== PhysicsSlideDoor ==== | ||
- | <code=c++> | + | <code =c++> |
bool PhysicsSlideDoor_GetClosed(const tString& in asName); | bool PhysicsSlideDoor_GetClosed(const tString& in asName); | ||
</code> | </code> | ||
Line 539: | Line 484: | ||
//asName// - name of the door. | //asName// - name of the door. | ||
- | |||
==== Prop ==== | ==== Prop ==== | ||
- | <code=c++> | + | <code =c++>void Prop_SetHealth(const tString &in asPropName, float afHealth); |
- | void Prop_SetHealth(const tString &in asPropName, float afHealth); | + | |
</code> | </code> | ||
Sets the health of a prop. Can be used to destroy objects. | Sets the health of a prop. Can be used to destroy objects. | ||
- | //asPropName// - name of the prop. Wildcards * supported.\\ | + | //asPropName// - name of the prop. Wildcards %%*%% supported.\\ |
//afHealth// - the health to set. | //afHealth// - the health to set. | ||
- | |||
==== Readable ==== | ==== Readable ==== | ||
- | <code=c++> | + | <code =c++>void Readable_SetCloseCallback(const tString &in asName, const tString &in asCallback); |
- | void Readable_SetCloseCallback(const tString &in asName, const tString &in asCallback); | + | |
</code> | </code> | ||
Line 562: | Line 503: | ||
//asCallback// - name of the callback function. | //asCallback// - name of the callback function. | ||
- | Callback syntax: | + | Callback syntax: **void Function(const tString &in asEntity)** |
- | **void Function(const tString &in asEntity)** | + | |
==== Slide ==== | ==== Slide ==== | ||
- | <code=c++> | + | <code =c++>void Slide_SetSlideAmount(const tString& in asName, float afAmount); |
- | void Slide_SetSlideAmount(const tString& in asName, float afAmount); | + | |
</code> | </code> | ||
Line 575: | Line 513: | ||
//asName// - name of the prop.\\ | //asName// - name of the prop.\\ | ||
//afAmount// - the slide amount. | //afAmount// - the slide amount. | ||
- | |||
==== SlideDoor ==== | ==== SlideDoor ==== | ||
- | <code=c++> | + | <code =c++>void SlideDoor_SetClosed(const tString& in asName, bool abClosed, bool abInstant = false); |
- | void SlideDoor_SetClosed(const tString& in asName, bool abClosed, bool abInstant = false); | + | |
</code> | </code> | ||
Line 587: | Line 523: | ||
//abClosed// - true = close, false = open.\\ | //abClosed// - true = close, false = open.\\ | ||
//abInstant// (optional) - whether the door should slide to the correct state or just have the new position set instantly. | //abInstant// (optional) - whether the door should slide to the correct state or just have the new position set instantly. | ||
- | |||
==== SwingDoor ==== | ==== SwingDoor ==== | ||
- | <code=c++> | + | <code =c++>void SwingDoor_SetOpenAmount(const tString& in asName, float afOpenAmount); |
- | void SwingDoor_SetOpenAmount(const tString& in asName, float afOpenAmount); | + | |
</code> | </code> | ||
Sets a swing door to a specific open state instantly. | Sets a swing door to a specific open state instantly. | ||
- | //asName// - name of the prop. Wildcards * supported.\\ | + | //asName// - name of the prop. Wildcards %%*%% supported.\\ |
//afOpenAmount// - 0 = closed, 1 = completely open. 0.5f = half state. | //afOpenAmount// - 0 = closed, 1 = completely open. 0.5f = half state. | ||
- | |||
==== Terminal ==== | ==== Terminal ==== | ||
- | <code=c++> | + | <code =c++>void Terminal_SetAllowInteraction(const tString& in asName, bool abX); |
- | void Terminal_SetAllowInteraction(const tString& in asName, bool abX); | + | |
</code> | </code> | ||
Sets whether the terminal should allow interactions from the player. | Sets whether the terminal should allow interactions from the player. | ||
- | //asName// - name of the terminal. Wildcards * are supported.\\ | + | //asName// - name of the terminal. Wildcards %%*%% are supported.\\ |
//abX// - true = allowed, false = denied. | //abX// - true = allowed, false = denied. | ||
- | |||
==== Tool ==== | ==== Tool ==== | ||
- | <code=c++> | + | <code =c++>void Tool_SetAutoHideAfterPickup(const tString &in asName, bool abX); |
- | void Tool_SetAutoHideAfterPickup(const tString &in asName, bool abX); | + | |
</code> | </code> | ||
Line 620: | Line 550: | ||
//asName// - name of the tool.\\ | //asName// - name of the tool.\\ | ||
//abX// - true = hide automatically, false = do not hide. | //abX// - true = hide automatically, false = do not hide. | ||
- | |||
==== Wheel ==== | ==== Wheel ==== | ||
- | <code=c++> | + | <code =c++>int Wheel_GetState(const tString& in asName); |
- | int Wheel_GetState(const tString& in asName); | + | |
</code> | </code> | ||
Line 750: | Line 678: | ||
//asEntityName// - name of the entity with the HeadTracker.\\ | //asEntityName// - name of the entity with the HeadTracker.\\ | ||
//asTargetEntityName// - The target of the tracking. | //asTargetEntityName// - The target of the tracking. | ||
- | <code =c++> | + | <code =c++>void NPC_SetVoiceName(const tString &in asNpcName, const tString &in asVoiceName); |
- | void NPC_SetVoiceName(const tString &in asNpcName, const tString &in asVoiceName); | + | |
</code> | </code> | ||