Announcement

Collapse
No announcement yet.

TvT Sector Control - Warm Up Timer Script and Mission Parameters

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [GUIDE] TvT Sector Control - Warm Up Timer Script and Mission Parameters

    This is part of a tutorial for Team Vs Team (TvT) Sector Control to allow for a Warm Up Timer where you team must wait at the base for a period of time (defined in the mission parameters) where if you leave the base area you will be warned and then killed after 15 seconds of being outside the base zone.

    There are two YouTube video tutorials that go along with these scripts that will be embedded below. As well, the mission will be shared on Steam Workshop and will be linked below.

    This requires a few objects to be placed in the editor:
    1. An area marker for a circle which indicates the zone you may not leave. In this case it is 300m.
    2. An object on the map that will be named as westBase or independentBase which will be at the center of the zone. In this case I used an invisible helipad.

    description.ext
    Code:
    class Params
    {
        class TimeOfMission
        {
            title = "Time Of Day";
            values[] = {3,5,9,14,17,20,22};
            texts[] = {"3am","5am","9am","2pm","5pm","8pm","10pm"};
            default = 5;
        };
    
        class WarmUpTimer
        {
            title = "Warm Up Timer";
            values[] = {0,180,360};
            texts[] = {"No Warm Up","3 min","6 min"};
            default = 180;
        };
    };
    init.sqf
    Code:
    //start warm up script to give players time to gear up and limit them to their base until warm up time is over
    []execVM "Unk\warmUp.sqf";
    
    if (hasInterface) then {
        titleText ["TacticalGamer.com", "BLACK IN",9999];
        0 fadesound 0;
        sleep 10;
        if !(warmUpTimerActive == "false") then
        {
            titleText ["DO NOT LEAVE BASE UNTIL NOTIFIED", "BLACK IN",10];
        };
        10 fadesound 0.9;
    };
    initServer.sqf
    Code:
    //add this only to squash an undefined variable script error
    warmUpTimerActive = "true";
    publicVariable "warmUpTimer";
    Unk\warmUp.sqf
    Code:
    if (isServer) then
    {
        vehiclesRemoveFuelFrom = [b1,b2,b3,b4,b5,b6,i1,i2,i3,i4,i5,i6];
        publicVariable "vehiclesRemoveFuelFrom";
        {
            _x setFuel 0;
        }forEach vehiclesRemoveFuelFrom;
    
        sleep 2;
        []spawn {
            _warmUpValue = "WarmUpTimer" call BIS_fnc_getParamValue;
            warmUpTimerActive = "true";
            publicVariable "warmUpTimer";
            sleep 2;
            waitUntil {time > _warmUpValue};
            warmUpTimerActive = "false";
            publicVariable "warmUpTimer";
            {
                [_x,1] remoteExec ["setFuel",owner _x];
            }forEach vehiclesRemoveFuelFrom;
        };
    };
    
    
    if (hasInterface) then 
    {
        _run = true;
        _playersSide = side player;
    
        player sideChat "DO NOT LEAVE YOUR BASE UNTIL NOTIFIED!";
    
        while {_run} do
        {
            _warned = false;
            if !(warmUpTimerActive == "true") exitWith 
            {
                _run = false;
                titleText ["YOU MAY LEAVE YOUR BASE - GAME ON!!!", "PLAIN",10];
            };
    
            if (_playersSide == west && player distance westBase > 300 && !_warned) then
            {
                titleText ["GET IN BASE WITHIN 15 SECONDS OR BE KILLED", "PLAIN",13];
                sleep 15;
                _warned = true;
            };
            if (_playersSide == independent && player distance independentBase > 300 && !_warned) then
            {
                titleText ["GET IN BASE WITHIN 15 SECONDS OR BE KILLED", "PLAIN",13];
                sleep 15;
                _warned = true;
            };
    
            if (_playersSide == west && player distance westBase > 301 && _warned) then
            {
                player setDamage 1;
            };
            if (_playersSide == independent && player distance independentBase > 301 && _warned) then
            {
                player setDamage 1;
            };    
            sleep .2;
        };    
    };


    VIDEOS ON YOUTUBE
    The Warm Up Timer and Spawn Protection


    Using Mission Parameters


    STEAM WORKSHOP
    The Mission Files:
    http://steamcommunity.com/sharedfile.../?id=829502003
    |TG-189th| Unkl
    ArmA 3 Game Officer
    Dean of Tactical Gamer University
    189th Infantry Brigade Member

    SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN

Connect

Collapse

TeamSpeak 3 Server

Collapse

Advertisement

Collapse

Twitter Feed

Collapse

Working...
X