Jump to content

Spawn snipers in response to vip


Recommended Posts

back on topic :

Spoiler

[]spawn{
_excess = 10;
_radius=50;
_counter =0;
while {_counter<_excess} do {
waituntil {inputaction "pushtotalk">0};
_counter=(_counter +1);
hint format ["radio counter %1", _counter ];
sleep 1;
};
playsound "electricity_loop";
_pos = getPosWorld player;
_highestPos = [0,0,0];
_highestHeight = 0;
_posX = 0;
_posY = 0;
_startPos = (_pos getPos [_radius/2-5, 0]) getPos [_radius/2-5, -90];
_currentPos = _startPos;
for "_posY" from 10 to _radius step 10 do{
    for "_posX" from 10 to _radius step 10 do{
        if(getTerrainHeightASL _currentPos > _highestHeight)then{
            _highestHeight = getTerrainHeightASL _currentPos;
            _highestPos = _currentPos;
        };
        _currentPos = _currentPos getPos [10, 90];
    };
    _currentPos = _startPos getPos [_posY, -180];
};

_grp = createGroup east;
_snipercover =[];
for "_i" from 1 to 10 step 1 do{
_snipercover = createVehicle ["Land_Grave_dirt_F",_highestpos, [], 15, "none"];
};
_sniper = _grp createUnit ["O_T_sniper_F", getposatl _snipercover, [], 0, "can collide"];

_sniper setunitpos "auto";
_sniper setcombatmode "red";
_sniper setbehaviour "stealth";
_sniper dowatch getpos player;
_sniper dotarget player;
_sniper setskill 0.9;
}

 

 

counts number of "radio" transmissions and/or number of seconds as trigger (*atm i could only do  it to work for the vanilla "TAB" key PushToTalk) and once _excess (10 sec and/or transmissions) is reached gives a sound warning and spawns a sniper and some "cover" for him at a high ground, at a distance of _radius (50m but could go up to 1000m) from player.


 

Spoiler

 

The logic flow was:

1 find ASL player, check if near AO
2 trigger excessive radio chatter, +/-give subtle warning to ASL
3 find high position to spawn the sniper
4 spawn sniper at high position and make him "smart" and join the action
5 after 5 min remove sniper if not dead and the _snipercover obj created

6 reset radio chatter counter and make  the script loop

 

1  i didn't try yet

2 its done but only for "vanilla PushToTalk"

3 its done / could be refined

4 done / still needs refinement to make the sniper smarter

5,6 i tried but did not manage to get it to work

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Forum Statistics

    11.1k
    Total Topics
    66.4k
    Total Posts
×
×
  • Create New...