Module: Sector – Arma 3

From Bohemia Interactive Community
(Add section about using SQF to create a sector module)
m (Some wiki formatting)
Line 1: Line 1:
[[File:A3_moduleSector.jpg|400px|thumb|]]
[[File:A3_moduleSector.jpg|400px|thumb]]
== Introduction ==
{{Name|bi}}'s sector module allows you to easily create sector control missions.
Bohemia Interactive's sector module allows you to easily create sector control missions. The side with the strongest force within the area (calculated by number and type of the units) will be capturing it.
The side with the strongest force within the area (calculated by number and type of the units) will be capturing it.


[[deleteVehicle|Delete]] or [[enableSimulation|disable]] the sector module to 'finalize' the sector. Once done, capturing will be disabled and the last owner will retain the control forever.
[[deleteVehicle|Delete]] or [[enableSimulation|disable]] the sector module to 'finalize' the sector.
Once done, capturing will be disabled and the last owner will retain the control forever.




==Properties==
== Properties ==
You can modify your sector and its behavior by changing the properties either in the module editor or by using setVariable on your sector variable. Use [[BIS_fnc_moduleSector]] to modify your sector after it has been created.
 
{| class="wikitable"  
The sector and its behavior can be modified by changing the properties either in the module editor or by using [[setVariable]] on the sector.
Use [[BIS_fnc_moduleSector]] to edit the sector after it has been created.
{| class="wikitable sortable"
! Property (Module Attributes)
! Variable Name
! Variable Type
! Description
! Default Value
|-
|-
!Property (Module Attributes)
| Name
!Variable Name
| "Name"
!Variable Type
| [[String]]
!Description
| Sector name visibile on a map, in a task and in a notification.
!Default Value
| Next NATO Phonetic Alphabet Letter (see [[BIS_fnc_phoneticalWord]])
|-
|-
|Name
| Designation
|"Name"
| "Designation"
|[[String]]
| [[String]]
|Sector name visibile on a map, in a task and in a notification.
| Single letter visible in the sector icon (when empty, first letter of the name will be used).
|Next NATO Phonetic Alphabet Letter (see [[BIS_fnc_phoneticalWord]])
| First letter of "Name"
|-
|-
|Designation
| Ownership Limit
|"Designation"
| "OwnerLimit"
|[[String]]
| [[Number]]
|Single letter visible in the sector icon (when empty, first letter of the name will be used).  
| How much a side needs to be dominant in order to capture a sector. Value is in range <0,1>, where 1 is full dominance.
| First letter of "Name"  
| {{hl|"0"}}
|-
|-
|Ownership Limit
| Expression
|"OwnerLimit"
| "OnOwnerChange"
|[[Number]]
| [[Code]]
|How much a side needs to be dominant in order to capture a sector. Value is in range <0,1>, where 1 is full dominance.
| Code executed when the ownership changes. Passed arguments are: <sqf>params ["_sector", "_owner", "_ownerOld"];</sqf>
|"0"
| {{hl|"true"}}
|-
|Expression
|"OnOwnerChange"
|[[Code]]
|Code executed when the ownership changes. Passed arguments are: <sqf>params ["_sector", "_owner", "_ownerOld"];</sqf>
|"true"
|-
|-
|
|
|"CaptureCoef"
| "CaptureCoef"
|[[Number]]
| [[Number]]
|Speed at which any unit captures the zone.  
| Speed at which any unit captures the zone.
|"0.05"
| {{hl|"0.05"}}
|-
|-
|Infantry cost
| Infantry cost
|"CostInfantry"
| "CostInfantry"
|[[Number]]
| [[Number]]
|Ratio of how fast infantry units will capture the sector.
| Ratio of how fast infantry units will capture the sector.
|"1"
| {{hl|"1"}}
|-
|-
|Wheeled vehicle cost
| Wheeled vehicle cost
|"CostWheeled"
| "CostWheeled"
|[[Number]]
| [[Number]]
|Ratio of how fast wheeled vehicles will capture the sector.
| Ratio of how fast wheeled vehicles will capture the sector.
|"1"
| {{hl|"1"}}
|-
|-
|Tracked vehicle cost
| Tracked vehicle cost
|"CostTracked"
| "CostTracked"
|[[Number]]
| [[Number]]
|Ratio of how fast tracked vehicles will capture the sector.
| Ratio of how fast tracked vehicles will capture the sector.
|"1"
| {{hl|"1"}}
|-
|-
|Naval cost
| Naval cost
|"CostWater"
| "CostWater"
|[[Number]]
| [[Number]]
|Ratio of how fast naval vehicles will capture the sector.
| Ratio of how fast naval vehicles will capture the sector.
|"1"
| {{hl|"1"}}
|-
|-
|Aircraft cost
| Aircraft cost
|"CostAir"
| "CostAir"
|[[Number]]
| [[Number]]
|Ratio of how fast aircraft will capture the sector.
| Ratio of how fast aircraft will capture the sector.
|"1"
| {{hl|"1"}}
|-
|-
|Players cost
| Players cost
|"CostPlayers"
| "CostPlayers"
|[[Code]]
| [[Code]]
|Ratio of how fast players will capture the sector, combined with other costs.
| Ratio of how fast players will capture the sector, combined with other costs.
| "1"
| {{hl|"1"}}
|-
|-
|Default Owner
| Default Owner
|"DefaultOwner"
| "DefaultOwner"
|[[Number]]
| [[Number]]
|Default sector owner, even if he has no units in the sector (see [[BIS_fnc_sideID]]).
| Default sector owner, even if he has no units in the sector (see [[BIS_fnc_sideID]]).
|"-1"
| {{hl|"-1"}}
|-
|-
|Task Owners
| Task Owners
| "TaskOwner"
| "TaskOwner"
|[[Number]]
| [[Number]]
|Sides which will receive the tasks. Values from 0 to 3 are accepted.
| Sides which will receive the tasks. Values from 0 to 3 are accepted.
 
* 0: No one
0: No one
* 1: Everyone
 
* 2: Only default sector owner
1: Everyone
* 3: Everyone except the default sector owner
 
| {{hl|0}}
2: Only default sector owner
 
3: Everyone except the default sector owner
|0
|-
|-
|Task title
| Task title
|"TaskTitle"
| "TaskTitle"
|[[String]]
| [[String]]
|Title of the automatically added task. Use %1 to add the sector name. When empty, no task will be added.  
| Title of the automatically added task. Use %1 to add the sector name. When empty, no task will be added.
| "%1"
| {{hl|"%1"}}
|-
|-
|Task description
| Task description
|"TaskDescription"
| "TaskDescription"
|[[String]]
| [[String]]
|Description of automatically added task. Use %1 to insert the sector name, %2 to enter sector rewards (e.g. unlocked vehicles or respawn points), %3 to insert description of capturing costs.
| Description of automatically added task. Use %1 to insert the sector name, %2 to enter sector rewards (e.g. unlocked vehicles or respawn points), %3 to insert description of capturing costs.
| "%1%2%3"
| {{hl|"%1%2%3"}}
|-
|-
|Seize Reward
| Seize Reward
| "ScoreReward"
| "ScoreReward"
|[[Number]]
| [[Number]]
|Score awarded to the side which captured the sector.
| Score awarded to the side which captured the sector.
|0
| {{hl|0}}
|}
|}


== How To ==
== How To ==


Open the editor (2D or Eden)  and create the module '''ModuleSector_F'''. Add a name to the sector and set the properties as you want them to be. Create a '''location''' game logic next to the module. Create a new '''trigger''' and set the activation mode to ''everyone''. The trigger's size and position represents the area of the sector. Synchronize the trigger with the ''location object''. Synchronize the ''location object'' with the sector module. Create the game logic ''bluefor'' and ''opfor'' and synchronize them with the sector module as well. Now you have created a sector that can be captured by Blufor and Opfor at the trigger position. Test your mission!
# Open the editor and create the module '''ModuleSector_F'''.
# Add a name to the sector and set the properties as you want them to be.
# Create a '''location''' game logic next to the module.
# Create a new '''trigger''' and set the activation mode to ''everyone''. The trigger's size and position represents the area of the sector.
# Synchronise the trigger with the ''location object''.
# Synchronise the ''location object'' with the sector module.
# Create the ''bluefor'' and ''opfor'' game logics and synchronise them with the sector module as well.
Now you have created a sector that can be captured by Blufor and Opfor at the trigger position. Test your mission!


== Creating a Sector Module from SQF ==


You can also use code to create a sector by creating a logic group, creating a unit of class "ModuleSector_F" and then using [[BIS_fnc_moduleSector]] to initialize it:
== Scripted Sector Module Creation ==


[[SQF Syntax|SQF]] can be used to create a sector by creating a logic group, by creating a unit of class "ModuleSector_F" then using [[BIS_fnc_moduleSector]] to initialise it:
<sqf>
<sqf>
//You need to use createGroup and createUnit to create modules, creating them with createVehicle will not work
// [[createGroup]] and [[createUnit]] are needed to create modules
// creating them with [[createVehicle]] will not work
private _group = createGroup sideLogic;
private _group = createGroup sideLogic;
private _sector = _group createUnit ["ModuleSector_F", _position, [], 0, "CAN_COLLIDE"]; //_position is [x, y, z]
private _sector = _group createUnit ["ModuleSector_F", _position, [], 0, "CAN_COLLIDE"]; // _position is [x, y, z]


//You can change the parameters of your sector by using setVariable
// it is possible to change the sector's parameters using [[setVariable]]
_sector setVariable ["Name", "My Sector", true];
_sector setVariable ["Name", "My Sector", true];
_sector setVariable ["Designation", "S", true];
_sector setVariable ["Designation", "S", true];
Line 140: Line 147:
_sector setVariable ["DefaultOwner", 0, true];
_sector setVariable ["DefaultOwner", 0, true];


[_sector] call BIS_fnc_moduleSector; //Initializes your sector
[_sector] call BIS_fnc_moduleSector; // initialises the sector


//After initialization, sync an area trigger to the module, it will be the capture area
// after initialization, sync an area trigger to the module, it will be the capture area
private _area = createTrigger ["EmptyDetector", _position];
private _area = createTrigger ["EmptyDetector", _position];
_area setTriggerArea [10, 10, 0, false]; //Change values depending on the size you want
_area setTriggerArea [10, 10, 0, false]; // change values depending on the size you want
_area setTriggerActivation ["ANY", "PRESENT", false];
_area setTriggerActivation ["ANY", "PRESENT", false];
_sector setVariable ["areas", [_area], true];
_sector setVariable ["areas", [_area], true];
</sqf>
</sqf>


== Useful Resources ==
== Useful Resources ==


* [https://www.youtube.com/watch?v{{=}}p0AGI49H9Qg Video Tutorial by pickinthatbanjo]
* {{Link|https://www.youtube.com/watch?v{{=}}p0AGI49H9Qg|Video Tutorial by pickinthatbanjo}}
* {{Link|link= http://steamcommunity.com/sharedfiles/filedetails/?id=179946163|text= Steam guide by MuD}}
* {{Link|http://steamcommunity.com/sharedfiles/filedetails/?id{{=}}179946163|Steam guide by MuD}}
 


== See Also ==
== See Also ==
* [[BIS_fnc_moduleSector]]
* [[BIS_fnc_moduleSector]]
* [[BIS_fnc_bleedTickets]] for creating a sector mission based on a ticket system
* [[BIS_fnc_bleedTickets]] for creating a sector mission based on a ticket system


{{GameCategory|arma3|Editor Modules}}
{{GameCategory|arma3|Editor Modules}}

Revision as of 20:37, 11 September 2025

A3 moduleSector.jpg

Bohemia Interactive's sector module allows you to easily create sector control missions. The side with the strongest force within the area (calculated by number and type of the units) will be capturing it.

Delete or disable the sector module to 'finalize' the sector. Once done, capturing will be disabled and the last owner will retain the control forever.


Properties

The sector and its behavior can be modified by changing the properties either in the module editor or by using setVariable on the sector. Use BIS_fnc_moduleSector to edit the sector after it has been created.

Property (Module Attributes) Variable Name Variable Type Description Default Value
Name "Name" String Sector name visibile on a map, in a task and in a notification. Next NATO Phonetic Alphabet Letter (see BIS_fnc_phoneticalWord)
Designation "Designation" String Single letter visible in the sector icon (when empty, first letter of the name will be used). First letter of "Name"
Ownership Limit "OwnerLimit" Number How much a side needs to be dominant in order to capture a sector. Value is in range <0,1>, where 1 is full dominance. "0"
Expression "OnOwnerChange" Code Code executed when the ownership changes. Passed arguments are:
params ["_sector", "_owner", "_ownerOld"];
"true"
"CaptureCoef" Number Speed at which any unit captures the zone. "0.05"
Infantry cost "CostInfantry" Number Ratio of how fast infantry units will capture the sector. "1"
Wheeled vehicle cost "CostWheeled" Number Ratio of how fast wheeled vehicles will capture the sector. "1"
Tracked vehicle cost "CostTracked" Number Ratio of how fast tracked vehicles will capture the sector. "1"
Naval cost "CostWater" Number Ratio of how fast naval vehicles will capture the sector. "1"
Aircraft cost "CostAir" Number Ratio of how fast aircraft will capture the sector. "1"
Players cost "CostPlayers" Code Ratio of how fast players will capture the sector, combined with other costs. "1"
Default Owner "DefaultOwner" Number Default sector owner, even if he has no units in the sector (see BIS_fnc_sideID). "-1"
Task Owners "TaskOwner" Number Sides which will receive the tasks. Values from 0 to 3 are accepted.
  • 0: No one
  • 1: Everyone
  • 2: Only default sector owner
  • 3: Everyone except the default sector owner
0
Task title "TaskTitle" String Title of the automatically added task. Use %1 to add the sector name. When empty, no task will be added. "%1"
Task description "TaskDescription" String Description of automatically added task. Use %1 to insert the sector name, %2 to enter sector rewards (e.g. unlocked vehicles or respawn points), %3 to insert description of capturing costs. "%1%2%3"
Seize Reward "ScoreReward" Number Score awarded to the side which captured the sector. 0


How To

  1. Open the editor and create the module ModuleSector_F.
  2. Add a name to the sector and set the properties as you want them to be.
  3. Create a location game logic next to the module.
  4. Create a new trigger and set the activation mode to everyone. The trigger's size and position represents the area of the sector.
  5. Synchronise the trigger with the location object.
  6. Synchronise the location object with the sector module.
  7. Create the bluefor and opfor game logics and synchronise them with the sector module as well.

Now you have created a sector that can be captured by Blufor and Opfor at the trigger position. Test your mission!


Scripted Sector Module Creation

SQF can be used to create a sector by creating a logic group, by creating a unit of class "ModuleSector_F" then using BIS_fnc_moduleSector to initialise it:

// createGroup and createUnit are needed to create modules // creating them with createVehicle will not work private _group = createGroup sideLogic; private _sector = _group createUnit ["ModuleSector_F", _position, [], 0, "CAN_COLLIDE"]; // _position is [x, y, z] // it is possible to change the sector's parameters using setVariable _sector setVariable ["Name", "My Sector", true]; _sector setVariable ["Designation", "S", true]; _sector setVariable ["sides", [west, east], true]; _sector setVariable ["DefaultOwner", 0, true]; [_sector] call BIS_fnc_moduleSector; // initialises the sector // after initialization, sync an area trigger to the module, it will be the capture area private _area = createTrigger ["EmptyDetector", _position]; _area setTriggerArea [10, 10, 0, false]; // change values depending on the size you want _area setTriggerActivation ["ANY", "PRESENT", false]; _sector setVariable ["areas", [_area], true];


Useful Resources


See Also