EASY SECTOR CONTROL (ESC)
Version: 0.6

Coded By: g_n_o_s_i_s
Email: mats@ronin-group.org

LICENSE
-------

Free to use and modify. All I ask is that you send me any functionality modifications or fixes you have made to this package if you plan to distribute any mission made with it. This way the script will become better for all (credit will be duly given to those who contribute).

INTRODUCTION
------------

ESC is a collection of scripts designed to make Sector Control missions dirt simple.  You don't need to know anything about triggers or scoring systems.  The scripts will take care of creating triggers that flip the flags, changing colors of the markers to indicate who controls what sector, and keep track of score and game parameters. 

FEATURES
--------

* Easily create Sector Control missions for up to three sides (BLUFOR, OPFOR, and RACS)
* Customizable teamnames (default US, SLA, RACS).
* Easily integrate timelimit and/or scorelimit from your description.ext file.
* Automatic scoring system with built in scoreboard.
* Different scores given to capture a sector and to hold a sector.
* Customizable to change capture score, hold score, hold interval, scoreboard display interval, scorelimit, timelimit, and capture time.

INSTALLATION
------------

Unzip the page into your root mission folder. You should end up with one directory named 'esc' in your mission folder. 

USAGE
-----

WHILE TESTING ON NON-DEDICATED SERVER MAKE SURE GNO_dedicated is set to false.

Create a marker for each sector in your mission, make sure there is no space in name.  Add the marker names to your init.sqf.  For eaxample, if I create three sectors named "Flag1", "Flag2", and "Flag3" I'd add.

["Flag1", "Flag2", "Flag3"] execVM "esc\init_esc.sqf";

If you don't have an init.sqf file just create a file called 'init.sqf' in your mission folder and add the line. Make sure the capitalization is the same as you named them in editor.

You can also add a text to the marker, this will be used in triggers to show who is capturing what, etc.  If no text is added marker name will be used.

To make the script work with timelimits and/or scorelimits set in description.ext make sure you have something like this in your description.ext file.

titleParam1 = "TIME LIMIT";
valuesParam1[] = {900, 1800, 3600};
defValueParam1 = 900;
textsParam1[] = {"15 min", "30 min", "1 hr"};

titleParam2 = "SCORE LIMIT";
valuesParam2[] = {100,200,300,400};
defValueParam2 = 100;
textsParam2[] = {100,200,300,400};

Then just uncomment the line(s) in esc\init_esc.sqf that reads;

GNO_timelimit = param1;
GNO_scorelimit = param2;


CUSTOMIZATION
-------------

In the file esc/init_esc.sqf you have a number of customization options, they are as follows.

GNO_initalscore = 5;
The inital points given for capturing the sector.


GNO_repeatscore = 10;
The points given to hold a sector for determined span of time.


GNO_repeattime = 30;
The time between giving out point in seconds.


GNO_scoreboarddelay = 10;
The time between displaying the scoreboard.


GNO_timelimit = 3600;
Timelimit for game.  Can by easily customizable to handle variables set in lobby.

GNO_scorelimit = 300;
Scorelimit for game.  Can be easily customizable to handle variables set in lobby.

GNO_capturedelay = 5;
Time in seconds it takes to capture a sector.

GNO_triggersize = 5;
Size of triggers being created.

GNO_westname = "US";
GNO_eastname = "SLA";
GNO_guername = "RACS";
Name of teams.

GNO_westscoreboardname = "US:   ";
GNO_eastscoreboardname = "SLA:   ";
GNO_guerscoreboardname = "RACS: ";
These are used to tweak the scoreboard so points line up as close as you can to a column. If you set a scoreboardname to "" it will be removed from scoreboard.  Why oh why can't we just include tabs in texts.


GNO_dedicated = true;
If the server is running in dedicated mode or local mode. Use 'false' while designing your mission.

GNO_debug = false;
Mainly used by me to test the script. Probably safe to set to 'false'.


KNOWN ISSUES
------------

No sound played on sector capture.
All three teams still show up on final score screen. (set to be fixed in a future update)
If two players from different sides occupy a trigger on a sector.  The trigger will flip between the two endlessly.  Chances you have two alive players from two differnt sides occupying a 5m radius around flag for any length of time is slim though.

CHANGELOG
---------

V0.6
* Completely rewrote the codebase after issues with previous.
* You can now have any arbitrary number of sectors.
* Marker text will be used to show what sector being captured if it is there.
* You can name your marker anything as long as it does not have any spaces in its name.
* Scoreboard can be customized to only include teams being used as well as what names they will have.
* Renamed a bunch of customization variables.
* Added GNO_triggersize to define the trigger size.
* Added GNO_westname, GNO_eastname, and GNO_guername to define the team names.

V0.5
* Added GNO_captime to set the time it takes to capture a sector.
* Renamed West, East, Guer to BLUFOR, OPFOR, and RACS. 

V0.4
* Gamelogic named server is dynamically created if it doesn't already exist in the mission.
* Ending trigger is now created automatically and the final score is displayed when triggred.
* Cleaned up init_esc.sqf for testing dedicated server vs local.
* Messages now display when a flag is captured.
* Added GNO_timelimit and GNO_scorelimit to define end of game.
* Mainloop added that tracks time played and sets GNO_gameover = 1 when finished.
* Mainloop quits with game ending if scorelimit is reached.
* Debug messages are displayed only to player with name defined in GNO_debugname.
* Easy integration of timelimit and/or scorelimit set in description.ext.


V0.3
* Inital Beta Release (BDA Exclusive)

CREDITS
---------

Thanks to BDA (Beer Drinking Assassins) for helping me test this script, and in particular Youngstown*BDA*.

A special thanks to Breeze[BDA] for his assistance, assurance and help in testing this on a live server, without him this would have been just another pipe dream of mine.  Thanks Breeze.

