Alien Entity Behavior – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "Kategoria:Arma 3: Editing The information on this page could be considered a spoiler for the "First Contact" campaign ---- Kategoria:Arma 3: Editing <br /> Kategori...")
 
m (Some wiki formatting)
 
(26 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Kategoria:Arma 3: Editing]]
{{TOC|side}}
The information on this page could be considered a spoiler for the "First Contact" campaign
----
[[Kategoria:Arma 3: Editing]]
<br />


[[Kategoria:Arma 3: Editing]]
{{Feature|spoiler|"First Contact" campaign of [[Arma 3 Contact]]}}
<br />
{{GVI|arma3|1.94}}


= Overview =
The small Alien Entity (AE - referred to as Drone in technical systems) is used by ET for surveillance, reconnaissance, research, and defense as needed. It is made from unknown and supremely tough materials.
The small Alien Entity (AE - referred to as Drone in technical systems) is used by ET for surveillance, reconnaissance, research, and defense as needed. It is made from unknown and supremely tough materials. The entity has local control of gravity, and it moves in pulses. It can collect and utilize almost any type of matter from the local environment. The AE appears to communicate on the broad electromagnetic spectrum.
The entity has local control of gravity, and it moves in pulses. It can collect and utilize almost any type of matter from the local environment. The AE appears to communicate on the broad electromagnetic spectrum.


Around its central solid hull, the entity can hold one or more modules in its orbit. These do not themselves have propulsion, so they cannot move out of the entity's sphere of influence. Various types of module exist:
Around its central solid hull, the entity can hold one or more modules in its orbit. These do not themselves have propulsion, so they cannot move out of the entity's sphere of influence. Various types of module exist:
Line 30: Line 26:
At this time there are no known vulnerabilities to Earth weapons, and the entity typically withdraws before any major damage can be inflicted.
At this time there are no known vulnerabilities to Earth weapons, and the entity typically withdraws before any major damage can be inflicted.


= Drone =


=== Drone init ===
== Drone ==
After Alien Entity (Small) is placed on the map, you need to execute following functions before you get your drone fully operational.


==== Setting movement grid ====
=== Drone Init ===
Drone is only able to move in generated grid. It can be generated on fly via '''bin_fnc_set[[Object]]Grid''' or by using movement grid module.


[[Image:contactMovementGrid.png||600px]]
After an Alien Entity (Small) is placed on the map, you need to execute the following functions before you get your drone fully operational.


Syntax:  
==== Setting Movement Grid ====
{{Informative|[drone, position, cellSizeX, cellSizeY, cellSizeZ, resolutionX, resolutionY, resolutionZ] call '''bin_fnc_set[[Object]]Grid''';}}
Drone is only able to move in a generated grid. It can be generated on-the-fly via '''BIN_fnc_setObjectGrid''' or by using a movement grid module.
 
[[File:contactMovementGrid.png||600px]]
 
Syntax:
<sqf>[drone, positionATL, cellSizeX, cellSizeY, cellSizeZ, resolutionX, resolutionY, resolutionZ] call BIN_fnc_setObjectGrid;</sqf>


Parameters:
Parameters:


* '''drone''': [[Object]] - Object to which grid is attached
* '''drone''': [[Object]] - object to which the grid is attached.
* '''position''': [[Array]] - PositionATL where drone grid should be created
* '''positionATL''': [[Array]] - [[Position#PositionATL|PositionATL]] where the drone grid should be created.
* '''cellSizeX''' (''Optional'') - [[Number]] - size of movement cell in x axis (meters). Default 4
* '''cellSizeX''': [[Number]] - (Optional, default 4) size of movement cells in the X axis (meters).
* '''cellSizeY''' (''Optional'') - [[Number]] - size of movement cell in y axis (meters). Default 4
* '''cellSizeY''': [[Number]] - (Optional, default 4) size of movement cells in the Y axis (meters).
* '''cellSizeZ''' (''Optional'') - [[Number]] - size of movement cell in z axis (meters). Default 16
* '''cellSizeZ''': [[Number]] - (Optional, default 16) size of movement cells in the Z axis (meters).
* '''resolutionX''' (''Optional''''')-''' [[Number]] - number of cells in x axis. Default 20
* '''resolutionX''': [[Number]] - (Optional, default 20) number of cells in the X axis.
* '''resolutionY''' (''Optional'') - [[Number]] - number of cells in y axis. Default 20
* '''resolutionY''': [[Number]] - (Optional, default 20) number of cells in the Y axis.
* '''resolutionZ''' (''Optional'') - [[Number]] - number of cells in z axis. Default 3
* '''resolutionZ''': [[Number]] - (Optional, default 3) number of cells in the Z axis.


==== Setting movement properties ====
==== Setting Movement Properties ====
The way drone moves can be changed via following function. List of all available movement types is listed in section below
The way the drone moves can be changed via the following function. A list of all available movement types is listed in the section below.


Syntax:
Syntax:
{{Informative|[bin_drone, movementProperties] call '''bin_fnc_setMoveProperties''';}}
<sqf>[bin_drone, movementProperties] call BIN_fnc_setMoveProperties;</sqf>


Parameters:
Parameters:


* '''drone''': [[Object]] - [[Object]] to which movement properties are attached
* '''drone''': [[Object]] - [[Object]] to which the movement properties are attached.
* '''movementProperties''': [[String]] - Name of movement class
* '''movementProperties''': [[String]] - Name of the movement class.


==== Initializing drone scripted sound system ====
==== Initialising Drone Scripted Sound System ====
Syntax:  
Syntax:
{{Informative|[drone] call '''bin_fnc_soundDrone''';}}
<sqf>[drone] call BIN_fnc_soundDrone;</sqf>


Parameters:
Parameters:


* '''drone''': [[Object]] - [[Object]] to which sound system is attached
* '''drone''': [[Object]] - [[Object]] to which the sound system is attached.


==== Initializing drone behavior system ====
==== Initialising Drone Behavior System ====
Syntax:  
Syntax:
{{Informative|[drone, behaviorType] call '''bin_fnc_behaviorInit''';}}
<sqf>[drone, behaviorType] call BIN_fnc_behaviorInit;</sqf>


Parameters:
Parameters:


* '''drone''': [[Object]] - [[Object]] to which movement properties are attached
* '''drone''': [[Object]] - [[Object]] to which the movement properties are attached.
* '''behaviorType''': [[String]] - Name of behavior type. Can be either "''Drone''" or "''DroneCombat''". Default  behavior is "''Drone''"
* '''behaviorType''': [[String]] - (Optional, default "Drone") name of the behavior type, can be either "Drone" or "DroneCombat".
 
==== Example Code ====
<sqf>
[bin_drone, "Drone"] call BIN_fnc_behaviorInit;
[bin_drone, "Drone"] call BIN_fnc_setMoveProperties;
[bin_drone, getPosATL bin_drone, nil, nil, nil, 5, 5, 3] call BIN_fnc_setObjectGrid;
[bin_drone] call BIN_fnc_soundDrone;
</sqf>


==== Example code ====
=== Switching Behaviors ===
{| class="wikitable"
|
[bin_drone,"Drone"] call bin_fnc_behaviorInit;
[bin_drone,"Drone"] call bin_fnc_setMoveProperties;
[bin_drone,position bin_drone,nil,nil,nil,5,5,3] call bin_fnc_set[[Object]]Grid;
[bin_drone] call bin_fnc_soundDrone;
|}


=== Switching behaviors ===
Behaviors listed below can be used with '''BIN_fnc_setBehavior''' & '''BIN_fnc_setBehaviorCoef'''.
Behaviors listed below can be used with '''bin_fnc_setBehavior''' & '''bin_fnc_setBehaviorCoef.'''  


'''bin_fnc_setBehavior''' is using following syntax:
'''BIN_fnc_setBehavior''' is using the following syntax:
{{Informative|[drone, behaviorName,parameters,terminate,interrupt] call '''bin_fnc_setBehavior;'''}}
<sqf>[drone, behaviorName, parameters, terminateBehaviour, interrupt] call BIN_fnc_setBehavior;</sqf>
Parameters:
Parameters:


* '''drone''': [[Object]] - [[Object]] to which movement properties are attached
* '''drone''': [[Object]] - object to which the movement properties are attached.
* '''behaviorName''': [[String]] - Name of behavior type. Can be either "''Drone''" or "''DroneCombat''". Default  behavior is "''Drone''"
* '''behaviorName''': [[String]] - (Optional, default "Drone") name of the behavior type. Can be either "Drone" or "DroneCombat".
* '''parameters''' (''Optional''): [[Array]] - Optional parameters which can be passed to behavior. Default empty array
* '''parameters''': [[Array]] - (Optional, default []) parameters which can be passed to the behavior.
* '''terminate''' (''Optional''): [[Boolean]] - If true, currently executed behavior will be terminated and new one will be executed right after termination of existing one is completed. Default false
* '''terminateBehaviour''': [[Boolean]] - (Optional, default [[false]]) if true, the currently executed behaviour will be terminated and a new one will be executed right after termination of the existing one is completed. The default is false.
* '''interrupt''' (''Optional''): [[Boolean]] - Determines if behavior should terminated immediately. In case of i.e. research behavior it means that instead of gently putting back scanned object, it will be dropped on ground right away. Default false
* '''interrupt''': [[Boolean]] - (Optional, default [[false]]) determines if behavior should be terminated immediately. In case of e.g. research behavior it means that instead of gently putting back a scanned object, it will be dropped to the ground right away. The default is false.


Example:
Example:


==== List of available behaviors ====
==== List of Available Behaviors ====
{| class="wikitable"
{| class="wikitable"
!Name
! Name
!Description
! Description
! colspan="1" |Available parameters
! Available parameters
|-
|-
|Patrol
| Patrol
|Drone will move around looking for enemy contacts
| Drone will move around looking for enemy contacts
| colspan="1" |
|
|-
|-
| colspan="1" |Investigate
| Investigate
| colspan="1" |Drone will look at nearest unit
| Drone will look at the nearest unit
| colspan="1" |0: target (Optional): [[Object]] - object at which Drone will look at
| 0: target (Optional): [[Object]] - object which Drone will look at
|-
|-
|GravityCannon
| GravityCannon
|If combat modules are present, Drone will use them to engage either random nearby target or
| If combat modules are are present, Drone will use them to engage either a random nearby target
| colspan="1" |0: target (Optional): [[Object]] - target for gravity cannon
| <nowiki/>
0: target: [[Object]] - (Optional) target for gravity cannon


1: weapon (Optional): [[String]] - can be '''GravityShotgun_01, GravityCannon_01 or GravityCannon_01_Precise'''
1: weapon: [[String]] - (Optional) can be {{hl|GravityShotgun_01}}, {{hl|GravityCannon_01}} or {{hl|GravityCannon_01_Precise}}
|-
|-
|MissileSwarm
| MissileSwarm
|Drone will use area of effect weapon releasing 5 missile like projectiles at nearby targets
| Drone will use an area of effect weapon releasing 5 missile like projectiles at nearby targets
| colspan="1" |
|
|-
|-
|Jump
| Jump
|Drone will perform jump to specified location
| Drone will perform a jump to a specified location
| colspan="1" |0: position - [[Array]] or [[String]] - PositionATL - position to move. If string is provided, Drone will jump to precalculated grid located in provided file.
| <nowiki/>
0: position - [[Array]] or [[String]] - PositionATL - position to move. If a string is provided, Drone will jump to a precalculated grid located in the provided file.


1: charge (Optional) - [[Boolean]] - optional parameters controling if drone should be charging power before making jump. Default false.
1: charge (Optional) - [[Boolean]] - optional parameters controlling if Drone should be charging power before making a jump. The default is false.


2: fast (Optional) - drone will jump up straight away if it's set to true, default false. If number is provided, drone will pick fast jump if distance is above that value.
2: fast (Optional) - Drone will jump up straight away if it is set to true; the default is false. If a number is provided, Drone will pick fast jump if the distance is above that value.
|-
|-
|Avoid
| Avoid
|Drone will try to avoid contact with nearby units by moving away from them
| Drone will try to avoid contact with nearby units by moving away from them
| colspan="1" |
|
|-
|-
|Research
|Research
|Drone will perform research behavior on nearby objects
|Drone will perform research behavior on nearby objects
| colspan="1" |0: target (Optional) - [[Object]] - target to scan. If not specified drone will try to pick some random object in available grid.
| <nowiki/>
0: target (Optional) - [[Object]] - target to scan. If not specified Drone will try to pick some random object in the available grid.


1: endless (Optional) - [[Boolean]] - research will be performed till it's interrupted by script
1: endless (Optional) - [[Boolean]] - research will be performed until it is interrupted by script.
|-
|-
|Light
| Light
|Drone will use light burst weapon and try to move away from incoming fire
| Drone will use its light burst countermeasure and try to move away from incoming fire
| colspan="1" |
|
|-
|-
|GravityBurst
| GravityBurst
|Drone will use gravity burst when units are nearby
| Drone will use gravity burst when units are nearby
| colspan="1" |
|
|-
|-
| colspan="1" |CollectMatter
| CollectMatter
| colspan="1" |Drone will collect 4 matter balls which serves as gravity cannon magazines
| Drone will collect 4 matter balls which serve as gravity cannon magazines
| colspan="1" |
|
|-
|-
| colspan="1" |Reposition
| Reposition
| colspan="1" |Drone will move 100 meters away from incoming fire
| Drone will move 100 meters away from incoming fire
| colspan="1" |
|
|}
|}


=== Scripted Event Handlers ===
=== Scripted Event Handlers ===
{| class="wikitable"
{| class="wikitable"
!Name
! Name
!Output
! Output
!Description
! Description
|-
|-
|behaviorStarted
| behaviorStarted
|0: [[Object]]
| <nowiki/>
0: [[Object]]


1: Behavior name
1: Behavior name
|Triggers when new behavior FSM is triggered
| Triggers when a new behavior FSM is triggered
|-
|-
|behaviorCompleted
| behaviorCompleted
|0: [[Object]]
| <nowiki/>
0: [[Object]]


1: Behavior name
1: Behavior name
|Triggers when new behavior FSM is completed. It will be also fired when behavior was interrupted!
| Triggers when a new behavior FSM is completed. It will be also fired when behavior was interrupted!
|}
{| class="wikitable"
|Example code:
{| class="wikitable"
|
Drone_EH = [missionnamespace, "behaviorCompleted", {
    params["_object","_behavior"];
    systemChat format["[[Object]]: %1, Behavior: %2",_object,_behavior];   
}] call bis_fnc_addScriptedEventHandler;
|}
|}
|}


=== Editing move properties ===
Example code:
Movement properties can be modified with in game editor. In order to access it, type following code in console & execute it
<sqf>
Drone_EH = [missionNamespace, "behaviorCompleted", {
params["_object","_behavior"];
systemChat format["Object: %1, Behavior: %2", _object, _behavior];
}] call BIS_fnc_addScriptedEventHandler;
</sqf>
 
=== Editing Move Properties ===


{{Informative|call '''bin_fnc_bezierEditor'''}}
Movement properties can be modified within the game editor. In order to access them, type the following code in console and execute it:
<sqf>call BIN_fnc_bezierEditor;</sqf>


[[Image:contact bezier curve.png||600px]]
[[File:contact bezier curve.png|600px]]


You can add points to that graph by double clicking on middle area. It's possible to move those points once they are created. When you are are ready, press "Copy" button and paste result to your config. It's not possible right now to read those values from mission files at the moment.
You can add points to that graph by double clicking on the middle area. It is possible to move those points once they are created. When you are are ready, press the "Copy" button and paste the result to your config.
It is not possible to obtain these values from mission files at the moment.
<spoiler text="Show movement config">
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
class Movement
class Movement
{
{
class Templates
class Templates
{
{
#define CURVE <nowiki>{{0,0,0},{0.3,0.9,0},{0.5,0.9,0},{0.5,1.070,0},{0.5,1,0}}</nowiki>
#define CURVE { { 0, 0, 0 }, { 0.3, 0.9, 0 }, { 0.5, 0.9, 0 }, { 0.5, 1.070, 0 }, { 0.5, 1, 0 } }
#define CURVE_LONG <nowiki>{{0,0,0},{0.3,0.9,0},{0.5,0.9,0},{0.5,1.024,0},{0.5,1,0}}</nowiki>
#define CURVE_LONG { { 0, 0, 0 }, { 0.3, 0.9, 0 }, { 0.5, 0.9, 0 }, { 0.5, 1.024, 0 }, { 0.5, 1, 0 } }
#define CURVE_END <nowiki>{{0,0,0},{0.5,1,0},{0.7,1,0},{1,1,0}}</nowiki>
#define CURVE_END { { 0, 0, 0 }, { 0.5, 1, 0 }, { 0.7, 1, 0 }, { 1, 1, 0 } }
#define CURVE_ROT <nowiki>{{0,0,0},{0,2,0},{0.9,1,0},{1,1,0}}</nowiki>
#define CURVE_ROT { { 0, 0, 0 }, { 0, 2, 0 }, { 0.9, 1, 0 }, { 1, 1, 0 } }
 
class Default
class Default
{
{
speed = 8; // Average travel speed in m/s
speed = 8; // average travel speed in m/s
pulseDistance = 100; // Distance between pulses
pulseDistance = 100; // distance between pulses
maxPulseDistanceFar = 100; // Maximum distance between pulses in long-distance travel
maxPulseDistanceFar = 100; // maximum distance between pulses in long-distance travel
maxPulseDistanceClose = 3; // Maximum distance between pulses in short-distance travel
maxPulseDistanceClose = 3; // maximum distance between pulses in short-distance travel
altitude = 100; // Altitude above terrain level for long jumps
altitude = 100; // altitude above terrain level for long jumps
curve[] = <nowiki>{{0,0},{1,1}}</nowiki>; // Movement curve
curve[] = { { 0, 0 }, { 1, 1 } }; // movement curve
curveEnd[] = <nowiki>{{0,0},{1,1}}</nowiki>; // Movement curve on the last waypoint (smoother settle-in)
curveEnd[] = { { 0, 0 }, { 1, 1 } }; // movement curve on the last waypoint (smoother settle-in)
curveRotation[] = <nowiki>{{0,0,0},{1,0,0},{0,1,0},{1,1,0}}</nowiki>;
curveRotation[] = { { 0, 0, 0 }, { 1, 0, 0 }, { 0, 1, 0 }, { 1, 1, 0 } };
};
};
class Drone: Default
 
{
class Drone : Default
speed = 7;
{
curve[] = CURVE;
speed = 7;
curveEnd[] = CURVE_END;
curve[] = CURVE;
curveRotation[] = CURVE_ROT;
curveEnd[] = CURVE_END;
};
curveRotation[] = CURVE_ROT;
class Drone_Intro3: Drone
};
{
 
speed = 12;
class Drone_Intro3 : Drone
pulseDistance = 550;
{
maxPulseDistanceFar = 550;
speed = 12;
};
pulseDistance = 550;
class Drone_Long: Drone
maxPulseDistanceFar = 550;
{
};
speed = 14;
 
pulseDistance = 250;
class Drone_Long : Drone
maxPulseDistanceFar = 550;
{
curve[] = CURVE_LONG;
speed = 14;
};
pulseDistance = 250;
class CombatDrone: Default
maxPulseDistanceFar = 550;
{
curve[] = CURVE_LONG;
speed = 14;
};
maxPulseDistanceFar = 40;
 
curve[] = CURVE;
class CombatDrone : Default
curveEnd[] = CURVE_END;
{
curveRotation[] = CURVE_ROT;
speed = 14;
};
maxPulseDistanceFar = 40;
class CombatDrone_Fast: Default
curve[] = CURVE;
{
curveEnd[] = CURVE_END;
speed = 28;
curveRotation[] = CURVE_ROT;
maxPulseDistanceFar = 40;
};
curve[] = CURVE;
 
curveEnd[] = CURVE_END;
class CombatDrone_Fast : Default
curveRotation[] = CURVE_ROT;
{
};
speed = 28;
class CombatDrone_Long: Default
maxPulseDistanceFar = 40;
{
curve[] = CURVE;
speed = 28;
curveEnd[] = CURVE_END;
pulseDistance = 500;
curveRotation[] = CURVE_ROT;
maxPulseDistanceFar = 1000;
};
curve[] = CURVE_LONG;
 
curveEnd[] = CURVE_END;
class CombatDrone_Long : Default
curveRotation[] = CURVE_ROT;
{
};
speed = 28;
class ModularShip: Default
pulseDistance = 500;
{
maxPulseDistanceFar = 1000;
speed = 2;
curve[] = CURVE_LONG;
curve[] = CURVE;
curveEnd[] = CURVE_END;
curveEnd[] = CURVE_END;
curveRotation[] = CURVE_ROT;
curveRotation[] = CURVE_ROT;
};
};
 
};
class ModularShip : Default
{
speed = 2;
curve[] = CURVE;
curveEnd[] = CURVE_END;
curveRotation[] = CURVE_ROT;
};
};
};
</syntaxhighlight>
</syntaxhighlight>
Located in a3\Functions_F_Contact\cfgContact.hpp
located in <sqf inline>configFile >> "CfgContact" >> "Movement" >> "Templates"</sqf>.
</spoiler>
 
=== Handy Functions List ===


=== Handy commands list ===
{| class="wikitable"
{| class="wikitable"
!Command
! Function
!Description
! Description
!Notes
! Notes
|-
|-
|bin_drone setVariable ["#bD",1];
| <sqf>bin_drone setVariable ["#bD", 1];</sqf>
|Set danger level on drone. Danger goes from 0 (no danger) to 1 (maximum danger)
| Set danger level on Drone. Danger goes from 0 (no danger) to 1 (maximum danger).
|
|
|-
|-
| colspan="1" |bin_drone setVariable ["#bState","Combat"]
| <sqf>bin_drone setVariable ["#bState", "Combat"];</sqf>
| colspan="1" |Sets drone behavior to selected state. Currently supported modes are "Safe" & "Combat"
| Sets Drone behavior to the selected state. The currently supported modes are "Safe" & "Combat".
| colspan="1" |
|
|-
|-
|bin_drone setVariable ["#bTarget",player];
| <sqf>bin_drone setVariable ["#bTarget", player];</sqf>
|Set target for drone gravity cannon
|Sets a target for Drone's gravity cannon
|
|
|-
|-
|[west,0] call '''bin_fnc_setTargetWeight''' - all units from side "west" will be ignored by targeting system
| <sqf>
 
[west, 0] call BIN_fnc_setTargetWeight; // all units from side "west" will be ignored by the targeting system
[player,10] call '''bin_fnc_setTargetWeight''' - Increase player chance of being targeted by drone weapons
[player, 10] call BIN_fnc_setTargetWeight; // increase player's chance of being targeted by Drone weapons
 
[bis_car, 0] call BIN_fnc_setTargetWeight // vehicle and its crew will be ignored by the targeting system
[bis_car,0] call '''bin_fnc_setTargetWeight''' - Vehicle & it's crew will be ignored by targeting system
</sqf>
|Coef to target priority - set to 0 to basically exclude drone from target selection. Function accepts group, side, vehicle or unit.
|Coef to target priority - set to 0 to basically exclude Drone from target selection. Function accepts a group, side, vehicle or unit.
|Applied to individual unit, side or vehicle - not the drone!
|Applied to the individual unit, side or vehicle - not Drone!
|-
|-
| colspan="1" |[bin_drone,"gravitycannon",[cursor[[Object]],"GravityShotgun_01"]] call '''bin_fnc_setBehavior'''
| <sqf>[bin_drone, "gravitycannon", [cursorObject, "GravityShotgun_01"] call BIN_fnc_setBehavior;</sqf>
| colspan="1" |Forces drone to target specific object
| Forces Drone to target a specific object
| colspan="1" |
|
|-
|-
| colspan="1" |[bin_drone,"gravityCannon",10] call '''bin_fnc_setBehaviorCoef''';
| <sqf>[bin_drone, "gravityCannon",10] call BIN_fnc_setBehaviorCoef;</sqf>
| colspan="1" |Change probability of picking specific behavior
| Change probability of picking a specific behavior
| colspan="1" |
|
|-
|-
| colspan="1" |[bin_module_01,player,"GravityCannon_01_Precise",false,1] call '''bin_fnc_setDroneModuleTarget''';
| <sqf>[bin_module_01, player, "GravityCannon_01_Precise", false, 1] call BIN_fnc_setDroneModuleTarget;</sqf>
| colspan="1" |Targets & fires module at player
| Targets and fires module at the player
| colspan="1" |
| Parameters:
{| class="wikitable"
|Parameters:


0: '''Module''' ([[Object]]) - Module which should fire
0: '''Module''': [[Object]] - module which should fire
1: '''Target''': [[Object]] or [[Position]] - where the module should aim at<br>
2: '''Weapon''': [[String]] - name of the weapon which a module should use. It can be {{hl|GravityShotgun_01}}, {{hl|GravityCannon_01}} or {{hl|GravityCannon_01_Precise}}.<br>
3: '''Use Charging''': [[Boolean]] - (Optional, default [[true]]) define if charging of a module should be skipped.<br>
4: '''Timeout delay''': [[Number]] - (Optional, default 1) delay in seconds.
|-
| <sqf>[bin_drone, "SwarmMissile_01_launcher_F"] call BIS_fnc_fire;</sqf>
| Manually trigger a missile swarm
|
|}


1: '''Target''' ([[Object]] or Position) - [[Object]] or Position where module should aim at


2: '''Weapon''' ([[String]]) - Name of weapon which module should use. Can be '''GravityShotgun_01, GravityCannon_01 or GravityCannon_01_Precise'''
== Modules ==


3: '''Use Charging''' (Bool) [Optional]- Define if charging of module should be skipped. Default true
=== Setup ===


4: '''Timeout delay''' ([[Number]]) [Optional] - Default 1 second
|}
|-
| colspan="1" |[bin_drone,"SwarmMissile_01_launcher_F"] call bis_fnc_fire;
| colspan="1" |Manually trigger missile swarm
| colspan="1" |
|}
----
= Modules =
== Setting up modules ==
'''Creating module'''
'''Creating module'''


In order to create module use following function. You don't need to place drone module on map itself!
In order to create a module use the following function. You don't need to place a drone module in the world itself!


Syntax: '''_module''' = [drone, moduleClassName, moduleType] call '''bin_fnc_initDroneModule''';
Syntax: '''_module''' = [drone, moduleClassName, moduleType] call '''BIN_fnc_initDroneModule''';


Parameters:
Parameters:


* '''drone''': [[Object]] - Parent object to which modules are attached
* '''drone''': [[Object]] - parent object to which modules are attached
* '''movementProperties''': [[String]] - Class name of vehicle to create. List of available module is available below
* '''movementProperties''': [[String]] - class name of the vehicle to create. The list of available modules is available below.
* '''moduleType''': [[String]] type of module to register - currently "'''combat'''", "'''matter'''" & "'''science'''" are available.
* '''moduleType''': [[String]] - type of module to register - currently "combat", "matter" & "science" are available.
 
=== Available Modules ===


==== List of available modules ====
{| class="wikitable"
{| class="wikitable"
!Class name
! Classname
!Name
! Name
! colspan="1" |Picture
! Picture
|-
|-
|Alien_MatterBall_01_F
| Alien_MatterBall_01_F
|Matter Ball
| Matter Ball
| [[Image:Alien_MatterBall_01_F.jpg|200px]]
| [[File:Alien_MatterBall_01_F.jpg|200px]]
|-
|-
|B_A_AlienDrone_Module_01_F
| <nowiki/>
B_A_AlienDrone_Module_01_F


O_A_AlienDrone_Module_01_F
O_A_AlienDrone_Module_01_F


I_A_AlienDrone_Module_01_F
I_A_AlienDrone_Module_01_F
|Scan Module
| Scan Module


(can be used to perform '''research''' operations)
(can be used to perform '''research''' operations)
| [[Image:B_A_AlienDrone_Module_02_F.jpg|200px]]
| [[File:B_A_AlienDrone_Module_01_F.jpg|200px]]
|-
|-
|B_A_AlienDrone_Module_02_F
| <nowiki/>
B_A_AlienDrone_Module_02_F


O_A_AlienDrone_Module_02_F
O_A_AlienDrone_Module_02_F


I_A_AlienDrone_Module_02_F
I_A_AlienDrone_Module_02_F
|Gravity Tool Module
| Gravity Tool Module


(can be used in '''combat''')
(can be used in '''combat''')
| [[File:B_A_AlienDrone_Module_01_F.jpg|200px]]
| [[File:B_A_AlienDrone_Module_02_F.jpg|200px]]
|}
|}
I, B, O are abbreviation for factions - I = '''Independent''', B - '''Blufor''', O - '''Opfor'''
 
I, B, O are abbreviation for factions - I = '''Independent''', B = '''Blufor''', O = '''Opfor'''


'''Module variables'''
'''Module variables'''
Line 391: Line 403:
|Interval
|Interval
|'''bin_droneModule_interval'''
|'''bin_droneModule_interval'''
|Sets how strictly module is following the drone. 0 means it's basically out of control where 1
|Sets how strictly a module is following Drone. 0 means it is basically out of control
|-
|-
|Radius
|Radius
|'''bin_droneModule_radius'''
|'''bin_droneModule_radius'''
|Radius of module orbit (calculated from Drone center)
|Radius of the module orbit (calculated from Drone's center)
|-
|-
|Height
|Height
|'''bin_droneModule_height'''
|'''bin_droneModule_height'''
|Height offset of the module orbit (calculated from Drone center)
|Height offset of the module orbit (calculated from Drone's center)
|-
|-
|Rotational speed
|Rotational speed
Line 405: Line 417:
|How much time it takes to perform one full rotation
|How much time it takes to perform one full rotation
|-
|-
| colspan="1" |Damage
| Damage
| colspan="1" |'''bin_droneModule_damage'''
| '''bin_droneModule_damage'''
| colspan="1" |By default, modules damage is synced to damage status of parent vehicle. With this variable it's possible to override this behavior and either enable or disable damage completely.
| By default, modules damage is synced to damage status of the parent vehicle. With this variable it is possible to override this behavior and either enable or disable damage completely.
|}
|}


=== Example ===
=== Example ===
<syntaxhighlight lang="cpp">
<sqf>
_module_1 = [BIN_drone,"I_A_AlienDrone_Module_02_F ","combat"] call bin_fnc_initDroneModule;
private _module_1 = [BIN_drone, "I_A_AlienDrone_Module_02_F", "combat"] call BIN_fnc_initDroneModule;
_module_1 setVariable ["bin_droneModule_interval", 0.75];  
_module_1 setVariable ["bin_droneModule_interval", 0.75];
_module_1 setVariable ["bin_droneModule_radius", 4.28683];
_module_1 setVariable ["bin_droneModule_radius", 4.28683];
_module_1 setVariable ["bin_droneModule_height", 1.5];
_module_1 setVariable ["bin_droneModule_height", 1.5];
_module_1 setVariable ["bin_droneModule_rotationTime", 6.5];
_module_1 setVariable ["bin_droneModule_rotationTime", 6.5];
</syntaxhighlight>
</sqf>
 
 
== Example Missions ==
 
* Alien Entity: Combat Behavior example mission - {{Link|https://steamcommunity.com/sharedfiles/filedetails/1819779586}}
* Alien Entity: Safe Behavior example mission - {{Link|https://steamcommunity.com/sharedfiles/filedetails/1819778427}}




= Example Missions =
{{GameCategory|arma3|Editing}}
[[Category:Introduced with Arma 3 version 1.94]]

Latest revision as of 00:10, 13 November 2024

Spoiler Warning
The following text contains game spoilers such as story details or mission walkthroughs. Read at your own risk!
The potential spoilers concern the following topic: "First Contact" campaign of Arma 3 Contact.

Arma 3 logo black.png1.94

The small Alien Entity (AE - referred to as Drone in technical systems) is used by ET for surveillance, reconnaissance, research, and defense as needed. It is made from unknown and supremely tough materials. The entity has local control of gravity, and it moves in pulses. It can collect and utilize almost any type of matter from the local environment. The AE appears to communicate on the broad electromagnetic spectrum.

Around its central solid hull, the entity can hold one or more modules in its orbit. These do not themselves have propulsion, so they cannot move out of the entity's sphere of influence. Various types of module exist:

  1. Scan Module: used to inspect nearby objects and materials
  2. Gravity Tool Module: used to process and launch collected matter in two lethal modes:
    1. Matter Shot: a precise single shot of matter
    2. Matter Burst: a multi-round burst of matter
  3. Matter: used to store collected matter as a resource
    1. If it runs out, the entity will collect more from any surface
    2. If it gets dislodged from its orbit, it will fall to the ground and decay (there is some danger to those who get close)

The entity also features several countermeasures:

  1. Anti-Projectile System: this can 'catch' and re-direct various slower speed projectiles (it can be overwhelmed)
  2. Audiovisual Deception: this uses light and sound to disorient threats
  3. Gravity Matter Swarm: this launches a cluster of semi-guided area denial projectiles
  4. Gravity Matter Push: this launches matter in all directions as a less-than-lethal defense against nearby threats

At this time there are no known vulnerabilities to Earth weapons, and the entity typically withdraws before any major damage can be inflicted.


Drone

Drone Init

After an Alien Entity (Small) is placed on the map, you need to execute the following functions before you get your drone fully operational.

Setting Movement Grid

Drone is only able to move in a generated grid. It can be generated on-the-fly via BIN_fnc_setObjectGrid or by using a movement grid module.

contactMovementGrid.png

Syntax:

[drone, positionATL, cellSizeX, cellSizeY, cellSizeZ, resolutionX, resolutionY, resolutionZ] call BIN_fnc_setObjectGrid;

Parameters:

  • drone: Object - object to which the grid is attached.
  • positionATL: Array - PositionATL where the drone grid should be created.
  • cellSizeX: Number - (Optional, default 4) size of movement cells in the X axis (meters).
  • cellSizeY: Number - (Optional, default 4) size of movement cells in the Y axis (meters).
  • cellSizeZ: Number - (Optional, default 16) size of movement cells in the Z axis (meters).
  • resolutionX: Number - (Optional, default 20) number of cells in the X axis.
  • resolutionY: Number - (Optional, default 20) number of cells in the Y axis.
  • resolutionZ: Number - (Optional, default 3) number of cells in the Z axis.

Setting Movement Properties

The way the drone moves can be changed via the following function. A list of all available movement types is listed in the section below.

Syntax:

[bin_drone, movementProperties] call BIN_fnc_setMoveProperties;

Parameters:

  • drone: Object - Object to which the movement properties are attached.
  • movementProperties: String - Name of the movement class.

Initialising Drone Scripted Sound System

Syntax:

Parameters:

  • drone: Object - Object to which the sound system is attached.

Initialising Drone Behavior System

Syntax:

[drone, behaviorType] call BIN_fnc_behaviorInit;

Parameters:

  • drone: Object - Object to which the movement properties are attached.
  • behaviorType: String - (Optional, default "Drone") name of the behavior type, can be either "Drone" or "DroneCombat".

Example Code

[bin_drone, "Drone"] call BIN_fnc_behaviorInit; [bin_drone, "Drone"] call BIN_fnc_setMoveProperties; [bin_drone, getPosATL bin_drone, nil, nil, nil, 5, 5, 3] call BIN_fnc_setObjectGrid; [bin_drone] call BIN_fnc_soundDrone;

Switching Behaviors

Behaviors listed below can be used with BIN_fnc_setBehavior & BIN_fnc_setBehaviorCoef.

BIN_fnc_setBehavior is using the following syntax:

[drone, behaviorName, parameters, terminateBehaviour, interrupt] call BIN_fnc_setBehavior;

Parameters:

  • drone: Object - object to which the movement properties are attached.
  • behaviorName: String - (Optional, default "Drone") name of the behavior type. Can be either "Drone" or "DroneCombat".
  • parameters: Array - (Optional, default []) parameters which can be passed to the behavior.
  • terminateBehaviour: Boolean - (Optional, default false) if true, the currently executed behaviour will be terminated and a new one will be executed right after termination of the existing one is completed. The default is false.
  • interrupt: Boolean - (Optional, default false) determines if behavior should be terminated immediately. In case of e.g. research behavior it means that instead of gently putting back a scanned object, it will be dropped to the ground right away. The default is false.

Example:

List of Available Behaviors

Name Description Available parameters
Patrol Drone will move around looking for enemy contacts
Investigate Drone will look at the nearest unit 0: target (Optional): Object - object which Drone will look at
GravityCannon If combat modules are are present, Drone will use them to engage either a random nearby target

0: target: Object - (Optional) target for gravity cannon

1: weapon: String - (Optional) can be GravityShotgun_01, GravityCannon_01 or GravityCannon_01_Precise

MissileSwarm Drone will use an area of effect weapon releasing 5 missile like projectiles at nearby targets
Jump Drone will perform a jump to a specified location

0: position - Array or String - PositionATL - position to move. If a string is provided, Drone will jump to a precalculated grid located in the provided file.

1: charge (Optional) - Boolean - optional parameters controlling if Drone should be charging power before making a jump. The default is false.

2: fast (Optional) - Drone will jump up straight away if it is set to true; the default is false. If a number is provided, Drone will pick fast jump if the distance is above that value.

Avoid Drone will try to avoid contact with nearby units by moving away from them
Research Drone will perform research behavior on nearby objects

0: target (Optional) - Object - target to scan. If not specified Drone will try to pick some random object in the available grid.

1: endless (Optional) - Boolean - research will be performed until it is interrupted by script.

Light Drone will use its light burst countermeasure and try to move away from incoming fire
GravityBurst Drone will use gravity burst when units are nearby
CollectMatter Drone will collect 4 matter balls which serve as gravity cannon magazines
Reposition Drone will move 100 meters away from incoming fire

Scripted Event Handlers

Name Output Description
behaviorStarted

0: Object

1: Behavior name

Triggers when a new behavior FSM is triggered
behaviorCompleted

0: Object

1: Behavior name

Triggers when a new behavior FSM is completed. It will be also fired when behavior was interrupted!

Example code:

Drone_EH = [missionNamespace, "behaviorCompleted", { params["_object","_behavior"]; systemChat format["Object: %1, Behavior: %2", _object, _behavior]; }] call BIS_fnc_addScriptedEventHandler;

Editing Move Properties

Movement properties can be modified within the game editor. In order to access them, type the following code in console and execute it:

contact bezier curve.png

You can add points to that graph by double clicking on the middle area. It is possible to move those points once they are created. When you are are ready, press the "Copy" button and paste the result to your config. It is not possible to obtain these values from mission files at the moment.

class Movement
{
	class Templates
	{
		#define CURVE		{ { 0, 0, 0 }, { 0.3, 0.9, 0 }, { 0.5, 0.9, 0 }, { 0.5, 1.070, 0 }, { 0.5, 1, 0 } }
		#define CURVE_LONG	{ { 0, 0, 0 }, { 0.3, 0.9, 0 }, { 0.5, 0.9, 0 }, { 0.5, 1.024, 0 }, { 0.5, 1, 0 } }
		#define CURVE_END	{ { 0, 0, 0 }, { 0.5, 1, 0 }, { 0.7, 1, 0 }, { 1, 1, 0 } }
		#define CURVE_ROT	{ { 0, 0, 0 }, { 0, 2, 0 }, { 0.9, 1, 0 }, { 1, 1, 0 } }

		class Default
		{
			speed = 8;								// average travel speed in m/s
			pulseDistance = 100;					// distance between pulses
			maxPulseDistanceFar = 100;				// maximum distance between pulses in long-distance travel
			maxPulseDistanceClose = 3;				// maximum distance between pulses in short-distance travel
			altitude = 100;							// altitude above terrain level for long jumps
			curve[] = { { 0, 0 }, { 1, 1 } };		// movement curve
			curveEnd[] = { { 0, 0 }, { 1, 1 } };	// movement curve on the last waypoint (smoother settle-in)
			curveRotation[] = { { 0, 0, 0 }, { 1, 0, 0 }, { 0, 1, 0 }, { 1, 1, 0 } };
		};

		class Drone : Default
		{
			speed = 7;
			curve[] = CURVE;
			curveEnd[] = CURVE_END;
			curveRotation[] = CURVE_ROT;
		};

		class Drone_Intro3 : Drone
		{
			speed = 12;
			pulseDistance = 550;
			maxPulseDistanceFar = 550;
		};

		class Drone_Long : Drone
		{
			speed = 14;
			pulseDistance = 250;
			maxPulseDistanceFar = 550;
			curve[] = CURVE_LONG;
		};

		class CombatDrone : Default
		{
			speed = 14;
			maxPulseDistanceFar = 40;
			curve[] = CURVE;
			curveEnd[] = CURVE_END;
			curveRotation[] = CURVE_ROT;
		};

		class CombatDrone_Fast : Default
		{
			speed = 28;
			maxPulseDistanceFar = 40;
			curve[] = CURVE;
			curveEnd[] = CURVE_END;
			curveRotation[] = CURVE_ROT;
		};

		class CombatDrone_Long : Default
		{
			speed = 28;
			pulseDistance = 500;
			maxPulseDistanceFar = 1000;
			curve[] = CURVE_LONG;
			curveEnd[] = CURVE_END;
			curveRotation[] = CURVE_ROT;
		};

		class ModularShip : Default
		{
			speed = 2;
			curve[] = CURVE;
			curveEnd[] = CURVE_END;
			curveRotation[] = CURVE_ROT;
		};
	};
};

located in configFile >> "CfgContact" >> "Movement" >> "Templates".

↑ Back to spoiler's top

Handy Functions List

Function Description Notes
bin_drone setVariable ["#bD", 1];
Set danger level on Drone. Danger goes from 0 (no danger) to 1 (maximum danger).
bin_drone setVariable ["#bState", "Combat"];
Sets Drone behavior to the selected state. The currently supported modes are "Safe" & "Combat".
bin_drone setVariable ["#bTarget", player];
Sets a target for Drone's gravity cannon
[west, 0] call BIN_fnc_setTargetWeight; // all units from side "west" will be ignored by the targeting system [player, 10] call BIN_fnc_setTargetWeight; // increase player's chance of being targeted by Drone weapons [bis_car, 0] call BIN_fnc_setTargetWeight // vehicle and its crew will be ignored by the targeting system
Coef to target priority - set to 0 to basically exclude Drone from target selection. Function accepts a group, side, vehicle or unit. Applied to the individual unit, side or vehicle - not Drone!
[bin_drone, "gravitycannon", [cursorObject, "GravityShotgun_01"] call BIN_fnc_setBehavior;
Forces Drone to target a specific object
[bin_drone, "gravityCannon",10] call BIN_fnc_setBehaviorCoef;
Change probability of picking a specific behavior
[bin_module_01, player, "GravityCannon_01_Precise", false, 1] call BIN_fnc_setDroneModuleTarget;
Targets and fires module at the player Parameters:

0: Module: Object - module which should fire 1: Target: Object or Position - where the module should aim at
2: Weapon: String - name of the weapon which a module should use. It can be GravityShotgun_01, GravityCannon_01 or GravityCannon_01_Precise.
3: Use Charging: Boolean - (Optional, default true) define if charging of a module should be skipped.
4: Timeout delay: Number - (Optional, default 1) delay in seconds.

[bin_drone, "SwarmMissile_01_launcher_F"] call BIS_fnc_fire;
Manually trigger a missile swarm


Modules

Setup

Creating module

In order to create a module use the following function. You don't need to place a drone module in the world itself!

Syntax: _module = [drone, moduleClassName, moduleType] call BIN_fnc_initDroneModule;

Parameters:

  • drone: Object - parent object to which modules are attached
  • movementProperties: String - class name of the vehicle to create. The list of available modules is available below.
  • moduleType: String - type of module to register - currently "combat", "matter" & "science" are available.

Available Modules

Classname Name Picture
Alien_MatterBall_01_F Matter Ball Alien MatterBall 01 F.jpg

B_A_AlienDrone_Module_01_F

O_A_AlienDrone_Module_01_F

I_A_AlienDrone_Module_01_F

Scan Module

(can be used to perform research operations)

B A AlienDrone Module 01 F.jpg

B_A_AlienDrone_Module_02_F

O_A_AlienDrone_Module_02_F

I_A_AlienDrone_Module_02_F

Gravity Tool Module

(can be used in combat)

B A AlienDrone Module 02 F.jpg

I, B, O are abbreviation for factions - I = Independent, B = Blufor, O = Opfor

Module variables

Name Variable Notes
Interval bin_droneModule_interval Sets how strictly a module is following Drone. 0 means it is basically out of control
Radius bin_droneModule_radius Radius of the module orbit (calculated from Drone's center)
Height bin_droneModule_height Height offset of the module orbit (calculated from Drone's center)
Rotational speed bin_droneModule_rotationTime How much time it takes to perform one full rotation
Damage bin_droneModule_damage By default, modules damage is synced to damage status of the parent vehicle. With this variable it is possible to override this behavior and either enable or disable damage completely.

Example

private _module_1 = [BIN_drone, "I_A_AlienDrone_Module_02_F", "combat"] call BIN_fnc_initDroneModule; _module_1 setVariable ["bin_droneModule_interval", 0.75]; _module_1 setVariable ["bin_droneModule_radius", 4.28683]; _module_1 setVariable ["bin_droneModule_height", 1.5]; _module_1 setVariable ["bin_droneModule_rotationTime", 6.5];


Example Missions