# grad-sectors

> Arma3 sector framework

Latest version **0.0.1** (published 2020-07-24) · 0 weekly downloads

## Install

```sh
npm install grad-sectors
pnpm add grad-sectors
yarn add grad-sectors
bun add grad-sectors
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2020-07-24 |
| First published | 2020-07-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | McDiod |
| Maintainers | gruppe-adler-admin |

## Links

- npm: https://www.npmjs.com/package/grad-sectors
- Repository: https://github.com/gruppe-adler/grad-sectors
- Issues: https://github.com/gruppe-adler/grad-sectors/issues
- npm.io page: https://npm.io/package/grad-sectors

## Recent versions

- 0.0.1 (latest) — 2020-07-24

## README

# grad-sectors

sector control implementation

based on @McDiods [TvT Template](https://github.com/gruppe-adler/TvT_Template.VR/tree/master/functions) but standalone and with flags

might be merged into template later on as it tries to be non-destructive

## dependencies

* https://github.com/gruppe-adler/grad-points

# Configuration

in the description.ext add the following to define custom flag textures for each side
default is `"\A3\Data_F\Flags\Flag_red_CO.paa"`

```sqf
class cfgGradSectors {
    flagTextureBlufor = "";
    flagTextureOpfor = "\A3\Data_F\Flags\Flag_red_CO.paa";
    flagTextureIndependent = "\A3\Data_F\Flags\Flag_CSAT_CO.paa";
    flagTextureCivilian = "";
};
```

## Create Sector
Size and position of a sectors is defined with a Trigger. Alle settings of the Trigger are kept besides size and form. Then an Area Entity is created (*Systems >> Logic Entities >> Locations >> Area*) and synced with all Triggers which should get the same sector settings.

![](http://i.imgur.com/x1Bd2qv.png)

## Add Function
Now we doubleclick the Area Entity and fill the init field with the `createSector` function:

### Syntax

```sqf
[area,sector name,reward,reward per second,lock after capture,capture sides,owner,notify,onsectorcaptured,sectordata,capturemode] call grad_sectors_fnc_createSector
```

### Parameter

Parameter | Erklärung
----------|-----------
area | object - Area Entity (in init field the variable `this`)
sector name | string (optional) - name of the sector (default: `""`)
reward | number (optional) - amount of points a side gets for taking the point (default: `1`)
reward per second | number (optional) - amount of points a side gets for holding the point PER SECOND. (default: `0`)
lock after capture | bool (optional) - if the sector can be reconquered (default: `false`)
capture sides | array (optional) - sides that can conquer the sector (default: `[WEST,EAST,INDEPENDENT]`)
owner | side (optional) - side that holds the sector at game start. (default: `sideUnknown`)
notify | boolean (optional) - if a hint is displayed to all players when sector is taken
onsectorcaptured | code (optional) - custom code executed when sector is taken. Params are `[_trigger,_newOwner,_oldOwner]`
sectordata | string - (optional) - can be used to write data into the sector, gets added as `setVariable "grad_sectors_sectordata"`
capturemode | [number(,number - only for capture mode 1)] - 0/1/2 == capture mode,  strength/time/flag, 0-9999 captureTime

### Capture Modes in detail
#### 0 - Strength
Side with more units inside the trigger captures instantly
#### 1 - Time
Side with more units inside trigger captures with a delay (second number in array for time in seconds)
#### 2 - Flag
Side that raises own flag captures instantly


### Example

```sqf
[this,"fuelstation",10,0,true,[WEST,EAST],independent, true, {}, "", [1,10]] call grad_sectors_fnc_createSector;
```

![](http://i.imgur.com/nsb4yyx.png)

---
_Source: https://npm.io/package/grad-sectors · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
