Jump to content

hogmason

Member
  • Content Count

    405
  • Joined

  • Last visited

  • Medals

Everything posted by hogmason

  1. So i have an if command that will fire up if a playable unit is within 30 mtrs of a crashed helicopter i have an array of all playable unit names and am trying the below but its not working i know the if (_players_array is not correct i just placed that there for a demo of what i am trying to do. i just need to figure out how to use the array. _players_array = [sgt,Medic2,Medic,Sniper,Machinegunner,Morter,Scout,FAC,IED_TECH,Ammo,AssualtTrooper,AssualtTrooper_1,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11]; if (_players_array distance _crashed_chopper <30) then { hint "Hold This Position untill further notice"; // Waves of enemy [] execVM "missions\common\wave.sqf"; }; how would i make this code work
  2. awsome cheers mate that will definatly get me on my way ;) ;)
  3. i thought wit the pub variable it would let me update an if command like such _trg=createTrigger["EmptyDetector", getPosATL crashed_chopper]; _trg setTriggerArea[30,30,0,false]; _trg setTriggerActivation["EAST","PRESENT",false]; _trg setTriggerStatements["this", "Site_Overrun = 0; publicvariable Site_Overrun;", ""]; //now later inside a loop if (Site_Overrun == 0) exitWith ---------- Post added at 22:05 ---------- Previous post was at 22:04 ---------- hold on i think i just digested that you mean use the Site_Overrun = 0; but dont need publicvariable Site_Overrun unless its not run server side. ---------- Post added at 22:06 ---------- Previous post was at 22:05 ---------- im only winging all this variable stuff have no idea bout them except use them to update changes for if commands and such never really found a good tut on them ;) ---------- Post added at 22:10 ---------- Previous post was at 22:06 ---------- getting this error with that trigger _trg=createTrigger["EmptyDetector", getPosATL> Error position: <createTrigger["EmptyDetector", getPosATL> Error 0 elements provided, 3 expected
  4. yeah i think i might go the trigger then something like (ive never really created triggers via code) this _trg=createTrigger["EmptyDetector", getPosATL crashed_chopper]; _trg setTriggerArea[30,30,0,false]; _trg setTriggerActivation["EAST","PRESENT",false]; _trg setTriggerStatements["this", "Site_Overrun = 0; publicvariable "Site_Overrun";", ""]; will that work ---------- Post added at 21:59 ---------- Previous post was at 21:56 ---------- and to delete a trigger id use deleteVehicle _trg correct
  5. Sorry my fualt it is inside a loop ---------- Post added at 21:38 ---------- Previous post was at 21:32 ---------- this is the code this subject highlighted in red ========= other code up here spawning shit ============= then i have [color="#FF0000"] while {true} do { if (({(_x distance _crashed_chopper) <30} count _players_array) > 0 ) exitWith { [sgt,nil,rgroupChat,"HOLD THIS POSITION."] call RE; [] execVM "missions\common\init_wave.sqf"; };[/color] }; sleep 60; [color="#FF0000"]_totalEnemy = {side _x == EAST} count allUnits; [/color] //End Task _grp = units _Survivor_grp; while {Site_Secure == 1 && Site_Overrun == 1 && Survivors_dead == 1} do { if (count _grp < 1) exitWith //set condition of survivors dead { Survivors_dead = 0; publicvariable "Survivors_dead"; [sgt,nil,rgroupChat,"All the Survivors Have been Killed!"] call RE; deleteMarker "Crash_Site"; deleteMarker "spawn1"; deleteMarker "spawn2"; deleteMarker "spawn3"; deleteMarker "spawn4"; deleteMarker "spawn5"; deleteVehicle Survivor; deleteVehicle Survivor1; ["AircraftDown","failed"] call SHK_Taskmaster_upd; [] call SHK_addTask; }; [color="#FF0000"] if (({(_x distance _crashed_chopper) <30} count _totalEnemy) > 0 ) exitWith //set condition of enemy units near crash site { Site_Overrun = 0; publicvariable "Site_Overrun"; [sgt,nil,rgroupChat,"The Enemy Have over run the crash site RETREAT!"] call RE; sleep 60; deleteMarker "Crash_Site"; deleteMarker "spawn1"; deleteMarker "spawn2"; deleteMarker "spawn3"; deleteMarker "spawn4"; deleteMarker "spawn5"; deleteVehicle Survivor; deleteVehicle Survivor1; ["AircraftDown","failed"] call SHK_Taskmaster_upd; [] call SHK_addTask; };[/color] if ({(_x distance POW_safe) <30} count _grp == (count _grp)) exitWith // set condition of survivor back at base. { Site_Secure = 0; publicvariable "Site_Secure"; sleep 20; [sgt,nil,rgroupChat,"Well done boys you saved the Survivors and held the crash site position!"] call RE; deleteMarker "Crash_Site"; deleteMarker "spawn1"; deleteMarker "spawn2"; deleteMarker "spawn3"; deleteMarker "spawn4"; deleteMarker "spawn5"; deleteVehicle Survivor; deleteVehicle Survivor1; ["AircraftDown","succeeded"] call SHK_Taskmaster_upd; [] call SHK_addTask; }; { if (!alive _x) then {_grp = _grp - [_x]}; } foreach _grp; sleep 1; }; ---------- Post added at 21:42 ---------- Previous post was at 21:38 ---------- got this error in rpt now Error in expression < (({(_x distance _crashed_chopper) <30} count _totalEnemy) > 0 ) exitWith { Si> Error position: <count _totalEnemy) > 0 ) exitWith { Si> Error count: Type Number, expected Array File C:\Users\natho\Documents\ArmA 2 Other Profiles\=Mason=\missions\TOUR_OF_DUTY_v1.Takistan\missions\tasks\tsk_Aircraft_down.sqf, line 92
  6. cheers mate but its not working no rpt error either _totalEnemy = {side _x == EAST} count allUnits; if (({(_x distance _crashed_chopper) <30} count _totalEnemy) > 0 ) exitWith { hint "test to see if the ai end task"; };
  7. what about to check if enemy ai are within 30 mtrs so i can fail the task for it was over run i thought something like this but dont work i looked around but cant find anything. _totalEnemy = {_x == EAST} count allUnits; if (({(_x distance _crashed_chopper) <30} count _totalEnemy) > 0 ) exitWith
  8. im getting this error Error in expression <this && {_x in players_array} count thislist> Error position: <&& {_x in players_array} count thislist> Error &&: Type Number, expected Bool,code ---------- Post added at 22:43 ---------- Previous post was at 22:42 ---------- this is what i done highlighted in red waituntil {!isnil "bis_fnc_init"}; //crash site marker [] call TOD_crash_mkr; //crashed chopper if (isServer) then { [color="#FF0000"]players_array[/color] = [sgt,Medic2,Medic,Sniper,Machinegunner,Morter,Scout,FAC,IED_TECH,Ammo,AssualtTrooper,AssualtTrooper_1,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11]; if (isnil "Site_Secure") then {Site_Secure = 0;}; if (isnil "Site_Overrun") then {Site_Overrun = 0;}; if (isnil "Survivors_dead") then {Survivors_dead = 0;}; [color="#FF0000"]if (isnil "Wave") then {Wave = 0;};[/color] Site_Secure = 1; publicvariable "POWs_rescued"; Site_Overrun = 1; publicvariable "POWs_death_Limit"; Survivors_dead = 1; publicvariable "Survivors_dead"; _Survivor_grp = createGroup west; _crash_type = ["UH1Wreck","UH60_wreck_EP1","C130J_wreck_EP1"] call BIS_fnc_selectRandom; [color="#FF0000"]_crashed_chopper[/color] = createVehicle [_crash_type, (getMarkerPos "Crash_Site"), [], 0, "NONE"]; //Survivors _Survivor_choice = ["USMC_Soldier_Officer","US_Soldier_Officer_EP1","BAF_Soldier_Officer_MTP"] call BIS_fnc_selectRandom; Survivor = _Survivor_grp createUnit [_Survivor_choice, (MarkerPos "Crash_Site"), [], 0, "FORM"]; sleep 0.2; Survivor switchMove "AinjPpneMstpSnonWrflDnon"; Survivor setcaptive true; Survivor setBehaviour "CARELESS"; Survivor disableAI "MOVE"; removeAllWeapons Survivor; Survivor setVehicleInit "this addAction ['Rescue Him!', 'missions\scripts\rescue.sqf'];"; sleep 1; Survivor1 = _Survivor_grp createUnit [_Survivor_choice, (MarkerPos "Crash_Site"), [], 0, "FORM"]; sleep 0.2; Survivor1 switchMove "AinjPpneMstpSnonWrflDnon"; Survivor1 setcaptive true; Survivor1 setBehaviour "CARELESS"; Survivor1 disableAI "MOVE"; removeAllWeapons Survivor1; Survivor1 setVehicleInit "this addAction ['Rescue Him!', 'missions\scripts\rescue.sqf'];"; processInitCommands; sleep 1; [_crashed_chopper] call Enemy_wave_mkrs; _[color="#FF0000"]trg=createTrigger["EmptyDetector", getPosATL _crashed_chopper]; _trg setTriggerArea[30,30,0,false]; _trg setTriggerActivation["WEST","PRESENT",false]; _trg setTriggerStatements["this && {_x in players_array} count thislist", "Wave = 1; publicVariable Wave;", ""];[/color] waitUntil { Wave == 1 }; [sgt,nil,rgroupChat,"HOLD THIS POSITION."] call RE; [] execVM "missions\common\init_wave.sqf";
  9. Its dynamically spawned mate in random positions
  10. righto so i am spawning vehicles in random spots now that all works fine but i have attempted to create units in all the empty seats in the vehicles but it is not working i gwt no rpt error but the vehicles are empty. this is all the code the fill seats part is in red //create the vehicles ///////////////////// waituntil {!isnil "bis_fnc_init"}; _veh_patrol_grp = createGroup east; _veh_patrol_center = createCenter east; MARKER_array = []; for "_i" from 0 to 100 do { _gamelogic = center; _towns1 = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _RandomPosition3 = position (_towns1 select (floor (random (count _towns1)))); _marker = createmarkerLocal [format ["mrk%1",random 999999], _RandomPosition3]; MARKER_array set[(count MARKER_array), _marker]; }; for "_i" from 0 to 10 do { _veh_patrol_type = ["T72_TK_EP1","T55_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_TK_EP1","BRDM2_ATGM_TK_EP1","M113_TK_EP1","UAZ_AGS30_TK_EP1","LandRover_MG_TK_EP1","UAZ_AGS30_TK_EP1","BRDM2_ATGM_TK_EP1","LandRover_SPG9_TK_EP1"] call BIS_fnc_selectRandom; _veh_patrol_gamelogic = center; _veh_patrol_towns = nearestLocations [getPosATL _veh_patrol_gamelogic, ["Hill","ViewPoint","StrongpointArea"], 25000]; // or "NameVillage","NameCity","NameCityCapital" _veh_patrol_RandomPosition = position (_veh_patrol_towns select (floor (random (count _veh_patrol_towns)))); _veh_patrol_vehicle = createVehicle [_veh_patrol_type, _veh_patrol_RandomPosition, [], 0, "NONE"]; _veh_patrol_vehicle setDir random 290; //_spawned = (_veh_patrol_vehicle select 0); //_veh_patrol_vehicle setVehicleInit "[""killed"",{null = this execVM 'common\newAA.sqf';}]"; //processInitCommands; [color="#FF0000"] _cargoNum = _veh_patrol_vehicle emptyPositions "cargo"; if (_cargoNum > 0) then { _fillSlots = round (random _cargoNum); _pos = getPos _veh_patrol_vehicle; _locGr = _pos findEmptyPosition [10, 100]; sleep .2; if (_locGr select 0 > 0)then { _cargo = [_locGr, _veh_patrol_grp , _cargoNum,[],[],[],[],[_fillSlots,.5]] call BIS_fnc_spawnGroup; sleep .2; {_x moveInCargo _veh_patrol_vehicle;} forEach units _cargo; }; };[/color] if (HOG_debug) then { [sgt,nil,rgroupChat,"Spawning Enemy Jet + Debug ON."] call RE; sleep 0.2; [_veh_patrol_vehicle,"patrol","ColorRed","mil_dot"] spawn TOD_debug_mkrs_fnc; }; }; any one know how to solve fix cheers.
  11. man once i recover from my daddy nap lmao i am going to use it that is bloody awsome mate you are a legend thank you ill let you know how i go ;)
  12. im trying to add a way to repair a destroyed vehicle i have got this to fixe damaged vehicles but it doesnt work when they are fully destroyed any ideas on how to do this if ! isdedicated then { if (count _this > 1) then { (_this select 1) playMove "ActsPercSnonWnonDnon_carFixing2"; sleep 7; (_this select 1) playMove "AinvPknlMstpSnonWrflDnon_medicEnd"; (_this select 0) setDammage 0; (_this select 0) setFuel 1; hint "Vehicle Repaired, Re-Fueled & Re-Armed"; }; if (!isNil ("vehicleRepairInitiated")) exitWith {}; vehicleRepairInitiated = true; waitUntil {sleep 1; alive player}; while {true} do { { if (!(_x getVariable ["usRepairsInitiated", false])) then { _id = _x addAction ["Repair Vehicle", "HOG_scripts\Vehicle_Repair\vehicleRepair.sqf", [], 1, false, true, "", "(getDammage _target) < 1 AND (getDammage _target) > 0 AND (faction _this) == 'BIS_US' AND (vehicle _this) == _this"]; _x setVariable ["usRepairsInitiated", true, false]; }; } foreach vehicles; sleep 5; }; };
  13. Yeah dtm thats were i got it from also. cheers mate ive given up on it after spending the last 2 days onit constantly lol. Yeah the tanks dont have empty seats mainly the jeeps and transport trucks is what i am after. Ill place my full code here in the next hour mate its changed abit. thanks heaps ---------- Post added at 08:30 ---------- Previous post was at 08:25 ---------- this is the code //create the vehicles ///////////////////// waituntil {!isnil "bis_fnc_init"}; sleep 10; _veh_patrol_center = createCenter east; _veh_patrol_grp = createGroup east; MARKER_array = []; for "_i" from 0 to 100 do { _gamelogic = center; _towns1 = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _RandomPosition3 = position (_towns1 select (floor (random (count _towns1)))); _marker = createmarkerLocal [format ["mrk%1",random 999999], _RandomPosition3]; MARKER_array set[(count MARKER_array), _marker]; }; for "_i" from 0 to 10 do { _veh_patrol_type = ["T72_TK_EP1","T55_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_TK_EP1","BRDM2_ATGM_TK_EP1","M113_TK_EP1","UAZ_AGS30_TK_EP1","LandRover_MG_TK_EP1","UAZ_AGS30_TK_EP1","BRDM2_ATGM_TK_EP1","LandRover_SPG9_TK_EP1"] call BIS_fnc_selectRandom; _veh_patrol_gamelogic = center; _veh_patrol_towns = nearestLocations [getPosATL _veh_patrol_gamelogic, ["Hill","ViewPoint","StrongpointArea"], 25000]; // or "NameVillage","NameCity","NameCityCapital" _veh_patrol_RandomPosition = position (_veh_patrol_towns select (floor (random (count _veh_patrol_towns)))); _spawn = [(_veh_patrol_RandomPosition), _veh_patrol_type, _veh_patrol_grp] call BIS_fnc_spawnVehicle; //_veh_patrol_vehicle = createVehicle [_veh_patrol_type, _veh_patrol_RandomPosition, [], 0, "NONE"]; _veh_patrol_vehicle setDir random 290; _spawned = (_spawn select 1); //_veh_patrol_vehicle setVehicleInit "[""killed"",{null = this execVM 'common\newAA.sqf';}]"; //processInitCommands; _cargoNum = _spawned emptyPositions "cargo"; if (_cargoNum > 0) then { _fillSlots = round (random _cargoNum); _pos = _veh_patrol_RandomPosition; _locGr = _pos findEmptyPosition [10, 100]; sleep .2; if (_locGr select 0 > 0)then { _cargo = [_locGr, _veh_patrol_grp , _cargoNum,[],[],[],[],[_fillSlots,.5]] call BIS_fnc_spawnGroup; sleep .2; {_x moveInCargo _spawned;} forEach units _cargo; }; }; };
  14. ok so i am working on a little script to spawn enemy patrols around a map but i have hit a rock. i am creating an array of spawn positions whitch are empty helipads, but when i use select _i later in the code it fails now i know its becouse i need a object not a array or whatever but how do i work around it this is what i have ill highlight the bit in red. waituntil {!isnil "bis_fnc_init"}; if (isServer) then { _gamelogic = center; MARKER_array = []; [color="#FF0000"]spawn_array = [];[/color] for "_i" from 0 to 100 do { _towns = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _RandomPosition = position (_towns select (floor (random (count _towns)))); _marker = createmarkerLocal ["WPT %1",_RandomPosition]; MARKER_array set[(count MARKER_array), _marker]; }; [color="#FF0000"]_selectmkr = (MARKER_array select _i); for "_i" from 0 to 50 do { _spawn_position = "HeliHEmpty" createVehicle (getMarkerPos _selectmkr); spawn_array set[(count spawn_array), _spawn_position]; };[/color] //Create Group /////////////////////// _side = east; _convoycenter = createCenter _side; _convoygrp = createGroup _side; for "_i" from 0 to 35 do { // Create Waypoints /////////////////////// _selectwp = (MARKER_array select _i); _wp = _convoygrp addWaypoint [(getmarkerpos _selectwp), 0]; [_convoygrp,_i] setWaypointType "MOVE"; [_convoygrp,_i] setWaypointCompletionRadius 30; [_convoygrp,_i] setwaypointCombatMode "BLUE"; [_convoygrp,_i] setWaypointFormation "FILE"; [_convoygrp,_i] setWaypointBehaviour "SAFE"; // Create Vehicle /////////////////////// //_selectPOS = (spawn_array select _i); [color="#FF0000"] _position = (spawn_array select _i);[/color] _vehicle = ["T72_TK_EP1","T55_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_TK_EP1","BRDM2_ATGM_TK_EP1","M113_TK_EP1","UAZ_AGS30_TK_EP1","LandRover_MG_TK_EP1","UAZ_AGS30_TK_EP1","BRDM2_ATGM_TK_EP1","LandRover_SPG9_TK_EP1"] call BIS_fnc_selectRandom; [color="#FF0000"] _patrol = [(getpos _position), [/color](getdir _position), (_vehicle), _convoygrp] call BIS_fnc_spawnVehicle; _spawnpatrol = (_patrol select 0); //_patrol setVehicleInit "[""killed"",{null = this execVM 'common\enemy_patrol_respawn.sqf';}]"; //processInitCommands; // Fill Vehicle Cargo ////////////////////// _cargoNum = _spawnpatrol emptyPositions "cargo"; if (_cargoNum > 0) then { _fillSlots = round (random _cargoNum); _pos = getpos _position; _locGr = _pos findEmptyPosition [10, 100]; sleep .2; if (_locGr select 0 > 0)then { _cargo = [_locGr, _convoygrp , _cargoNum,[],[],[],[],[_fillSlots,.5]] call BIS_fnc_spawnGroup; sleep .2; {_x moveInCargo _spawnpatrol;} forEach units _cargo; }; }; if (HOG_debug) then { [sgt,nil,rgroupChat,"Spawning Enemy vehicle."] call RE; sleep 0.2; [_spawnpatrol,"ptl","ColorGreen","mil_dot"] spawn TOD_debug_mkrs_fnc; }; sleep 1; }; }; cheers
  15. hogmason

    HVT/POW help

    place a marker on map named jail ==> this is where the POW will spawn in your mission folder place in your init.sqf ==== execVM "spawnpow.sqf"; then create a sqf file called spawnpow.sqf adding the above spawnpow.sqf code only. thats it now when the mission loads the pow will spawn on your marker the rescue code is activated threw the spawn code ;
  16. i ended up changing it to for "_i" from 0 to 35 do { // Create Waypoints /////////////////////// [color="#FF0000"]_selectwp = (MARKER_array select _i);[/color] _wp = _convoygrp addWaypoint [(getmarkerpos _selectwp), 0]; [_convoygrp,_i] setWaypointType "MOVE"; [_convoygrp,_i] setWaypointCompletionRadius 30; [_convoygrp,_i] setwaypointCombatMode "BLUE"; [_convoygrp,_i] setWaypointFormation "FILE"; [_convoygrp,_i] setWaypointBehaviour "SAFE"; // Create Vehicle /////////////////////// [color="#FF0000"]_position = "HeliHEmpty" createVehicle (getMarkerPos _selectwp);[/color] _vehicle = ["T72_TK_EP1","T55_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_TK_EP1","BRDM2_ATGM_TK_EP1","M113_TK_EP1","UAZ_AGS30_TK_EP1","LandRover_MG_TK_EP1","UAZ_AGS30_TK_EP1","BRDM2_ATGM_TK_EP1","LandRover_SPG9_TK_EP1"] call BIS_fnc_selectRandom; _patrol = [(getpos _position), (getdir _position), (_vehicle), _convoygrp] call BIS_fnc_spawnVehicle; now this works fine everything spawns and no errors BUT the first 1 to spawn spawns in a good spot the rest of them all spawn in the bottom left corner then move to there waypoints.
  17. So how would i get the veh class of the destroyed one
  18. looking for a command that will let me do things base on a certain distance from a player not just one player i need any player on the map. i.e spawn infantry in any random angle and a disatnce of 300 mtrs from a player
  19. cheers mate spot on that helps heaps. 1 question can i replace foreach [player1,player2,player3,player4,player5,player6]; with foreach playableunits;
  20. hogmason

    HVT/POW help

    i have it working with spawning the pow via script if it helps. MP COMPATIBLE spawnpow.sqf ==> just place a marker on the map where you want the pow to spawn createcenter WEST; P1grp = createGroup WEST; _P1man = ["UN_CDF_Soldier_AAT_EP1","UN_CDF_Soldier_AMG_EP1","UN_CDF_Soldier_Officer_EP1"] call BIS_fnc_selectRandom; // CHANGE TO WEST UNIT CLASSNAMES P1 = _P1grp createUnit [_P1man, (markerPos "jail"), [], 0, "FORM"]; // CHANGE MARKER NAME HERE FOR SPAWN POS - P1man = WILL SELECT 1 OF THE ABOVE UNITS sleep 0.2; P1 switchMove "boundCaptive_loop"; // PLACE POW IN CAPTURED POSITION HANDS TIED BEHIND BACK AND SITTING ON GROUND //P1 call {[P1,300,3] execVM "missions\scripts\pow_positions.sqf"}; // player setpos P1; P1 setcaptive true; P1 setBehaviour "CARELESS"; P1 disableAI "MOVE"; removeAllWeapons P1; P1 setVehicleInit "this addAction ['Rescue Him!', 'missions\scripts\rescue.sqf'];"; rescue.sqf _per = _this select 0; // Person who had the addAction _ldr = _this select 1; // Person who used the addAction _act = _this select 2; // ID of the addAction _per removeAction _act; _ldr switchMove "AinvPknlMstpSnonWrflDnon_medic3"; //MOVE FOR RESCUE DUDE TO LOOK LIKE HE GETTING POW sleep 15; _ldr switchMove "AinvPknlMstpSnonWrflDnon_medicEnd"; // FINISH RESCUE DUDES MOVES _per switchMove "boundCaptive_unaErc"; //POW STANDS UP [_per] joinSilent _ldr; _per = setskill 1; _per EnableAI "MOVE"; while {alive _per} do // this will add the addaction back on the pow if the rescue player dies { if (!alive _ldr) exitwith { _per setVehicleInit "this addAction ['Escort Him!', 'missions\scripts\escort.sqf']"; [sgt,nil,rgroupChat,"reset escort option!"] call RE; }; sleep 3; };
  21. i am trying to create a convoy and have hit a few issues. first this is the convoy "working good well they spawn ;) _supplypatrol = [_startpos, east,["LandRover_MG_TK_EP1", "LandRover_SPG9_TK_EP1","UAZ_MG_TK_EP1","UAZ_MG_TK_EP1","T72_TK_EP1","UAZ_AGS30_TK_EP1","Ural_ZU23_TK_EP1","UralRepair_TK_EP1","UralRepair_TK_EP1","UralRepair_TK_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup; 1) is there a away i can spawn the convoy i.e group already in the column formation if not how can i give them spacing so they dont spawn on each other this is how i spawn them "note not all the code is here only the marker part full code at bottom of page" _supplypatrol = [[color="#FF0000"]_startpos[/color], east,["LandRover_MG_TK_EP1", "LandRover_SPG9_TK_EP1","UAZ_MG_TK_EP1","UAZ_MG_TK_EP1","T72_TK_EP1","UAZ_AGS30_TK_EP1","Ural_ZU23_TK_EP1","UralRepair_TK_EP1","UralRepair_TK_EP1","UralRepair_TK_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup //startpos _startpos = getMarkerPos "startmkr"; _gamelogic = center; _towns = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _convoy_MARKER_start_position = position (_towns select (floor (random (count _towns)))); _Convoy_start_marker = createMarkerLocal ["startmkr", _convoy_MARKER_start_position]; _Convoy_start_marker setMarkerTypeLocal "mil_start"; _Convoy_start_marker setMarkerColorLocal "ColorRed"; _Convoy_start_marker setMarkerTextLocal "Convoy Start."; full code waituntil {!isnil "bis_fnc_init"}; if (isnil "convoy_reached_dest") then {convoy_reached_dest = 0;}; if (isnil "convoy_destroyed") then {convoy_destroyed = 0;}; convoy_reached_dest = 1; publicvariable "convoy_reached_dest"; convoy_destroyed = 1; publicvariable "convoy_destroyed"; //set vars _startpos = getMarkerPos "startmkr"; _endpos = getMarkerPos "endmkr"; //create convoy _supplypatrol = [_startpos, east,["LandRover_MG_TK_EP1", "LandRover_SPG9_TK_EP1","UAZ_MG_TK_EP1","UAZ_MG_TK_EP1","T72_TK_EP1","UAZ_AGS30_TK_EP1","Ural_ZU23_TK_EP1","UralRepair_TK_EP1","UralRepair_TK_EP1","UralRepair_TK_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup; // set skill //_leader = leader _supplypatrol; //_leader setRank "LIEUTENANT"; _supplypatrol allowFleeing 0; //_supplypatrol setskill 1; _supplypatrol setBehaviour "SAFE"; _supplypatrol setCombatMode "GREEN"; _supplypatrol setFormation "COLUMN"; _supplypatrol setSpeedMode "LIMITED"; //create patrol waypoints _wp =_supplypatrol addWaypoint[_startpos, 0]; _wp setWaypointBehaviour "SAFE"; _wp setWaypointSpeed "NORMAL"; _wp setwaypointtype "MOVE"; _wp setWaypointFormation "COLUMN"; _wp setWaypointTimeout [60,80,70]; _wp=_supplypatrol addWaypoint[_endpos, 0]; _grp = units _supplypatrol; while {convoy_destroyed == 1 && convoy_reached_dest == 1} do { if (count _grp < 5) then { convoy_destroyed = 0; publicvariable "POWs_death_Limit"; }; if ({(_x distance POW_safe) <30} count _grp == (count _grp)) then { convoy_reached_dest = 0; publicvariable "POWs_rescued"; sleep 20; }; { if (!alive _x) then {_grp = _grp - [_x]}; }foreach _grp; sleep 1; }; markers are on diff code this is them HOG_convoyMKRS_fnc = { _gamelogic = center; _towns = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _convoy_MARKER_start_position = position (_towns select (floor (random (count _towns)))); _Convoy_start_marker = createMarkerLocal ["startmkr", _convoy_MARKER_start_position]; _Convoy_start_marker setMarkerTypeLocal "mil_start"; _Convoy_start_marker setMarkerColorLocal "ColorRed"; _Convoy_start_marker setMarkerTextLocal "Convoy Start."; _gamelogic = center; _towns = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _convoy_MARKER_end_position = position (_towns select (floor (random (count _towns)))); _Convoy_start_marker = createMarkerLocal ["endmkr", _convoy_MARKER_end_position]; _Convoy_start_marker setMarkerTypeLocal "mil_end"; _Convoy_start_marker setMarkerColorLocal "ColorYellow"; _Convoy_start_marker setMarkerTextLocal "Convoy End!!!."; };
  22. ok so i am creating 2 markers on any random location using [color="#FF0000"] _gamelogic = center; _towns = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _convoy_MARKER_start_position = position (_towns select (floor (random (count _towns))));[/color] _Convoy_start_marker = createMarkerLocal ["startmkr", _convoy_MARKER_start_position]; _Convoy_start_marker setMarkerTypeLocal "mil_start"; _Convoy_start_marker setMarkerColorLocal "ColorRed"; _Convoy_start_marker setMarkerTextLocal "Convoy Start."; [color="#FF0000"] _gamelogic = center; _towns = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _convoy_MARKER_end_position = position (_towns select (floor (random (count _towns))));[/color] _Convoy_start_marker = createMarkerLocal ["endmkr", _convoy_MARKER_end_position]; _Convoy_start_marker setMarkerTypeLocal "mil_end"; _Convoy_start_marker setMarkerColorLocal "ColorYellow"; _Convoy_start_marker setMarkerTextLocal "Convoy End!!!."; but i have noticed that most times the 2 markers will spawn pretty close to each othe i.e next town down lol. is there away i can say stop this from happening maybe setting a check distance of like 2000mtrs.
  23. thanks guys appreciate the help so i am trying the near roads thing first just to spwan the vehicles on a road " i.e my start mkr" this is what i am trying but its not working _gamelogic = center; _towns = nearestLocations [getPosATL _gamelogic, ["FlatArea"], 25000]; _convoy_MARKER_start_position = position (_towns select (floor (random (count _towns)))); [color="#FF0000"]_rds = _convoy_MARKER_start_position nearRoads 10;[/color] _Convoy_start_marker = createMarkerLocal ["startmkr", [color="#FF0000"]_rds[/color]]; _Convoy_start_marker setMarkerTypeLocal "mil_start"; _Convoy_start_marker setMarkerColorLocal "ColorRed"; _Convoy_start_marker setMarkerTextLocal "Convoy Start.";
×