Reaction Forces/Modules and Functions
This article explains useful Modules and Functions you can use in your mission making.
Modules
Wildfire
Creates a fire with defined size and intensity that can be extinguished with the helicopter water bucket. If synchronised to each other, the module with the highest fire intensity will slowly increase lower intensity fire modules. If you synchronize Wildfire modules in Eden Editor, the fire intensity will spread to synchronised modules. This "influence" system will not spread everything randomly but only happens on predetermined/placed modules so it won't go uncontrollable.
Arugments
Fire Intensity
The intensity of fire. 0% is no fire, 100% is very intense fire that requires more water to be put out.
Size
Determines the size of the fire area.
On Intensity Changed
A code that will run upon an intensity change e.g. a bucket water has landed on the fire.
Where:
- _module: the module object
- _intensityBefore: the intensity before the change
- _intensityAfter: the intensity after the change
You can use a number between 0 to 1 to overwrite the intensity.
On Extinguishment
A code that will run upon the fire has been extinguished.
Where:
- _module: the module object
Note
The extinguished wildfire module will not be deleted automatically. You can use deleteVehicle to remove the module and effects. If the simulation is disabled (enableSimulation) the influence system will stop to receive nearby wildfire's intensity.
See also
Hit Indicator
Enables audio cues when hitting and taking down enemy soldiers. The sound is only played if player successfully hit a target.
Arguments
Headshots only
Plays the sound only when you have done a headshot.
Scream on death
Plays a scream voice upon you killed a target.
Functions
lxRF_fnc_bucket
Controls Helicopter Bucket functionalities.
Syntax
- bucketObject - Object. Either of "WaterBucket_1000L_Red_RF" or "WaterBucket_1000L_Yellow_RF" type of object should be used.
- mode - String.
- "ReleaseWater" - releases the current water.
- "setFill" - sets the water level.
- "aimPos" - returns the estimated water aiming/land position.
- arguments - see below.
- if "setFill",
- Number - 0 to 1 where 0 is empty and 1 is full.
- if "setFill",
Return value
- Position - Array if "aimPos" mode.
Examples
- Fills the bucket:
- Perform a waterbomb:
lxRF_fnc_triggerWater
Use in a condition of a trigger so the trigger will detect a water drop from a bucket.
Examples
- In a trigger's Condition:
lxRF_fnc_wildFire
Controls Wildfire module's functionalities.
Syntax
- wildfireModule - Module Object.
- mode - String.
- "setIntensity" - sets the wildfire's intensity level. (Run globally aka remoteExec or remoteExecCall to apply the changes to all client!)
- "getIntensity" - gets the wildfire's intensity level.
- "DebugOn" - enables the debug system on the module. The debulg will show the position of the module, intensity and area in 3D space and map.
- "DebugOff" - disables the debug system on the module.
Return Value
- Intensity - Number, 0 to 1 if "getIntensity" mode.
Alternative Syntax
- position - Array.
- mode - String.
- "fireCreate" - sets the wildfire's intensity level.
- arguments - (Optional) Array.
- intensity - (Optional) Number. Sets the initial intensity in 0 to 1. Default: 0.3
- area - (Optional) Number. Sets the fire area in 1 to 50 in meters. Default: 5
- onExtinguishedScript - (Optional) String. See On Intensity Changed. Default: "true"
- onIntensityChangedScript - (Optional) String. See On Extinguishment. Default: "true"
Return Value
- module - Created Wildfire module.
Alternative Syntax 2
- mode - String.
- "DebugOn" - Enables the debug on every Wildfire modules.
- "DebugOff" - Disables the debug on every Wildfire modules.
- "AutoConnect" - In Eden Editor only: sets the synchronisation network on every selected Wildfire modules, depends on the distance between and area, so spread/influence system will work.
lxRF_fnc_mapContextMenu
Generates a context menu upon a mouse click on the map.
Syntax
Alternative Syntax
- LMB - Boolean. true to enable the menu upon a Left Click.
- RMB - Boolean. true to enable the menu upon a Right Click.
An item is defined in this syntax:
- text - String, item text/title
- action - Code, action to execute upon clicking this item
- icon - String, icon path to be shown in the item
- tooltip - String, tooltip to be shown when mouse over the item
- enabled - Boolean, true to enable this item, false to disable so cannot click the item
- bgCol - Array, format [R, G, B, A], sets the background color of the item
- textCol - Array, format [R, G, B, A], sets the item text color
- itemExpand - Array, define nested items within this array
lxRF_fnc_mapContextMenu_menu is a missionNamespace variable. If the variable is empty [] nothing will happen
Event Handlers
To run an EH before the menu generation:
- _map - Control, the map control
- _mPos - Array, the mouse position
Useful to change the items depends on the context. To run an EH after the menu generation:
- _map - Control, the map control
- _mPos - Array, the mouse position
- _disp - Display, the created display
- _ctrls - Array, the button controls
Useful to change the GUI elements' preferences if necessary.
lxRF_fnc_customGameOptions
Gets or sets the custom game options in RF's custom game options framework.
Syntax
- mode - String
- "set" - Sets the option setting.
- "get" - Gets the option setting.
- "forceGet" - Gets the option setting. This will not consider the MP server's setting but only your profile's preference.
- setDefault - (Optional) Boolean, if "get" or "forceGet" sets the default state and save into the profile.
Return Value
- value - Number, if "get" or "forceGet"
See also
lxRF_fnc_openCustomConfig
Use this to update the Dedicated server's setting to overwrite everyone's setting. You have to be an admin to use this.
Custom Game Options Framework
In Reaction Forces, we introduced a framework to add game options. You can access the custom category in regular Game Options screen. Also the options are very moddable via a config.
class lxRF_customDifficultyOptions
{
// this will be the variable header
class yourTag
{
displayName = "Your Options";
class Options
{
// this will be the variable suffix
// so will be saved into profile with the name yourTag_combo in this case
class combo
{
displayName = "combo";
type = "combo";
optionPicture = "something_co.paa";
optionDescription = "desc";
class items
{
class first
{
displayName = "first";
value = 0; // this variable will be stored into the profile
};
class second
{
displayName = "second";
value = 1;
};
class third
{
displayName = "third";
value = 2;
};
};
};
class checkbox
{
displayName = "checkbox";
type = "checkBox"; // 0 or 1
};
class slider
{
displayName = "slider";
type = "slider"; // 0 to 1
};
};
};
};