Jump to content

Ombra_ita

Member
  • Content Count

    16
  • Joined

  • Last visited

  • Medals

Everything posted by Ombra_ita

  1. Hi everyone, I am trying to make a script that makes a helicopter with a squad arrive to disembark and defend the area. Everything works except that the helicopter is not going away, it stays where it landed!!! The scripts uses other custom functions which names are pretty straightforward, so I guess you'll be able to help anyways. It automatically defines side, faction, helicopter type, infantry, what I am struggling with are the waypoints. Everything looks correct to me. Thanks in advance. FWK_fnc_enemyQrfAir: //Helicopter QRF of _side from random far start position to _destination params["_destination"]; //Spawning transport _startPos = [_destination, 3000, 5000] call FWK_fnc_getRandomAOLocation; _landingPos = [_destination, 25, 75] call FWK_fnc_getRandomAOLocation; _heloType = selectRandom FWK_EnemyHeloArray; _helipad = "Land_HelipadEmpty_F" createVehicle _landingPos; _spawnHelo = [_startPos, random 360, _heloType, FWK_EnemySide] call BIS_fnc_spawnVehicle; _heloObj = _spawnHelo select 0; _heloGrp = _spawnHelo select 2; //Spawning units in transport based on free seats _cargoSize = _heloObj emptyPositions "cargo"; _groupUnitsArray = + FWK_EnemyInfantryArray; _groupUnitsArray resize _cargoSize; _qrfGrp = [_startPos, FWK_EnemySide, _groupUnitsArray] call BIS_fnc_spawnGroup; { _x moveInCargo _heloObj } forEach units _qrfGrp; //Helo waypoint and unload _landWp = group _heloObj addWaypoint [_helipad, 0]; _landWp setWaypointType "TR UNLOAD"; _landWp setWaypointSpeed "FULL"; _landWp setWaypointBehaviour "CARELESS"; _landWp setWaypointStatements["true", "(vehicle this) land 'GET OUT';"]; //Go away waypoint for helo _awayWp = _heloGrp addWaypoint [[0,0,0], 0]; _awayWp setWaypointType "MOVE"; _awayWp setWaypointSpeed "FULL"; _awayWp setWaypointBehaviour "CARELESS"; _awayWp setWaypointStatements["true", "[vehicle this] spawn FWK_fnc_deleteVehicle;"]; _heloGrp setCurrentWaypoint _landWp; //Waiting for all troops to disembark waitUntil { {_x in _heloObj} count (units _qrfGrp) == 0; }; hint "sbloccato"; _heloGrp setCurrentWaypoint _awayWp; //Defend waypoint for QRF _defendWp = _qrfGrp addWaypoint [_destination, 20]; _defendWp setWaypointType "SENTRY"; _defendWp setWaypointSpeed "FULL"; _defendWp setWaypointBehaviour "COMBAT"; _defendWp setWaypointStatements["true", ""]; _qrfGrp setCurrentWaypoint _defendWp;
  2. Solved it by replacing the "go-away" waypoint with doMove command. _heloObj = _spawnHelo select 0; _heloGrp = _spawnHelo select 2; //Spawning units in transport based on free seats _cargoSize = _heloObj emptyPositions "cargo"; _groupUnitsArray = + FWK_EnemyInfantryArray; _groupUnitsArray resize _cargoSize; _qrfGrp = [_startPos, FWK_EnemySide, _groupUnitsArray] call BIS_fnc_spawnGroup; { _x moveInCargo _heloObj } forEach units _qrfGrp; //Helo waypoint and unload _landWp = group _heloObj addWaypoint [_helipad, 0]; _landWp setWaypointType "TR UNLOAD"; _landWp setWaypointSpeed "FULL"; _landWp setWaypointBehaviour "CARELESS"; _landWp setWaypointStatements["true", "(vehicle this) land 'GET OUT';"]; _heloGrp setCurrentWaypoint _landWp; //Waiting for all troops to disembark waitUntil { {_x in _heloObj} count (units _qrfGrp) == 0; }; //Defend waypoint for QRF _defendWp = _qrfGrp addWaypoint [_destination, 20]; _defendWp setWaypointType "SENTRY"; _defendWp setWaypointSpeed "FULL"; _defendWp setWaypointBehaviour "COMBAT"; _defendWp setWaypointStatements["true", ""]; _qrfGrp setCurrentWaypoint _defendWp; //Make helo go away _heloPilot = leader _heloGrp; _heloPilot doMove ([0,0,0]); //After 40 seconds delete helo and crew inside sleep 40; {deleteVehicle _x} forEach (crew _heloObj) + [_heloObj];
  3. Hello, this is a simple script to make some (random) units of a side surrender in given area and range Does it work in Multiplayer? Yes, MultiPlayer and SinglePlayer. What does this script do? Makes some (random) units of a side surrender in given area and range How do I use this script? Place the script in a trigger by giving 3 parameters: - Position - Range - Side How do I call the script? From a trigger or a script: [getMarkerPos "markerName", 1000, east] execVM "surrender.sqf"; surrender.sqf //Uncomment the following if used as function params["_position","_distance","_side"]; //Uncomment the following if used as script _position = _this select 0; _distance = _this select 1; _side = _this select 2; _unitsToSurrender = [_position nearEntities ["Man", _distance], {side _x == _side}] call BIS_fnc_conditionalSelect; { if ((random 1) > 0.5) then { _x setCaptive true; _x action ["surrender", _x]; }; } forEach _unitsToSurrender;
  4. Hello everyone, I've created this 2 scripts/functions because I was bored to find (for an hour) and kill the last enemy in a sector to get control of it, even though I had a hundred allies in it. I recommend to use both scripts as functions and not scripts, because both can be called multiple times and having functions can be a lot more handy if you guys are scripting. Does it work in multiplayer? Yes, MultiPlayer and SinglePlayer. What does this script/function do? This script accepts 2 parameters: - Position (center position of the sector) - Range (Ellipse range in meters) It calculates (by counting infantry of each side inside the sector) which side is owning the given sector and returns it as text. How does it calculate the infantry inside? It calls a second script which is getUnitsCount. This script can be also called by itself if you need it somewhere else, it accepts 3 parameters: - Position - Range - Side → of which you want to get the units count inside the area. If AI vehicles are inside the area, crew will be calculated. getUnitsCount returns the sum of the units, therefore an integer value. Return values - "west" → If BLUFOR are owning the sector; - "east" → If OPFOR are owning the sector; - "independent" → If Independents are owning the sector; - "civilian" → If no-one is owning the sector, which means not a single west, east or independent unit is inside the area, therefore civilians own it or it's currently contended (same units for each side) How do I call the script? [_positionParameter, _rangeInMeters] execVM "getCurrentOwnership.sqf"; How do I use it in a trigger? Simply put a trigger with the following condition, obviously on the right hand side instead of west you can use civilian, independent or east if you'd like to check if the given side has ownership of the area. It can be also called from other script if you like to do so. Make sure the trigger is ServerOnly!!!!! ([_positionParameter, _rangeInMeters] execVM "getCurrentOwnership.sqf") == "west" ----------------- SCRIPTS ----------------- getUnitsCount.sqf //Uncomment following if using as function //params [ "_position", "_distance", "_side" ]; //Uncomment following if using as script _position = _this select 0; _distance = _this select 1; _side = _this select 3; _infantrycount = 0; _countedvehicles = 0; _vehiclecrewcount = 0; _infantrycount = _side countSide ( [ _position nearEntities [ "Man", _distance],{ !(captive _x) && ((getpos _x) select 2 < 100) }] call BIS_fnc_conditionalSelect ); _countedvehicles = [ ( _position nearEntities [ ["Car", "Tank", "Air"], _distance] ), { ((getpos _x) select 2 < 750) && count (crew _x) > 0 } ] call BIS_fnc_conditionalSelect; _vehiclecrewcount = 0; { _vehiclecrewcount = _vehiclecrewcount + (_side countSide (crew _x)) } foreach _countedvehicles; //Return value (_infantrycount + _vehiclecrewcount) getCurrentOwnership.sqf (updated 08 march 2023) //Uncomment following if using as function //params["_position","_range"]; //Uncomment following if using as script _position = _this select 0; _range = _this select 1; _westCount = [_position, _range, west] call OFF_fnc_getUnitsCount; _eastCount = [_position, _range, east] call OFF_fnc_getUnitsCount; _indeCount = [_position, _range, independent] call OFF_fnc_getUnitsCount; _result = 0; if (_westCount > _eastCount && _westCount > _indeCount) then { _result = "west"; }; if (_westCount > _eastCount && _westCount < _indeCount) then { _result = "independent"; }; if (_eastCount > _westCount && _eastCount > _indeCount) then { _result = "east"; }; if (_eastCount > _westCount && _eastCount < _indeCount) then { _result = "independent"; }; if (_indeCount > _westCount && _indeCount > _eastCount) then { _result = "independent"; }; if (_indeCount > _westCount && _indeCount < _eastCount) then { _result = "east"; }; _result;
  5. Edited as did not always work if enemies was only INDEPENDENT side.
  6. What does this script do? This script creates a minefield with a random number of mines and IED, positioning them in a random way inside the given area. Does not include APERSTripMine (mines with cable) Does it work in multiplayer? Yes, it works in MultiPlayer and SinglePlayer Parameters _area → Marker → Set a marker area with the size you like in editor _minMinesCount → int → Minimum number of mines you want in the area _maxMinesCount → int → Maximum number of mines you want in the area How do I call the script? Just get into your init.sqf and place it like this, has to be server only. If you have multiple minefields you have to add multiple lines with each marker and number of mines. if (isServer) { ["MarkerName", 10, 30] execVM "randomMinefield.sqf"; }; Next improvements - Will use marker position and specified range manually instead of marker size which is not very handy. randomMinefield.sqf (thanks to Hypoxic125 for the error feedback) //Uncomment following if used as function //params["_area", "_minMinesCount", "_maxMinesCount"]; //Uncomment following if used as script _area = _this select 0; _minMinesCount = _this select 1; _maxMinesCount = _this select 2; _minesArray = ["ATMine","APERSBoundingMine","APERSMine","IEDLandBig_F","IEDUrbanBig_F","IEDUrbanSmall_F","IEDLandSmall_F"]; _minesCountInArea = random[_minMinesCount, _maxMinesCount/2, _maxMinesCount]; _areaDimensions = getMarkerSize _markerArea; _minesPositionRange = _areaDimensions select 0; //Creating random position and spawning mines for "_i" from 0 to _minesCountInArea - 1 do { _randomPos = [[_markerArea], []] call BIS_fnc_randomPos; _randomPos set [2, 0]; createMine[selectRandom _minesArray, _randomPos, [], 0]; }
  7. Thank you for your feedback. I will edit the main code!
  8. Hello, this is a simple script to halo jump a player. Does it work in Multiplayer? Yes, MultiPlayer and SinglePlayer. What does this script do? This script allows a player to HALO on a given point on a map. How do I use this script? Place the script in Select an object on the editor and place the following line into its init to allow HALO from the action menu: (remove <t color='#37A9E7'></t> to show it as plain white like any other action) //If script is in scenario root directory this addAction["<t color='#37A9E7'>H.A.L.O. Jump</t>","[player] execVM 'halo.sqf';"]; //If script is in other scenario directory this addAction["<t color='#37A9E7'>H.A.L.O. Jump</t>","[player] execVM 'yourFolder\halo.sqf';"]; halo.sqf //Uncomment following line if used as function //_unit = param[0]; //Uncomment following line if used as script _unit = _this select 0; _haloAltitude = 1000; //Opening map and handling click openMap true; mapclick = false; onMapSingleClick "clickpos = _pos; mapclick = true; onMapSingleClick """";true;"; waituntil {mapclick}; _haloLocation = clickpos; _unitLoadout = getUnitLoadout _unit; cutText ["H.A.L.O. in progress...", "BLACK OUT", 1]; sleep 1; openMap false; _unit setPos _haloLocation; _unit addBackpack "B_Parachute"; //Halo [_unit, _haloAltitude] call bis_fnc_halo; sleep 2; cutText ["", "BLACK IN", 1]; waitUntil {(getpos _unit select 2) < 2}; //Giving loadout back sleep 1; _unit setUnitLoadout _unitLoadout;
  9. Hi everyone, I've created this script to create a random weather and random forecasts each time you start a mission. It automatically passes all weather data to clients. The script is able to filter different kinds of weather based on supported terrain position: - Mediterranean islands; - Europe; - Middle east; Just put the script in the mission directory with the name you prefer and call it from the init.sqf file with the following. init.sqf if (isServer) then { [] execVM "nameYouPrefer.sqf"; }; Hope you enjoy. randomWeather.sqf /* Sets random weather and forecasts based on "real" world positioning. It supports add-ons maps. * Ombra 12/06/2020 * latest update 18/02/2022 */ CONST_MAX_RAIN_LEVEL = 0.6; //To avoid fps issues CONST_MAX_FOG_LEVEL = 0.6; //To prevent annoying fog _currentMap = worldName; _probabilityFog = random[0,0.5,1]; _probabilityRain = random[0,0.5,1]; //Declaring variables _currentOvercastCoef = 0; _forecastOvercastCoef = 0; _currentRainCoef = 0; _forecastRainCoef = 0; _currentFogCoef = 0; _forecastFogCoef = 0; _windSpeedN = 0; _windSpeedE = 0; _windDirection = 0; switch (_currentMap) do { //Calculating weather for desert terrains case "MCN_Aliabad"; case "takistan"; case "zargabad"; case "Mountains_ACR"; case "fallujah"; case "kunduz"; case "Shapur_BAF": { //Probability of 30% for deserts to encounter overcast (and therefore rain) if (_probabilityRain > 0.7) then { _currentOvercastCoef = random[0,0.5,1]; } else { _currentOvercastCoef = random[0,0.2,0.5]; }; _forecastOvercastCoef = random[0,0.5,1]; //Current rain only if overcast > 0.6 if (_currentOvercastCoef > 0.6) then { _currentRainCoef = random[0, CONST_MAX_RAIN_LEVEL/2, CONST_MAX_RAIN_LEVEL]; } else { _currentRainCoef = 0; }; _forecastRainCoef = random[0, CONST_MAX_RAIN_LEVEL/2, CONST_MAX_RAIN_LEVEL]; _currentFogCoef = 0; _forecastFogCoef = 0; //Some wind like sandstorms _windSpeedN = random[0,10,30]; _windSpeedE = random[0,10,30]; _windDirection = random[0, 180, 360]; }; //Calculating weather for european terrains (Vanilla and CUP) case "Bootcamp_ACR"; case "Woodland_ACR"; case "chernarus"; case "chernarus_summer"; case "Chernarus_Winter"; case "ProvingGrounds_PMC"; case "Enoch": { //Probability of 60% for northern EU to encounter overcast (and therefore rain) if (_probabilityRain > 0.4) then { _currentOvercastCoef = random[0,0.5,1]; } else { _currentOvercastCoef = random[0,0.2,0.5]; }; _currentOvercastCoef = random[0,0.5,1]; _forecastOvercastCoef = random[0,0.5,1]; if (_currentOvercastCoef > 0.6) then { _currentRainCoef = random[0, CONST_MAX_RAIN_LEVEL/2, CONST_MAX_RAIN_LEVEL]; } else { _currentRainCoef = 0; }; _forecastRainCoef = random[0, CONST_MAX_RAIN_LEVEL/2, CONST_MAX_RAIN_LEVEL]; //Probability of 30% for northern EU to encounter fog if (_probabilityFog > 0.7) then { _currentFogCoef = random[0, CONST_MAX_FOG_LEVEL/2, CONST_MAX_FOG_LEVEL]; } else { _currentFogCoef = 0; }; _forecastFogCoef = random[0, CONST_MAX_FOG_LEVEL/2, CONST_MAX_FOG_LEVEL]; //Not much wind in continental land _windSpeedN = random[0,10,20]; _windSpeedE = random[0,10,20]; _windDirection = random[0, 180, 360]; }; //Calculating weather for mediterranean terrains case "Stratis"; case "Altis"; case "Malden": { //Probability of 50% for northern EU to encounter overcast (and therefore rain) if (_probabilityRain > 0.5) then { _currentOvercastCoef = random[0,0.5,1]; } else { _currentOvercastCoef = random[0,0.2,0.5]; }; _currentOvercastCoef = random[0,0.5,1]; _forecastOvercastCoef = random[0,0.5,1]; if (_currentOvercastCoef > 0.6) then { _currentRainCoef = random[0, CONST_MAX_RAIN_LEVEL/2, CONST_MAX_RAIN_LEVEL]; } else { _currentRainCoef = 0; }; _forecastRainCoef = random[0, CONST_MAX_RAIN_LEVEL/2, CONST_MAX_RAIN_LEVEL]; _currentFogCoef = random[0, CONST_MAX_FOG_LEVEL/2, CONST_MAX_FOG_LEVEL]; _forecastFogCoef = random[0, CONST_MAX_FOG_LEVEL/2, CONST_MAX_FOG_LEVEL]; //Islands are windy _windSpeedN = random[0,20,40]; _windSpeedE = random[0,20,40]; _windDirection = random[0, 180, 360]; }; case "Tanoa": { //Probability of 80% for jungle areas to encounter overcast (and therefore rain) if (_probabilityRain > 0.2) then { _currentOvercastCoef = random[0,0.5,1]; } else { _currentOvercastCoef = random[0,0.2,0.5]; }; _currentOvercastCoef = random[0,0.5,1]; _forecastOvercastCoef = random[0,0.5,1]; if (_currentOvercastCoef > 0.5) then { _currentRainCoef = random[0, CONST_MAX_RAIN_LEVEL/2, CONST_MAX_RAIN_LEVEL]; } else { _currentRainCoef = 0; }; _forecastRainCoef = random[0, CONST_MAX_RAIN_LEVEL/2, CONST_MAX_RAIN_LEVEL]; //Probability of 20% for jungle areas to encounter fog if (_probabilityFog > 0.8) then { _currentFogCoef = random[0, CONST_MAX_FOG_LEVEL/2, CONST_MAX_FOG_LEVEL]; } else { _currentFogCoef = 0; }; _forecastFogCoef = random[0, CONST_MAX_FOG_LEVEL/2, CONST_MAX_FOG_LEVEL]; //Islands are windy _windSpeedN = random[0,20,40]; _windSpeedE = random[0,20,40]; _windDirection = random[0, 180, 360]; }; default { //Probability of 50% as default if (_probabilityRain > 0.5) then { _currentOvercastCoef = random[0,0.5,1]; } else { _currentOvercastCoef = random[0,0.2,0.5]; }; _currentOvercastCoef = random[0,0.5,1]; _forecastOvercastCoef = random[0,0.5,1]; if (_currentOvercastCoef > 0.5) then { _currentRainCoef = random[0, CONST_MAX_RAIN_LEVEL/2, CONST_MAX_RAIN_LEVEL]; } else { _currentRainCoef = 0; }; _forecastRainCoef = random[0, CONST_MAX_RAIN_LEVEL/2, CONST_MAX_RAIN_LEVEL]; //Probability of 30% to encounter fog if (_probabilityFog > 0.7) then { _currentFogCoef = random[0, CONST_MAX_FOG_LEVEL/2, CONST_MAX_FOG_LEVEL]; } else { _currentFogCoef = 0; }; _forecastFogCoef = random[0, CONST_MAX_FOG_LEVEL/2, CONST_MAX_FOG_LEVEL]; _windSpeedN = random[0,10,20]; _windSpeedE = random[0,10,20]; _windDirection = random[0, 180, 360]; }; }; //Setting weather 0 setOvercast _currentOvercastCoef; 0 setRain _currentRainCoef; 0 setFog _currentFogCoef; setWind [_windSpeedN, _windSpeedE, false]; 0 setWindDir _windDirection; forceWeatherChange; //Setting forecast 3600 setOvercast _forecastOvercastCoef; 3600 setRain _forecastRainCoef; 3600 setFog _forecastFogCoef; Up here it is posted as script but it can also be used as function: [] spawn YourTAG_fnc_randomWeather; Call the script file fn_randomWeather.sqf and place it in a scenario subfolder names functions. Then edit the description.ext file by putting standard function declaring: description.ext class CfgFunctions { class YourTAG { tag = "YourTAG"; class functions { file = "functions"; class randomWeather {}; }; }; }; If you use it in a function way you MUST call it from init.sqf in this way: if (isServer) then { [] spawn OFF_fnc_randomWeather; };
  10. @handlebar Thank you for sharing your comment. As reported I fixed the code by adding the initialization on _forecastRainCoef. The if clause was missing "then" as edited above.
  11. Hi, there might be. If you use the original Qilin with minigun not sure. But you try to use the composition... So you get the unarmed qilin in the editor and name it CAR for example. Then by using the 3D editor you put the minigun you want in its exact place, then in its code init you put [this, CAR] call BIS_fnc_attachToRelative; you should be able to unpack it I guess. Have a go and let me know.
  12. What does this script do? This script spawns random reinforcements (group from 4 to 10 men) of the desired faction at the given position, and they will automatically redirect to players position (at the moment of script call, as Last Known Position). Does it work in multiplayer? Yes, it works in MultiPlayer and SinglePlayer Parameters _faction → String → Faction (see below) _sideReinforcements → Side → Side of reinforcements of which can be → west, east, independent _spawnPosition → Position → Center position of where you want to spawn reinforcements _rangeOfSpawn → int → Range of spawn from spawnPosition (if you like to narrow spawn just set this as 1) _addVehicle → Bool → Add a support vehicle Do you think side can be redundant? Maybe, but faction has been added secondly as I didn't want plain CSAT reinforcements when I'm playing on Livonia with Specnaz units, you know? I know not all RHS units have been added, I probably will, no guarantee. If you do script, you can.. Just look at the code, it's easy. Supported Factions SUPPORTED VANILLA FACTIONS: BLU_F NATO (standard) OPF_F CSAT (standard) IND_F AAF (standard) BLU_T_F NATO (Apex, pacific) OPF_T_F CSAT (Apex, pacific) IND_C_F Syndikat (Apex) BLU_W_F NATO Woodland (Contact) OPF_R_F Specnaz (Contact) IND_E_F LDF (Contact) SUPPORTED MODS FACTIONS: rhs_faction_usarmy_d RHS USAF (USA Army D OCP) rhs_faction_usarmy_wd RHS USAF (USA Army D UCP) rhs_faction_usmc_d RHS USAF (USA Army D MARPAT) rhs_faction_usmc_wd RHS USAF (USA Army WD MARPAT) rhs_faction_msv RHS AFRF (Russia MSV EMR) rhs_faction_vdv RHS AFRF (Russia VDV DES) rhssaf_faction_army RHS SAF (KOV Digital) Tban EricJ Taliban Units Edit: Added Syndikat faction IND_C_F (26/02/2022) How do I call the script? Let's say I am a BLUFOR player and I call for reinforcements, just put the following line in a activation trigger line: ["BLU_F", west, getMarkerPos "spawnMarkerPoint", 1, true] execVM "reinforcements.sqf"; Let's say RHS AFRF (Russians) enemy called reinforcements instead, those reinforcement will proceed to my position to engage: ["rhs_faction_msv", east, getMarkerPos "russianReinforcementsSpawnMarker", 1, false] execVM "reinforcements.sqf"; reinforcements.sqf //Uncomment following if used as function //params["_faction","_sideReinforcements","_spawnPosition", "_rangeOfSpawn","_addVehicle"]; //Uncomment following if used as script _faction = _this select 0; _sideReinforcements = _this select 1; _spawnPosition = _this select 2; _rangeOfSpawn = _this select 3; _addVehicle = _this select 4; _unitsArray = []; _vehicleArray = []; _unitsArrayToSpawn = []; _counter = 0; //Parsing factions switch (_faction) do { //Vanilla case "BLU_F": //NATO (standard) { _unitsArray = [ "B_Soldier_SL_F", "B_Medic_F", "B_Soldier_GL_F", "B_Soldier_F", "B_HeavyGunner_F", "B_Soldier_LAT_F", "B_Soldier_M_F", "B_Soldier_AR_F", "B_Soldier_LAT2_F", "B_Soldier_UAV_F" ]; _vehicleArray = [ "B_MRAP_01_hmg_F" ]; }; case "OPF_F": //CSAT (standard) { _unitsArray = [ "O_Soldier_SL_F", "O_Medic_F", "O_Soldier_HAT_F", "O_Soldier_GL_F", "O_Soldier_F", "O_HeavyGunner_F", "O_Soldier_F", "O_Soldier_M_F", "O_Soldier_AR_F", "O_Soldier_UAV_F" ]; _vehicleArray = [ "O_MRAP_02_hmg_F" ]; }; case "IND_F": //AAF units { _unitsArray = [ "I_Soldier_SL_F", "I_Medic_F", "I_Soldier_GL_F", "I_Soldier_F", "I_Soldier_AR_F", "I_Soldier_F", "I_Soldier_AT_F", "I_Soldier_AA_F", "I_Soldier_M_F", "I_Soldier_UAV_F" ]; _vehicleArray = [ "I_MRAP_03_hmg_F" ]; }; case "IND_C_F": //Syndikat units { _unitsArray = [ "I_C_Soldier_Para_1_F", "I_C_Soldier_Para_2_F", "I_C_Soldier_Bandit_7_F", "I_C_Soldier_Bandit_1_F", "I_C_Soldier_Para_5_F", "I_C_Soldier_Bandit_6_F", "I_C_Soldier_Bandit_5_F", "I_C_Soldier_Bandit_4_F", "I_C_Soldier_Para_6_F", "I_C_Soldier_Para_3_F" ]; _vehicleArray = [ "I_C_Offroad_02_AT_F" ]; }; case "OPF_T_F": //Chinese CSAT (Apex) { _unitsArray = [ "O_T_Soldier_SL_F", "O_T_Medic_F", "O_T_Soldier_HAT_F", "O_T_Soldier_GL_F", "O_T_Soldier_F", "O_T_HeavyGunner_F", "O_T_Soldier_F", "O_T_Soldier_M_F", "O_T_Soldier_AR_F", "O_T_Soldier_UAV_F" ]; _vehicleArray = [ "O_T_MRAP_02_hmg_ghex_F" ]; }; case "BLU_T_F": //NATO Pacific (Apex) { _unitsArray = [ "B_T_Soldier_SL_F", "B_T_Medic_F", "B_T_Soldier_GL_F", "B_T_Soldier_F", "B_T_HeavyGunner_F", "B_T_Soldier_LAT_F", "B_T_Soldier_M_F", "B_T_Soldier_AR_F", "B_T_Soldier_LAT2_F", "B_T_Soldier_UAV_F" ]; _vehicleArray = [ "B_T_MRAP_01_hmg_F" ]; }; case "BLU_W_F": //NATO (Contact) { _unitsArray = [ "B_W_Soldier_SL_F", "B_W_Medic_F", "B_W_Soldier_GL_F", "B_W_Soldier_F", "B_W_HeavyGunner_F", "B_W_Soldier_LAT_F", "B_W_Soldier_M_F", "B_W_Soldier_AR_F", "B_W_Soldier_LAT2_F", "B_W_Soldier_UAV_F" ]; _vehicleArray = [ "B_T_MRAP_01_hmg_F" ]; }; case "OPF_R_F": //Specnaz (Contact) { _unitsArray = [ "O_R_Soldier_SL_F", "O_R_Medic_F", "O_R_Soldier_LAT_F", "O_R_Soldier_GL_F", "O_R_JTAC_F", "O_R_JTAC_F", "O_R_JTAC_F", "O_R_Soldier_M_F", "O_R_Soldier_AR_F", "O_R_JTAC_F" ]; _vehicleArray = [ "O_T_LSV_02_armed_F" ]; }; case "INF_E_F": //LDF (Contact) { _unitsArray = [ "I_E_Soldier_TL_F", "I_E_Medic_F", "I_E_Soldier_GL_F", "I_E_Soldier_F", "I_E_Soldier_AR_F", "I_E_Soldier_F", "I_E_Soldier_AT_F", "I_E_Soldier_AA_F", "I_E_Soldier_M_F", "I_E_Soldier_UAV_F" ]; _vehicleArray = [ "I_E_Offroad_01_covered_F" ]; }; case "rhs_faction_usarmy_d": //RHS USAF (USA Army D OCP) { _unitsArray = [ "rhsusf_army_ocp_squadleader", "rhsusf_army_ocp_medic", "rhsusf_army_ocp_grenadier", "rhsusf_army_ocp_rifleman", "rhsusf_army_ocp_autorifleman", "rhsusf_army_ocp_rifleman", "rhsusf_army_ocp_javelin", "rhsusf_army_ocp_marksman", "rhsusf_army_ocp_aa", "rhsusf_army_ocp_uav" ]; _vehicleArray = [ "rhsusf_m1025_d_m2" ]; }; case "rhs_faction_usarmy_wd": //RHS USAF (USA Army W UCP) { _unitsArray = [ "rhsusf_army_ucp_squadleader", "rhsusf_army_ucp_medic", "rhsusf_army_ucp_grenadier", "rhsusf_army_ucp_rifleman", "rhsusf_army_ucp_autorifleman", "rhsusf_army_ucp_rifleman", "rhsusf_army_ucp_javelin", "rhsusf_army_ucp_marksman", "rhsusf_army_ucp_aa", "rhsusf_army_ucp_uav" ]; _vehicleArray = [ "rhsusf_m1025_w_m2" ]; }; case "rhs_faction_usmc_d": //RHS USAF (USMC D) { _unitsArray = [ "rhsusf_usmc_marpat_d_squadleader", "rhsusf_navy_sarc_d_fast", "rhsusf_usmc_marpat_d_grenadier", "rhsusf_usmc_marpat_d_rifleman", "rhsusf_usmc_marpat_d_autorifleman", "rhsusf_usmc_marpat_d_rifleman", "rhsusf_usmc_marpat_d_javelin", "rhsusf_usmc_marpat_d_marksman", "rhsusf_usmc_marpat_d_stinger", "rhsusf_usmc_marpat_d_uav" ]; _vehicleArray = [ "rhsusf_m1025_d_s_m2" ]; }; case "rhs_faction_usmc_wd": //RHS USAF (USMC WD MARPAT) { _unitsArray = [ "rhsusf_usmc_marpat_wd_squadleader", "rhsusf_navy_sarc_wd_fast", "rhsusf_usmc_marpat_wd_grenadier", "rhsusf_usmc_marpat_wd_rifleman", "rhsusf_usmc_marpat_wd_autorifleman", "rhsusf_usmc_marpat_wd_rifleman", "rhsusf_usmc_marpat_wd_javelin", "rhsusf_usmc_marpat_wd_marksman", "rhsusf_usmc_marpat_wd_stinger", "rhsusf_usmc_marpat_wd_uav" ]; _vehicleArray = [ "rhsusf_m1025_w_s_m2" ]; }; case "rhs_faction_msv": { _unitsArray = [ "rhs_msv_emr_sergeant", "rhs_msv_emr_medic", "rhs_msv_emr_grenadier_rpg", "rhs_msv_emr_rifleman", "rhs_msv_emr_arifleman_rpk", "rhs_msv_emr_rifleman", "rhs_msv_emr_rifleman", "rhs_msv_emr_aa", "rhs_msv_emr_LAT", "rhs_msv_emr_marksman" ]; _vehicleArray = [ "rhs_tigr_sts_msv" ]; }; case "rhs_faction_vdv": { _unitsArray = [ "rhs_vdv_des_sergeant", "rhs_vdv_des_medic", "rhs_vdv_des_grenadier_rpg", "rhs_vdv_des_rifleman", "rhs_vdv_des_arifleman_rpk", "rhs_vdv_des_rifleman", "rhs_vdv_des_rifleman", "rhs_vdv_des_LAT", "rhs_vdv_des_aa", "rhs_vdv_des_marksman" ]; _vehicleArray = [ "rhs_tigr_sts_3camo_msv" ]; }; case "Tban": { _unitsArray = [ "TBan_Fighter6", "TBan_Fighter5", "TBan_Fighter4", "TBan_Fighter3NH", "TBan_Fighter2NH", "TBan_Fighter1NH", "TBan_Fighter3", "TBan_Fighter2", "TBan_Fighter1" ]; _vehicleArray = [ "Tban_O_Offroad_01_F" ]; }; case "rhssaf_faction_army": { _unitsArray = [ "rhssaf_army_m10_digital_sq_Lead", "rhssaf_army_m10_digital_medic", "rhssaf_army_m10_digital_gl", "rhssaf_army_m10_digital_rifleman_m70", "rhssaf_army_m10_digital_mgun_m84", "rhssaf_army_m10_digital_rifleman_m70", "rhssaf_army_m10_digital_rifleman_m70", "rhssaf_army_m10_digital_spec_aa", "rhssaf_army_m10_digital_spec_at", "rhssaf_army_m10_digital_sniper_m76" ]; _vehicleArray = [ "rhssaf_m1151_olive_pkm" ]; }; }; _groupSize = [4,10] call BIS_fnc_randomInt; _unitsArray resize _groupSize; //Random position around given position _randomSpawnPosition = [_spawnPosition, random _rangeOfSpawn, random 360] call BIS_fnc_relPos; //Spawning group _spawnedGroup = [_randomSpawnPosition, _sideReinforcements, _unitsArray] call BIS_fnc_spawnGroup; _waypoint = _spawnedGroup addWaypoint [position (allPlayers select 0), 0]; _waypoint setWaypointBehaviour "AWARE"; _waypoint setWaypointCombatMode "RED"; _waypoint setWaypointSpeed "FULL"; _waypoint setWaypointType "MOVE"; _waypoint setWaypointStatements ["true",""]; _spawnedGroup setCurrentWaypoint [_spawnedGroup, 0]; //Spawning vehicle if (_addVehicle) then { _vehGroup = [_randomSpawnPosition, _sideReinforcements, _vehicleArray] call BIS_fnc_spawnGroup; _wp = _vehGroup addWaypoint [position (allPlayers select 0), 0]; _wp setWaypointBehaviour "AWARE"; _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "FULL"; _wp setWaypointType "MOVE"; _wp setWaypointStatements ["true",""]; _vehGroup setCurrentWaypoint [_vehGroup, 0]; };
  13. Just added Syndikat faction (Apex expansion, independent)
  14. Does it work in multiplayer? Yes, MultiPlayer and SinglePlayer. What does this script/function do? This script requests a standard vehicle (unarmed) airdrop for moving purposes on player position. If there is enough space on the airdrop plane, it parachutes 2 vehicles. Supported factions and vehicles BLUFOR NATO (Blackfish NATO Apex Expansion, this place can only fit 1 Hunter or 2 Prowlers as unarmed vehicles) BLU_F BLU_T_F BLU_W_F → 1 Hunter or 2 Prowlers (random) BLUFOR RHS FACTIONS (cargo comes in a C-130 of RHS USAF mod) rhs_faction_usarmy_d rhs_faction_usmc_d rhs_faction_usarmy_wd rhs_faction_usmc_wd → 2 Unarmed Humvee INDEPENDENT (Blackfish NATO Apex Expansion) IND_F IND_E_F → 1 Strider OPFOR CSAT (Y-32 Xi'an Apex Expansion, this plane it only fits one vehicle) OPF_F OPF_T_F OPF_R_F → 1 Qilin (unarmed) OPFOR RHS FACTIONS (cargo comes in a Blackfish NATO Apex Expansion as there is no RHS AFRF plane for cargo (Y-32 Xi'an did not fit GAZ vehicle)) rhs_faction_msv rhs_faction_vdv → 1 GAZ (unarmed, green) How do I call the script? [player] execVM "vehicleDrop.sqf"; vehicleDrop.sqf //Uncomment following if used as function //_unit = param[0]; //Uncomment following if used as script _unit = _this select 0; _unitPos = position _unit; _randomTransportPos = [[_unitPos select 0, _unitPos select 1, 800], 3000, random 360] call BIS_fnc_relPos; _sideUnit = side _unit; _factionUnit = faction _unit; _vehicleType = 0; _transportType = "B_T_VTOL_01_vehicle_F"; switch(_factionUnit) do { //Vanilla units case "BLU_F": { _vehicleType = ["B_MRAP_01_F","B_LSV_01_unarmed_F"] call BIS_fnc_selectRandom; }; case "BLU_T_F"; case "BLU_W_F": { _vehicleType = ["B_T_MRAP_01_F","B_T_LSV_01_unarmed_F"] call BIS_fnc_selectRandom; }; case "OPF_F": { _vehicleType = "O_LSV_02_unarmed_F"; _transportType = "O_T_VTOL_02_vehicle_dynamicLoadout_F"; }; case "OPF_T_F"; case "OPF_R_F": { _vehicleType = "O_T_LSV_02_unarmed_F"; _transportType = "O_T_VTOL_02_vehicle_dynamicLoadout_F"; }; case "IND_F ": { _vehicleType = "I_MRAP_03_F"; }; case "IND_E_F": { _vehicleType = "I_E_Van_02_vehicle_F"; }; //RHS units case "rhs_faction_usarmy_d"; case "rhs_faction_usmc_d": { _vehicleType = "rhsusf_m1043_d"; _transportType = "RHS_C130J_Cargo"; }; case "rhs_faction_usarmy_wd"; case "rhs_faction_usmc_wd": { _vehicleType = "rhsusf_m1043_w"; _transportType = "RHS_C130J_Cargo"; }; case "rhs_faction_msv"; case "rhs_faction_vdv": { _vehicleType = "rhs_tigr_msv"; }; }; //Creating transport for cargo drop _transportArray = [_randomTransportPos, random 360, _transportType, _sideUnit] call BIS_fnc_spawnVehicle; _transportVeh = _transportArray select 0; _transportGrp = _transportArray select 2; //Support call _unit sideChat format["Crossroad this is %1 requesting vehicle drop at grid %2. Over.", name _unit, mapGridPosition _unitPos]; sleep 5; [_sideUnit, "HQ"] sideChat format["Solid copy %1, Buzzard it's 1 click out. ETA 1 minute.", name _unit]; //Spawning cargo and loading _cargoVehicle = _vehicleType createVehicle [0,0,1000]; _transportVeh setVehicleCargo _cargoVehicle; _cargoVehicle2 = _vehicleType createVehicle [20,20,1000]; if ((_transportVeh canVehicleCargo _cargoVehicle2) select 1) then { _transportVeh setVehicleCargo _cargoVehicle2; } else { deleteVehicle _cargoVehicle2; }; //Setting waypoints _waypoint = _transportGrp addWaypoint [_unitPos, 0]; _waypoint setWaypointBehaviour "CARELESS"; _waypoint setWaypointCombatMode "NOCHANGE"; _waypoint setWaypointSpeed "FULL"; _waypoint setWaypointType "MOVE"; _waypoint setWaypointStatements ["_transportVeh flyInHeight 200",""]; //Go to drop zone _transportGrp setCurrentWaypoint [_transportGrp, 0]; waitUntil { (_transportVeh distance _unitPos) < 200 }; //Drop cargo _transportVeh sideChat "Buzzard is making the drop. Code is purple, Good luck guys."; _transportVeh setVehicleCargo objNull; _transportVeh setVehicleCargo objNull; //Go away _waypoint2 = _transportGrp addWaypoint [[0,0,1000], 1]; _waypoint2 setWaypointBehaviour "CARELESS"; _waypoint2 setWaypointCombatMode "NOCHANGE"; _waypoint2 setWaypointSpeed "FULL"; _waypoint2 setWaypointType "MOVE"; _waypoint2 setWaypointStatements ["true",""]; _transportGrp setCurrentWaypoint [_transportGrp, 1]; waitUntil { (getPosATL _cargoVehicle) select 2 < 10 }; Signal = "SmokeShellPurple" createVehicle position _cargoVehicle; Signal = "SmokeShellPurple" createVehicle position _cargoVehicle2; sleep 30; //Cleanup {deleteVehicle _x} forEach (crew _transportVeh) + [_transportVeh];
  15. Hello, there are many ways to create an IED script but many things involve public or external variables, triggers and many stuff that makes it complex. This is a simple script that you also can use as function for multiple objects and triggers the IED automatically with just one script line inside the object you'd like to blow up. Does this work in multiplayer? Yes, it works in MultiPlayer and SinglePlayer How does this script work? As soon as AI or a player walks near it, it just explodes, leaving scripted debriefs and craters based on explosion intensity. Parameters It accept 3 parameters: - currentObject → it is the object in the editor that you trigger to explode; - iedIntensity → It used 3 level of intensity (how big is the blast), obviously you can put 1, 2 or 3. - isCar → boolean value (true, false) if is a car, if true keeps wreck of the vehicle. How do I call the script? Just open the object you'd like to have an IED and put the following line: [this, 1, true] execVM "iedBlast.sqf"; iedBlast.sqf //Uncomment following if used as function //params["_currentObject","_iedIntensity","_isCar"]; //Uncomment following if used as script _currentObject = _this select 0; _iedIntensity = _this select 1; _isCar = _this select 2; _positionCrater = getPosATL(_currentObject); _debriesCount = 0; _exploded = false; while { !_exploded } do { //Check if players are around { if((_x distance _currentObject) < 5) then { _exploded = true; }; } forEach allUnits; if(_exploded) then { switch(_iedIntensity) do { case 1: { _bombType = "M_Titan_AT" createVehicle (getPos _currentObject); soilCrater = "Land_ShellCrater_01_F" createVehicle ([0,0,0]); _debriesCount = 3; }; case 2: { _bombType = "Bo_Mk82" createVehicle (getPos _currentObject); soilCrater = "Land_ShellCrater_02_small_F" createVehicle ([0,0,0]); _debriesCount = 10; }; case 3: { _bombType = "IEDLandBig_Remote_Ammo" createVehicle (getPos _currentObject); soilCrater = "Land_ShellCrater_02_large_F" createVehicle ([0,0,0]); _debriesCount = 15; }; }; soilCrater setPos _positionCrater; //---Keep Car Wreck--- if(!_isCar) then { deletevehicle _currentObject; } else { _currentObject setDammage 1; }; //---Spawning debries--- //Land_ShellCrater_02_debris_F for "_i" from 1 to _debriesCount do { _distance = [2, _debriesCount] call BIS_fnc_randomInt; _direction = [0,359] call BIS_fnc_randomInt; _randomPos = [_positionCrater, _distance, _direction] call BIS_fnc_relPos; "Land_ShellCrater_02_debris_F" createVehicle _randomPos; }; }; };
×