Jump to content

arma3my

Community Member
  • Posts

    7
  • Joined

  • Last visited

  • Donations

    0.00 GBP 

Posts posted by arma3my

  1. What am i doing wrong here. The jet still not spawn randomly in the air as time set.
    fn_airfieldJet.sqf

    Spoiler

     

    /*
      Author: BACONMOP
      Spawns CSAT JET to CAS strike
         O_Plane_CAS_02_F
      LaserTargetE
     
      _laser = "LaserTargetE" createVehicle (getPos player);
      _laser attachTo [player,[0,0,0]];
     
     plane doTarget Player;
     
     Last modified:
        19/08/2017 by stanhope, AW-member
        
     Modified:
    updated some code, added a name to the jet group
     */
    jetCounter = jetCounter + 1;
    _accepted = false;
    _casType = ["airfieldSpawn","gunStrike"];
    _casCase = selectRandom _casType;
    _jetlist = ["O_Plane_CAS_02_F","O_Plane_CAS_02_F","O_Plane_Fighter_02_F","O_Plane_Fighter_02_Stealth_F","I_Plane_Fighter_04_F","I_Plane_Fighter_04_F"];
    _jettype = selectRandom _jetlist;

    switch (_casCase) do {

        case "airfieldSpawn":{
            private ["_jet"];
            _airField = [
                "AAC_CAS_Spawn",
                "Airbase_CAS_Spawn",
                "SaltLake_CAS_Spawn",
                "Molos_CAS_Spawn"
            ];
            if ("AAC_Airfield" in controlledZones) then {
                _airField = _airField - ["AAC_CAS_Spawn"];
            };
            if ("Central_Airfield" in controlledZones) then {
                _airField = _airField - ["Airbase_CAS_Spawn"];
            };
            if ("Almyra_Saltflats" in controlledZones) then {
                _airField = _airField - ["SaltLake_CAS_Spawn"];
            };
            if ("Molos_Airfield" in controlledZones) then {
                _airField = _airField - ["Molos_CAS_Spawn"];
            };
            _jetGrp = createGroup east;
            _jetGrp setGroupIdGlobal [format ['RT-Jet-%1', jetCounter]];
            if ((count _airField) > 0) then {
                _jetSpawn = selectRandom _airField;
                _jet = _jettype createVehicle (getMarkerPos _jetSpawn);
                _jet setDir markerDir _jetSpawn;
                _jet flyInHeight 1000;
                _jet lock 2;
                [_jet,_jetGrp] call BIS_fnc_spawnCrew;
                {_x addCuratorEditableObjects [[_jet]+ (units _jetGrp), false];} foreach adminCurators;
            };
            if ((count _airField) <= 0) then {
                _spawnPos = [(random 30000),(random 30000),3000];
                _jet = _jettype createVehicle (getMarkerPos _spawnPos);
                waitUntil {!isNull _jet};
                [_jet,_jetGrp] call BIS_fnc_spawnCrew;
                _jet engineOn TRUE;
                _jet allowCrewInImmobile TRUE;
                _jet flyInHeight 1000;
                _jet lock 2;
                {_x addCuratorEditableObjects [[_jet]+ (units _jetGrp), false];} foreach adminCurators;
            };
            _jetWp = _jetGrp addWaypoint [getMArkerPos currentAO,0];
            _jetWp setWaypointType "LOITER";
            _jetWp setWaypointLoiterRadius 2000;
            _jetWp setWaypointCompletionRadius 50;
            _accepted = false;
            while {!_accepted} do {
                _target = objNull;
                _targetPos = [0,0,0];
                _playerCount = count playableUnits;
                if (_playerCount > 0) then {
                    if (isMultiplayer) then {
                        _target = playableUnits select (floor (random (count playableUnits)));
                    } else {
                        _target = switchableUnits select (floor (random (count switchableUnits)));
                };
                };
                
                if ((!isNull _target) && (_target distance (getMarkerPos currentAO)) < 1500 && (_target isKindOf "Man")) then {
                    _laser = "LaserTargetE" createVehicle (getPos _target);
                    _laser attachTo [_target,[0,0,0]];
                    _accepted = true;
                };
                sleep 3;
                if ((_playerCount == 0) || !alive _jet) then {
                    _accepted = true;
                };
            };
            hint str _jet;
            waitUntil {sleep 5; !alive _jet};
        };

        case "gunStrike":{
            _accepted = false;
            while {!_accepted} do {
                _target = objNull;
                _targetPos = [0,0,0];
                _playerCount = count playableUnits;
                if (_playerCount > 0) then {
                    if (isMultiplayer) then {
                        _target = playableUnits select (floor (random (count playableUnits)));
                    };
                };
                
                if ((!isNull _target)) then {
                    if ((_target distance (getMarkerPos currentAO)) < 1500) then {
                        if (_target isKindOf "Man") then {
                            _targetPos = getPos _target;
                            _dir = random 360;
                            _strikeType = [0,1,2];
                            _run = _strikeType call BIS_fnc_selectRandom;
                            _randomPos = [[[_targetPos, 10],[]],[]] call BIS_fnc_randomPos;
                            _redSmoke = "SmokeShellRed" createVehicle _randomPos;
                            [_targetPos,_dir,_jettype,_run] call AW_fnc_createCas;
                            _accepted = true;
                        };
                        sleep 3;
                    };
                };
            };
        };
    };
    jetCounter = jetCounter + 1;

     

     

  2. Default is 12 minutes + random 8 minutes.

    Spoiler

    [_targetStartText] remoteExec ["AW_fnc_globalHint",0,false];
            [west,["SubAoTask"],["OPFOR have setup a radio communications tower in the AO. Take it out quickly or else they will use it to call in air strikes.","Radio Tower","radioCircle"],(getMarkerPos "radioCircle"),"Created",0,true,"destroy",true] call BIS_fnc_taskCreate;
            [] spawn {
                sleep (30 + (random 180));
                if (alive radioTower) then {
                    while {(alive radioTower)} do {
                        if (jetCounter < 3) then {
                        [] call AW_fnc_airfieldJet;
                        sleep (720 + (random 480));
                        };
                    };
                };
            };

     

    Edited to 5 minutes + random 3 minutes. What is sleep (30 + (random 180)); and if (jetCounter < 3) then { do?

    Spoiler

    [_targetStartText] remoteExec ["AW_fnc_globalHint",0,false];
            [west,["SubAoTask"],["OPFOR have setup a radio communications tower in the AO. Take it out quickly or else they will use it to call in air strikes.","Radio Tower","radioCircle"],(getMarkerPos "radioCircle"),"Created",0,true,"destroy",true] call BIS_fnc_taskCreate;
            [] spawn {
                sleep (30 + (random 180));
                if (alive radioTower) then {
                    while {(alive radioTower)} do {
                        if (jetCounter < 3) then {
                        [] call AW_fnc_airfieldJet;
                        sleep (300 + (random 180));
                        };
                    };
                };
            };


    For the Jet type this:

    Spoiler

    jetCounter = jetCounter + 1;
    _accepted = false;
    _casType = ["airfieldSpawn","gunStrike"];
    _casCase = selectRandom _casType;
    _jetlist = ["O_Plane_CAS_02_F","O_Plane_CAS_02_F","O_Plane_Fighter_02_F","O_Plane_Fighter_02_Stealth_F","I_Plane_Fighter_04_F","I_Plane_Fighter_04_F"];
    _jettype = selectRandom _jetlist;

     

    That's for the Jet to spawn base on SubObj. How to create a random Attack Chopper or Jets that isn't base on that. For example, the jet spawn from any airfield except base.

  3. 14 hours ago, Stanhope said:

    Now just grab the view distance one, rewrite it to only have local effect instead of global and put it in the initplayer.sqf.  I'm about 95% sure that that will work, haven't tested it tho.

    You mean like this,

    this addAction ["View Distance Settings", CHVD_fnc_openDialog, [], -99, false, true]] remoteExec ["addAction", -2, true];

  4. Hi,

    I need help on editing I&A 3.2.9 by installing ACE on it. I'm not good with coding or scripting.

    So far, I just edited the Arsenal Gear Limitation and Restrict TFAR Items and Backpacks with success.

     

     

    Plan:

    - Use most of ACE Modules

    - Remove I&A Revive System

    - Remove I&A Earplug Script

     

    My intention for this purpose is to host the mission as private for my community to play.

    Be advise, all the credits are unedited and it always goes to those who deserved it respectfully.

     

    With this, I attached a file for anyone who's willing to assist/help.

     

    Invade_&_Annex_3_2_9.Altis.rar

×
×
  • Create New...