-
Content Count
88 -
Joined
-
Last visited
-
Medals
-
We did some tests and found that the problem happens when the "AI advanced enemy shoot aggressively at players" param is active. Tested without mods.
-
We use : - S.O.G. - CBA_A3 - Unsung Redux - Zeus Enhanced
-
Crazy_Man started following Music for each group, [MP] co40 Domination!, Name Tags JIP issues and and 4 others
-
Hi Xeno, I play your domination mission with my team and I edited some stuff like add my custom nametags and possibility to recruit AI on deployed MHQ. Is there a way to avoid enemy AIs to shoot at the unconscious players waiting for revive? I saw that you set captive players when they're unconscious. -Tested at base, enemy AIs don't shoot at the unconscious players. -Tested on battlefield, enemy AIs keep shooting on the unconscious players.
-
The problem is solved ! Thanks for responses. Special thanks to RCA3 for testing. 😉 initServer.sqf : waitUntil {time > 0}; arrPlayers = []; initPlayerServer.sqf : _player = _this select 0; waitUntil {!isNil "arrPlayers"}; _playerID = "playerID" + "_" + (getPlayerUID _player); arrPlayers pushBackUnique _playerID; publicVariable "arrPlayers"; initPlayerLocal.sqf : [_this select 1] execVM "scripts\nameTags.sqf"; nameTags.sqf : params ["_didJIP"]; _playerID = "playerID" + "_" + (getPlayerUID player); [[player, _playerID, _didJIP],{ if (!hasInterface) exitWith {}; params ["_player", "_playerID", "_didJIP"]; missionNamespace setVariable [_playerID, _player, false]; _player setVehicleVarName _playerID; if (_didJIP) then { _clientID = "playerID" + "_" + (getPlayerUID player); [ [player, _clientID], { params ["_player", "_clientID"]; missionNamespace setVariable [_clientID, _player, false]; _player setVehicleVarName _clientID; } ] remoteExecCall ["call", remoteExecutedOwner]; }; } ] remoteExecCall ["call", 0]; MISSION_ROOT = getMissionPath ""; KK_fnc_trueZoom = { ( [0.5,0.5] distance2D worldToScreen positionCameraToWorld [0,3,4] ) * ( getResolution select 5 ) / 2 }; fnc_nameTags = { #define LIMITDISTANCE 2000 #define NAMEDISTANCE 250 #define ICON_sizeScale 0.75 idNameTags = addMissionEventHandler ["Draw3D", { { _unit = (call compile _x); if (!(player distance2D _unit > LIMITDISTANCE) && alive _unit/* && player != _unit */&& !isNull _unit && (vehicle _unit == _unit || (vehicle _unit != _unit && effectiveCommander vehicle _unit == _unit))) then { _distanceUI = round (_unit distance vehicle player); _icon = "pictures\WEST.paa"; _textSpaced = 0.0062; _targetPosition = _unit modelToWorldVisual[0,0,2]; _playerPosition = positionCameraToWorld[0,0,0]; _distance = _targetPosition distance _playerPosition; _fov = call KK_fnc_trueZoom; _dir = _targetPosition vectorDiff _playerPosition; _playerDir = _playerPosition vectorFromTo positionCameraToWorld[0,0,1]; _cross = (_playerDir) vectorCrossProduct [0,0,1]; _drawUpNormal = vectorNormalized (_cross vectorCrossProduct _dir); // CHECK INJURED private ["_icon"]; if (lifeState _unit == "INCAPACITATED") then {_icon = MISSION_ROOT + "pictures\INJURED.paa"} else {_icon = MISSION_ROOT + "pictures\WEST.paa"}; // ICON _uiScale = (0.55 / (getResolution select 5)) * ICON_sizeScale; _iconSize = (1 - ((_distance / LIMITDISTANCE) * 0.7)) * _uiScale * 1; _drawUpIcon = _drawUpNormal vectorMultiply ((_textSpaced*2.8) * _distance / _fov); _drawPosIcon = _targetPosition vectorAdd _drawUpIcon; drawIcon3D [_icon, [1,1,1,1], _drawPosIcon, _iconSize, _iconSize, 0]; // NAME private ["_drawPosDist"]; if (_distance <= NAMEDISTANCE || {cursorTarget == _unit}) then { _drawUpName = _drawUpNormal vectorMultiply ((_textSpaced*2) * _distance / _fov); _drawPosName = _targetPosition vectorAdd _drawUpName; if (damage _unit > 0 && player getUnitTrait "Medic" && !(lifeState _unit == "INCAPACITATED")) then { drawIcon3D ["", [1,1,1,1], _drawPosName, 0, 0, 0, (name _unit) + " (" + (str (floor((1 - damage _unit) * 100))) + "%)", 2]; } else { drawIcon3D ["", [1,1,1,1], _drawPosName, 0, 0, 0, name _unit, 2]; }; _drawUpDist = _drawUpNormal vectorMultiply (_textSpaced * _distance / _fov); _drawPosDist = _targetPosition vectorAdd _drawUpDist; } else { _drawUpDist = _drawUpNormal vectorMultiply ((_textSpaced*2) * _distance / _fov); _drawPosDist = _targetPosition vectorAdd _drawUpDist; }; // DISTANCE drawIcon3D ["", [0.8,1,1,1], _drawPosDist, 0, 0, 0, format ["%1 m", _distanceUI], 2]; // VEHICLE if (vehicle _unit != _unit && effectiveCommander vehicle _unit == _unit) then { _drawUpVeh = _drawUpNormal vectorMultiply ((_textSpaced*4.6) * _distance / _fov); _drawPosVeh = _targetPosition vectorAdd _drawUpVeh; _veh = getText (configFile >> "CfgVehicles" >> (typeOf vehicle _unit) >> "DisplayName"); drawIcon3D ["", [0.443,0.776,0.443,1], _drawPosVeh, 0, 0, 0, _veh, 2]; }; }; } forEach arrPlayers; }]; }; fnc_toogleNameTags = { if (!isNil "idNameTags") then { systemChat "Name tags desactivated"; removeMissionEventHandler ["Draw3D", idNameTags]; idNameTags = nil; } else { systemChat "Name tags activated"; [] call fnc_nameTags; }; }; waituntil {!isnull (finddisplay 46)}; (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 219) then {[] call fnc_toogleNameTags}"]; SOLVED
-
Ok, tested right now on dedicated but same issue. I just rectify a detail : "So basically the problem occurs only if a player do JIP and so cannot see the nametags of already connected players who didn't respawn at least once since he connected." If I try a second JIP I can see the nametags of my friend who already respawned once. initPlayerLocal.sqf : _didJIP = _this select 1; if (_didJIP) then { { _playerID = "playerID" + "_" + (getPlayerUID player); [ [player, _playerID], { params ["_player", "_playerID"]; missionNamespace setVariable [_playerID, _player, false]; _player setVehicleVarName _playerID; } ] remoteExec ["call", remoteExecutedOwner]; } remoteExec ["spawn", [0, -2] select isDedicated]; }; [] execVM "scripts\nameTags.sqf";
-
Thanks for the responses. Since the fnc_nametags is fired by a displayAddEventHandler the script is excuted localy for each clients, no problem with that. So basically the problem occurs only if a player do JIP and so cannot see the nametags of already connected players who didn't respawn at least once since he connected. I figure that, in the initPlayerlocal.sqf, the line : waitUntil {(!isNull player) && (player == player) && !((lifeState player) in ["DEAD", "DEAD-RESPAWN", "DEAD-SWITCHING"])}; (who try to check if an already connected client responde to the JIP client with his player object when it is not null (not dead or not waiting for respawn) in order to name it locally as a variable on the JIP client) doesn't work as intended...
-
Hi all, I encounter a problem with JIP players for a name tags script. When a player do JIP the name tags of currently connected players aren't shown until they respawn once. But after one respawn from other players the script works correctly even if the JIP player do JIP again. I tried many ways to find a solution but for now I'm still stuck with this... init.sqf : [] execVM "scripts\nameTags.sqf"; initServer.sqf : waitUntil {time > 0}; arrPlayers = []; initPlayerServer.sqf : _player = _this select 0; waitUntil {(!isNull _player) && (_player == _player)}; waitUntil {time > 0}; waitUntil {!isNil "arrPlayers"}; _playerID = "playerID" + "_" + (getPlayerUID _player); arrPlayers pushBackUnique _playerID; publicVariable "arrPlayers"; [[_player, _playerID], { params ["_player", "_playerID"]; missionNamespace setVariable [_playerID, _player, false]; _player setVehicleVarName _playerID; }] remoteExec ["spawn", 0]; initPlayerLocal.sqf : _didJIP = _this select 1; waitUntil {(!isNull player) && (player == player)}; if (_didJIP) then { { //waitUntil {alive player}; waitUntil {(!isNull player) && (player == player) && !((lifeState player) in ["DEAD", "DEAD-RESPAWN", "DEAD-SWITCHING"])}; _playerID = "playerID" + "_" + (getPlayerUID player); [ [player, _playerID], { params ["_player", "_playerID"]; missionNamespace setVariable [_playerID, _player, false]; _player setVehicleVarName _playerID; } ] remoteExec ["call", remoteExecutedOwner]; } remoteExec ["spawn", [0, -2] select isDedicated]; }; nameTags.sqf : if !(hasInterface) exitWith {}; MISSION_ROOT = getMissionPath ""; KK_fnc_trueZoom = { ( [0.5,0.5] distance2D worldToScreen positionCameraToWorld [0,3,4] ) * ( getResolution select 5 ) / 2 }; fnc_nameTags = { #define LIMITDISTANCE 2000 #define NAMEDISTANCE 250 #define ICON_sizeScale 0.75 idNameTags = addMissionEventHandler ["Draw3D", { { _unit = (call compile _x); if (!(player distance2D _unit > LIMITDISTANCE) && alive _unit /*&& player != _unit*/ && !isNull _unit && (vehicle _unit == _unit || (vehicle _unit != _unit && effectiveCommander vehicle _unit == _unit))) then { _distanceUI = round (_unit distance vehicle player); _icon = "pictures\WEST.paa"; _textSpaced = 0.0062; _targetPosition = _unit modelToWorldVisual[0,0,2]; _playerPosition = positionCameraToWorld[0,0,0]; _distance = _targetPosition distance _playerPosition; _fov = call KK_fnc_trueZoom; _dir = _targetPosition vectorDiff _playerPosition; _playerDir = _playerPosition vectorFromTo positionCameraToWorld[0,0,1]; //_cross = (_playerDir) vectorCrossProduct (vectorUp player); _cross = (_playerDir) vectorCrossProduct [0,0,1]; _drawUpNormal = vectorNormalized (_cross vectorCrossProduct _dir); // CHECK INJURED private ["_icon"]; if (lifeState _unit == "INCAPACITATED") then {_icon = MISSION_ROOT + "pictures\INJURED.paa"} else {_icon = MISSION_ROOT + "pictures\WEST.paa"}; // ICON _uiScale = (0.55 / (getResolution select 5)) * ICON_sizeScale; _iconSize = (1 - ((_distance / LIMITDISTANCE) * 0.7)) * _uiScale * 1; _drawUpIcon = _drawUpNormal vectorMultiply ((_textSpaced*2.8) * _distance / _fov); _drawPosIcon = _targetPosition vectorAdd _drawUpIcon; drawIcon3D [_icon, [1,1,1,1], _drawPosIcon, _iconSize, _iconSize, 0]; // NAME private ["_drawPosDist"]; if (_distance <= NAMEDISTANCE || {cursorTarget == _unit}) then { _drawUpName = _drawUpNormal vectorMultiply ((_textSpaced*2) * _distance / _fov); _drawPosName = _targetPosition vectorAdd _drawUpName; if (damage _unit > 0 && player getUnitTrait "Medic" && !(lifeState _unit == "INCAPACITATED")) then { drawIcon3D ["", [1,1,1,1], _drawPosName, 0, 0, 0, (name _unit) + " (" + (str (floor((1 - damage _unit) * 100))) + "%)", 2]; } else { drawIcon3D ["", [1,1,1,1], _drawPosName, 0, 0, 0, name _unit, 2]; }; _drawUpDist = _drawUpNormal vectorMultiply (_textSpaced * _distance / _fov); _drawPosDist = _targetPosition vectorAdd _drawUpDist; } else { _drawUpDist = _drawUpNormal vectorMultiply ((_textSpaced*2) * _distance / _fov); _drawPosDist = _targetPosition vectorAdd _drawUpDist; }; // DISTANCE drawIcon3D ["", [0.8,1,1,1], _drawPosDist, 0, 0, 0, format ["%1 m", _distanceUI], 2]; // VEHICLE if (vehicle _unit != _unit && effectiveCommander vehicle _unit == _unit) then { _drawUpVeh = _drawUpNormal vectorMultiply ((_textSpaced*4.6) * _distance / _fov); _drawPosVeh = _targetPosition vectorAdd _drawUpVeh; _veh = getText (configFile >> "CfgVehicles" >> (typeOf vehicle _unit) >> "DisplayName"); drawIcon3D ["", [0.443,0.776,0.443,1], _drawPosVeh, 0, 0, 0, _veh, 2]; }; }; } forEach arrPlayers; }]; }; fnc_toogleNameTags = { if (!isNil "idNameTags") then { systemChat "Name tags desactivated"; removeMissionEventHandler ["Draw3D", idNameTags]; idNameTags = nil; } else { systemChat "Name tags activated"; [] call fnc_nameTags; }; }; waituntil {!isnull (finddisplay 46)}; (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 219) then {[] call fnc_toogleNameTags}"]; Thanks to Whalenator for his multi-line with drawIcon3D ! Rather than using allPlayers command to get all connected players in order to draw the name tags, I used an array if string with the UID of each players broadcasted by the server. Normally the problem come from the initPlayerLocal.sqf where a JIP player ask all other clients thier UID and player object. Here is a sample mission for testing : nameTags.VR.pbo To activate/desactivate the name tags use the WIN LEFT key.
-
Hi ! I'm creating a deathmatch mission with armed hatchback sport. I can add to the driver turret [-1] some weapons with addWeaponTurret command but I want to go further. I'm trying to add a turret by creating an addon. I have no experience in creating addon so I'm asking for help. I've successfully created the addon but the turret seems to doesn't take the specification that I give to it in the config.cpp file. I just have a new gunner compartiment but can't fire nor aim. Here's the config.cpp : (The main part is at the end of the config.cpp but for inherithance I put all the stuff). class CfgPatches { class A3_Soft_F_Gamma_Hatchback_01 { addonRootClass="A3_Soft_F_Gamma"; requiredAddons[]= { "A3_Soft_F_Gamma" }; requiredVersion=0.1; units[]= { "C_Hatchback_01_sport_blue_F", "C_Hatchback_01_sport_F_rampage", "C_Hatchback_01_sport_green_F", "C_Hatchback_01_sport_grey_F", "C_Hatchback_01_sport_orange_F", "C_Hatchback_01_sport_red_F", "C_Hatchback_01_sport_white_F" }; weapons[]={}; }; }; class DefaultEventHandlers; class WeaponFireGun; class WeaponCloudsGun; class WeaponFireMGun; class WeaponCloudsMGun; class CfgVehicles { class LandVehicle; class Car: LandVehicle { class HitPoints; class Components; class NewTurret; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! }; class Car_F: Car { class HitPoints { class HitLFWheel; class HitLF2Wheel; class HitRFWheel; class HitRF2Wheel; class HitBody; class HitFuel; class HitEngine; class HitGlass1; class HitGlass2; class HitGlass3; class HitGlass4; }; class Components: Components { class AICarSteeringComponent; }; class EventHandlers; }; class Hatchback_01_base_F: Car_F { author="$STR_A3_Bohemia_Interactive"; mapSize=5.3299999; _generalMacro="Hatchback_01_base_F"; model="\A3\soft_f_gamma\Hatchback_01\Hatchback_01_F"; picture="\A3\soft_f_gamma\Hatchback_01\Data\UI\car_CA.paa"; editorSubcategory="EdSubcat_Cars"; Icon="\A3\soft_f_gamma\Hatchback_01\Data\UI\map_car_CA.paa"; memoryPointTaskMarker="TaskMarker_1_pos"; slingLoadCargoMemoryPoints[]= { "SlingLoadCargo1", "SlingLoadCargo2", "SlingLoadCargo3", "SlingLoadCargo4" }; unitInfoType="RscUnitInfoNoWeapon"; displayName="$STR_A3_CfgVehicles_Car_Base0"; class Library { libTextDesc="$STR_A3_CfgVehicles_Car_Base_Library0"; }; htMin=600; htMax=1800; afMax=100; mfMax=20; mFact=0; tBody=0; hiddenSelections[]= { "camo1" }; acceleration=15; maxFordingDepth=-0.34999999; class PlayerSteeringCoefficients { turnIncreaseConst=1; turnIncreaseLinear=3; turnIncreaseTime=0; turnDecreaseConst=2; turnDecreaseLinear=8; turnDecreaseTime=0; maxTurnHundred=1; }; class Components: Components { class AICarSteeringComponent: AICarSteeringComponent { steeringPIDWeights[]={8.5,0.003,0.40000001}; maxWheelAngleDiff=0.1; forwardAngleCoef=4; }; }; fireResistance=5; armor=30; armorLights=0.0099999998; cost=50000; transportMaxBackpacks=0; transportSoldier=3; class TransportItems { class _xx_FirstAidKit { name="FirstAidKit"; count=4; }; }; class AnimationSources; class HitPoints: HitPoints { class HitLFWheel: HitLFWheel { radius=0.25; visual="wheel_1_1_damage"; armorComponent="wheel_1_1_hide"; armor=-80; minimalHit=0; explosionShielding=4; passThrough=0; }; class HitLF2Wheel: HitLF2Wheel { radius=0.25; visual="wheel_1_2_damage"; armorComponent="wheel_1_2_hide"; armor=-80; minimalHit=0; explosionShielding=4; passThrough=0; }; class HitRFWheel: HitRFWheel { radius=0.25; visual="wheel_2_1_damage"; armorComponent="wheel_2_1_hide"; armor=-80; minimalHit=0; explosionShielding=4; passThrough=0; }; class HitRF2Wheel: HitRF2Wheel { radius=0.25; visual="wheel_2_2_damage"; armorComponent="wheel_2_2_hide"; armor=-80; minimalHit=0; explosionShielding=4; passThrough=0; }; class HitFuel: HitFuel { name="fuel"; }; class HitEngine: HitEngine { name="engine"; }; class HitBody: HitBody { visual="camo1"; passThrough=0.60000002; }; class HitGlass1: HitGlass1 { armor=0.25; }; class HitGlass2: HitGlass2 { armor=0.25; }; class HitGlass3: HitGlass3 { armor=0.25; }; class HitGlass4: HitGlass4 { armor=0.25; }; }; wheelDamageThreshold=0.025; wheelDamageRadiusCoef=0.89999998; wheelDestroyRadiusCoef=0.60000002; driverAction="driver_offroad01"; cargoAction[]= { "passenger_low01", "passenger_generic01_leanleft", "passenger_generic01_foldhands" }; getInAction="GetInLow"; getOutAction="GetOutLow"; cargoGetInAction[]= { "GetInLow" }; cargoGetOutAction[]= { "GetOutLow" }; extCameraPosition[]={0,2,-7.8000002}; camShakeCoef=0.80000001; class RenderTargets { class LeftMirror { renderTarget="rendertarget0"; class CameraView1 { pointPosition="PIP0_pos"; pointDirection="PIP0_dir"; renderQuality=2; renderVisionMode=0; fov=0.69999999; }; }; class RearCam { renderTarget="rendertarget1"; class CameraView1 { pointPosition="PIP1_pos"; pointDirection="PIP1_dir"; renderQuality=2; renderVisionMode=0; fov=0.69999999; }; }; class FrontCam { renderTarget="rendertarget2"; class CameraView1 { pointPosition="PIP2_pos"; pointDirection="PIP2_dir"; renderQuality=2; renderVisionMode=0; fov=0.69999999; }; }; }; simulation="CarX"; fuelCapacity=16; brakeIdleSpeed=1.94444; thrustDelay=0.5; turnCoef=2.5999999; terrainCoef=4.5; wheelCircumference=2.233; maxSpeed=190; normalSpeedForwardCoef=0.47368401; slowSpeedForwardCoef=0.26315799; accelAidForceCoef=2; accelAidForceYOffset=-1; accelAidForceSpd=2.2; enginePower=103; maxOmega=733.03802; minOmega=83.775803; idleRpm=800; redRpm=7000; peakTorque=174; torqueCurve[]= { {0.114286,0.80459797}, {0.142857,0.827586}, {0.31428599,0.94827598}, {0.442857,0.971264}, {0.61428601,1}, {0.771429,0.982759}, {0.85714298,0.96551698}, {1,0.86206901} }; engineMOI=0.60000002; dampingRateFullThrottle=0.1; dampingRateZeroThrottleClutchEngaged=0.16; dampingRateZeroThrottleClutchDisengaged=0.079999998; clutchStrength=9; latency=1; switchTime=0.5; differentialType="front_open"; changeGearType="rpmratio"; changeGearOmegaRatios[]={1,0.142857,0.117143,0.142857,0.71428603,0.121429,0.71428603,0.35714301,0.67142898,0.35714301,0.64285702,0.371429,0.64285702,0.40000001,1,0.42857099}; class complexGearbox { GearboxRatios[]= { "R1", -3.2, "N", 0, "D1", 3.5999999, "D2", 2.2, "D3", 1.35, "D4", 1.05, "D5", 0.85000002, "D6", 0.75 }; TransmissionRatios[]= { "High", 6 }; gearBoxMode="full-auto"; moveOffGear=1; driveString="D"; neutralString="N"; reverseString="R"; }; dampersBumpCoef=3; antiRollbarForceCoef=3; antiRollbarForceLimit=2; antiRollbarSpeedMin=0; antiRollbarSpeedMax=100; class Wheels { class LF { side="left"; suspTravelDirection[]={-0.125,-1,0}; boneName="wheel_1_1_damper"; center="wheel_1_1_axis"; boundary="wheel_1_1_bound"; suspForceAppPointOffset="wheel_1_1_axis"; tireForceAppPointOffset="wheel_1_1_axis"; steering=1; width=0.2; mass=20; MOI=1.13677; dampingRate=0.2; dampingRateDamaged=1; dampingRateDestroyed=1000; maxDroop=0.091499999; maxCompression=0.091499999; sprungMass=340; springStrength=31500; springDamperRate=5500; maxBrakeTorque=2700; maxHandBrakeTorque=0; latStiffX=2; latStiffY=28.6479; longitudinalStiffnessPerUnitGravity=5000; frictionVsSlipGraph[]= { {0,0.85000002}, {0.1,1.4}, {0.60000002,0.89999998} }; }; class LR: LF { boneName="wheel_1_2_damper"; center="wheel_1_2_axis"; boundary="wheel_1_2_bound"; suspForceAppPointOffset="wheel_1_2_axis"; tireForceAppPointOffset="wheel_1_2_axis"; steering=0; sprungMass=245; maxBrakeTorque=2000; maxHandBrakeTorque=2000; latStiffY=25.7831; frictionVsSlipGraph[]= { {0,0.75}, {0.12,1.2}, {0.60000002,0.89999998} }; }; class RF: LF { side="right"; suspTravelDirection[]={0.125,-1,0}; boneName="wheel_2_1_damper"; center="wheel_2_1_axis"; boundary="wheel_2_1_bound"; suspForceAppPointOffset="wheel_2_1_axis"; tireForceAppPointOffset="wheel_2_1_axis"; sprungMass=340; }; class RR: RF { boneName="wheel_2_2_damper"; center="wheel_2_2_axis"; boundary="wheel_2_2_bound"; suspForceAppPointOffset="wheel_2_2_axis"; tireForceAppPointOffset="wheel_2_2_axis"; steering=0; sprungMass=245; maxBrakeTorque=3000; maxHandBrakeTorque=2000; latStiffY=25.7831; frictionVsSlipGraph[]= { {0,0.75}, {0.12,1.2}, {0.60000002,0.89999998} }; }; }; class TextureSources { class Beige { displayName="$STR_A3_TEXTURESOURCES_BEIGE0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\Soft_F_Gamma\Hatchback_01\data\Hatchback_01_ext_BASE01_CO.paa" }; factions[]= { "CIV_F" }; }; class Green { displayName="$STR_A3_TEXTURESOURCES_GREEN0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\Soft_F_Gamma\Hatchback_01\data\Hatchback_01_ext_BASE02_CO.paa" }; factions[]= { "CIV_F" }; }; class Blue { displayName="$STR_A3_TEXTURESOURCES_BLUE0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\Soft_F_Gamma\Hatchback_01\data\Hatchback_01_ext_BASE03_CO.paa" }; factions[]= { "CIV_F" }; }; class Bluecustom { displayName="$STR_A3_TEXTURESOURCES_BLUECUSTOM0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\Soft_F_Gamma\Hatchback_01\data\Hatchback_01_ext_BASE04_CO.paa" }; factions[]= { "CIV_F" }; }; class Beigecustom { displayName="$STR_A3_TEXTURESOURCES_BEIGECUSTOM0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\Soft_F_Gamma\Hatchback_01\data\Hatchback_01_ext_BASE05_CO.paa" }; factions[]= { "CIV_F" }; }; class Yellow { displayName="$STR_A3_TEXTURESOURCES_YELLOW0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\Soft_F_Gamma\Hatchback_01\data\Hatchback_01_ext_BASE06_CO.paa" }; factions[]= { "CIV_F" }; }; class Grey { displayName="$STR_A3_TEXTURESOURCES_GREY0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\Soft_F_Gamma\Hatchback_01\data\Hatchback_01_ext_BASE07_CO.paa" }; factions[]= { "CIV_F" }; }; class Black { displayName="$STR_A3_TEXTURESOURCES_BLACK0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\Soft_F_Gamma\Hatchback_01\data\Hatchback_01_ext_BASE08_CO.paa" }; factions[]= { "CIV_F" }; }; class Dark { displayName="$STR_A3_TEXTURESOURCES_DARK0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\Soft_F_Gamma\Hatchback_01\data\Hatchback_01_ext_BASE09_CO.paa" }; factions[]= { "CIV_F" }; }; }; animationList[]={}; textureList[]= { "Beige", 1, "Green", 1, "Blue", 1, "Bluecustom", 1, "Beigecustom", 1, "Yellow", 1, "Grey", 1, "Black", 1, "Dark", 1 }; class MFD { class Dashboard { topLeft="MFD_1_TL"; topRight="MFD_1_TR"; bottomLeft="MFD_1_BL"; borderLeft=0; borderRight=0; borderTop=0; borderBottom=0; color[]={0.15000001,0.15000001,1,1}; enableParallax=0; class Bones { }; class Draw { color[]={0.050000001,1,0.050000001}; alpha=1; condition="on"; class SpeedStatic { type="text"; source="static"; text="KM/H"; scale=1; sourceScale=1; align="right"; pos[]= { {0.74000001,0.58999997}, 1 }; right[]= { {0.80000001,0.58999997}, 1 }; down[]= { {0.74000001,0.64999998}, 1 }; }; class Speed { type="text"; source="speed"; sourceScale=3.5999999; sourceLength=1; align="left"; scale=2; pos[]= { {0.70999998,0.46000001}, 1 }; right[]= { {0.94999999,0.46000001}, 1 }; down[]= { {0.70999998,0.69999999}, 1 }; }; }; }; }; class Damage { tex[]={}; mat[]= { "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_paint.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_paint_damage.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_paint_destruct.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_paint_mlod.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_paint_damage.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_paint_destruct.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_intbase.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_intbase_damage.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_intbase_destruct.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_intbase_mlod.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_intbase_damage.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_intbase_destruct.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_intbase_lod1.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_intbase_damage.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_intbase_destruct.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_INTboard.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_INTboard_damage.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_INTboard_destruct.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_INTboard_LOD1.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_INTboard_damage.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_INTboard_destruct.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_INTboard_mlod.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_INTboard_damage.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_INTboard_destruct.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_wheel_rim.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_paint_damage.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_paint_destruct.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_wheel_rubber.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_paint_damage.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_paint_destruct.rvmat", "A3\data_f\glass_veh_int.rvmat", "A3\data_f\Glass_veh_damage.rvmat", "A3\data_f\Glass_veh_damage.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_glass_window_mlod.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_glass_window_damage.rvmat", "A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_glass_window_damage.rvmat", "A3\data_f\glass_veh.rvmat", "A3\data_f\Glass_veh_damage.rvmat", "A3\data_f\Glass_veh_damage.rvmat" }; }; class Exhausts { class Exhaust1 { position="exhaust"; direction="exhaust_dir"; effect="ExhaustsEffect"; }; class Exhaust2 { position="exhaust2_pos"; direction="exhaust2_dir"; effect="ExhaustsEffect"; }; }; class Reflectors { class LightCarHeadL01 { color[]={1.9,1.8,1.7}; ambient[]={5,5,5}; position="LightCarHeadL01"; direction="LightCarHeadL01_end"; hitpoint="Light_L"; selection="Light_L"; size=1; innerAngle=30; outerAngle=179; coneFadeCoef=10; intensity=100; useFlare=1; dayLight=0; flareSize=1; class Attenuation { start=1; constant=0; linear=0; quadratic=0.050000001; hardLimitStart=50; hardLimitEnd=80; }; }; class LightCarHeadL02: LightCarHeadL01 { position="LightCarHeadL02"; direction="LightCarHeadL02_end"; FlareSize=0.5; }; class LightCarHeadR01: LightCarHeadL01 { position="LightCarHeadR01"; direction="LightCarHeadR01_end"; hitpoint="Light_R"; selection="Light_R"; }; class LightCarHeadR02: LightCarHeadR01 { position="LightCarHeadR02"; direction="LightCarHeadR02_end"; FlareSize=0.5; }; }; aggregateReflectors[]= { { "LightCarHeadL01", "LightCarHeadL02" }, { "LightCarHeadR01", "LightCarHeadR02" } }; }; class Hatchback_01_sport_base_F: Hatchback_01_base_F { author="$STR_A3_Bohemia_Interactive"; _generalMacro="Hatchback_01_sport_base_F"; scope=0; forceInGarage=1; fuelCapacity=16; brakeIdleSpeed=2.5; maxSpeed=300; normalSpeedForwardCoef=0.5; slowSpeedForwardCoef=0.166667; enginePower=285; maxOmega=733.03802; minOmega=104.72; idleRpm=1000; redRpm=7000; peakTorque=450; torqueCurve[]= { {0.142857,0.533333}, {0.285714,0.68888903}, {0.42857099,0.84444398}, {0.57142901,0.92444402}, {0.71428603,1}, {0.78571397,1}, {0.85714298,0.93333298}, {1,0.73333299} }; engineMOI=0.80000001; dampingRateFullThrottle=0.15000001; dampingRateZeroThrottleClutchEngaged=0.2; dampingRateZeroThrottleClutchDisengaged=0.1; clutchStrength=15; latency=0.40000001; switchTime=0.050000001; differentialType="all_limited"; frontRearSplit=0.44999999; frontBias=1.3; rearBias=1.3; centreBias=1.3; changeGearType="rpmratio"; changeGearOmegaRatios[]={1,0.142857,0.228571,0.142857,0.92857099,0.214286,0.92857099,0.64285702,0.92857099,0.64285702,0.92857099,0.64285702,0.92857099,0.64285702,1,0.64285702}; class complexGearbox { GearboxRatios[]= { "R1", -3.8, "N", 0, "D1", 3.5999999, "D2", 2.1500001, "D3", 1.55, "D4", 1.15, "D5", 0.89999998, "D6", 0.67000002 }; TransmissionRatios[]= { "High", 4.6999998 }; gearBoxMode="auto"; moveOffGear=1; driveString="D"; neutralString="N"; reverseString="R"; }; antiRollbarForceCoef=8; antiRollbarForceLimit=6; antiRollbarSpeedMax=160; class Wheels: Wheels { class LF: LF { width=0.25; MOI=1.13677; dampingRate=0.15000001; springStrength=42000; springDamperRate=5600; maxBrakeTorque=3600; latStiffY=31.512699; longitudinalStiffnessPerUnitGravity=6000; frictionVsSlipGraph[]= { {0,1}, {0.059999999,1.8}, {0.69999999,1} }; }; class LR: LR { maxBrakeTorque=3000; maxHandBrakeTorque=3000; latStiffY=28.6479; frictionVsSlipGraph[]= { {0,0.80000001}, {0.1,1.4}, {0.60000002,1} }; }; class RF: RF { }; class RR: RR { maxBrakeTorque=3000; maxHandBrakeTorque=3000; latStiffY=28.6479; frictionVsSlipGraph[]= { {0,0.80000001}, {0.1,1.4}, {0.69999999,1} }; }; }; class PlayerSteeringCoefficients { turnIncreaseConst=2; turnIncreaseLinear=6; turnIncreaseTime=0; turnDecreaseConst=2; turnDecreaseLinear=8; turnDecreaseTime=0; maxTurnHundred=1; }; class Components: Components { class AICarSteeringComponent: AICarSteeringComponent { maxWheelAngleDiff=0.25; wheelAngleCoef=0; forwardAngleCoef=3; steeringAngleCoef=0.5; differenceAngleCoef=1.5; doRemapSpeed=0; allowDrifting=1; }; }; class TextureSources { class Red { displayName="$STR_A3_TEXTURESOURCES_RED0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_ext_SPORT01_CO.paa" }; factions[]= { "CIV_F" }; }; class Blue { displayName="$STR_A3_TEXTURESOURCES_BLUE0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_ext_SPORT02_CO.paa" }; factions[]= { "CIV_F" }; }; class Orange { displayName="$STR_A3_TEXTURESOURCES_ORANGE0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_ext_SPORT03_CO.paa" }; factions[]= { "CIV_F" }; }; class White { displayName="$STR_A3_TEXTURESOURCES_WHITE0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_ext_SPORT04_CO.paa" }; factions[]= { "CIV_F" }; }; class Beige { displayName="$STR_A3_TEXTURESOURCES_BEIGE0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_ext_SPORT05_CO.paa" }; factions[]= { "CIV_F" }; }; class Green { displayName="$STR_A3_TEXTURESOURCES_GREEN0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_ext_SPORT06_CO.paa" }; factions[]= { "CIV_F" }; }; class Grey { displayName="$STR_A3_TEXTURESOURCES_GREY0"; author="$STR_A3_Bohemia_Interactive"; textures[]= { "\A3\Soft_F_Gamma\Hatchback_01\data\Hatchback_01_ext_BASE07_CO.paa" }; factions[]= { "CIV_F" }; deprecated=1; }; }; animationList[]={}; textureList[]= { "Red", 1, "Blue", 1, "Orange", 1, "White", 1, "Beige", 1, "Green", 1 }; }; class C_Hatchback_01_sport_F_rampage: Hatchback_01_sport_base_F { features="Randomization: Yes, 6 skins, disabled by: this setVariable [""BIS_enableRandomization"",false]; <br />Specific skin may be set by: this setVariable [""color"",X]; (the number ranges from 0 to 5) <br />Camo selections: 1 - the whole body <br />Script door sources: None <br />Script animations: None <br />Executed scripts: \A3\soft_f_gamma\Hatchback_01\scripts\randomize_sports.sqf <br />Firing from vehicles: No <br />Slingload: No <br />Cargo proxy indexes: 1 to 3"; author="$STR_A3_Bohemia_Interactive"; class SimpleObject { eden=1; animate[]= { { "damagehide", 0 }, { "damagehidevez", 0 }, { "damagehidehlaven", 0 }, { "wheel_1_1_destruct", 0 }, { "wheel_1_2_destruct", 0 }, { "wheel_1_3_destruct", 0 }, { "wheel_1_4_destruct", 0 }, { "wheel_2_1_destruct", 0 }, { "wheel_2_2_destruct", 0 }, { "wheel_2_3_destruct", 0 }, { "wheel_2_4_destruct", 0 }, { "wheel_1_1_destruct_unhide", 0 }, { "wheel_1_2_destruct_unhide", 0 }, { "wheel_1_3_destruct_unhide", 0 }, { "wheel_1_4_destruct_unhide", 0 }, { "wheel_2_1_destruct_unhide", 0 }, { "wheel_2_2_destruct_unhide", 0 }, { "wheel_2_3_destruct_unhide", 0 }, { "wheel_2_4_destruct_unhide", 0 }, { "glass1_destruct", 0 }, { "glass2_destruct", 0 }, { "glass3_destruct", 0 }, { "glass4_destruct", 0 }, { "glass6_destruct", 0 }, { "wheel_1_1", 0 }, { "wheel_2_1", 0 }, { "wheel_1_2", 0 }, { "wheel_2_2", 0 }, { "pedal_thrust", 0 }, { "pedal_brake", 0 }, { "wheel_1_1_damage", 0 }, { "wheel_1_2_damage", 0 }, { "wheel_2_1_damage", 0 }, { "wheel_2_2_damage", 0 }, { "wheel_1_1_damper_damage_backanim", 0 }, { "wheel_1_2_damper_damage_backanim", 0 }, { "wheel_2_1_damper_damage_backanim", 0 }, { "wheel_2_2_damper_damage_backanim", 0 }, { "drivingwheel", 0 }, { "steering_1_1", 0 }, { "steering_2_1", 0 }, { "indicatorrpm", 0 }, { "fuel", 1 }, { "prop_01", 0 }, { "daylights", 0 }, { "reverse_light", 1 }, { "damagehidedoor1", 0 }, { "damagehidedoor2", 0 }, { "glass5_destruct", 0 }, { "wheel_1_1_damper", 0 }, { "wheel_2_1_damper", 0 }, { "wheel_1_2_damper", 0 }, { "wheel_2_2_damper", 0 } }; hide[]= { "clan", "zasleh", "light_l", "light_r", "zadni svetlo", "brzdove svetlo", "podsvit pristroju", "poskozeni" }; verticalOffset=1.382; verticalOffsetWorld=-0.068000004; init="''"; }; editorPreview="\A3\EditorPreviews_F\Data\CfgVehicles\C_Hatchback_01_sport_F.jpg"; _generalMacro="C_Hatchback_01_sport_F_rampage"; scope=2; crew="C_man_1"; side=3; faction="CIV_F"; displayName="Hatchback rampage"; hiddenSelectionsTextures[]= { "\A3\soft_f_gamma\Hatchback_01\data\Hatchback_01_ext_SPORT01_CO.paa" }; class EventHandlers: EventHandlers { init="if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle;};"; }; class Reflectors: Reflectors { class LightCarHeadL01: LightCarHeadL01 { color[]={1300,1300,2200}; ambient[]={5,5,7}; innerAngle=30; outerAngle=100; coneFadeCoef=10; intensity=2; class Attenuation { start=2; constant=0; linear=0.1; quadratic=0.0099999998; hardLimitStart=90; hardLimitEnd=150; }; }; class LightCarHeadL02: LightCarHeadL01 { position="LightCarHeadL02"; direction="LightCarHeadL02_end"; FlareSize=0.5; }; class LightCarHeadR01: LightCarHeadL01 { position="LightCarHeadR01"; direction="LightCarHeadR01_end"; hitpoint="Light_R"; selection="Light_R"; }; class LightCarHeadR02: LightCarHeadL01 { position="LightCarHeadR02"; direction="LightCarHeadR02_end"; FlareSize=0.5; }; }; //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! class Turrets { class MainTurret: NewTurret { proxyIndex = 1; // <-- original cargo index that we are converting to new turret for firing maxElev = 45; // <-- elevation and rotation limits for the new turret minElev = -10; maxTurn = 45; minTurn = -45; turretFollowFreeLook = 1; InGunnerMayFire = true; body="mainTurret"; gun="mainGun"; animationSourceBody="mainTurret"; animationSourceGun="mainGun"; gunnerForceOptics=0; gunnerOutOpticsShowCursor=0; weapons[]= { "HMG_M2_Mounted" }; magazines[]= { "100Rnd_127x99_mag_Tracer_Yellow" }; }; }; //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! }; // etc... others stuff for hatchback texture randomization with scope=1
-
A way to focus on a marker rather than the playable unit when briefing start.
Crazy_Man replied to Crazy_Man's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Works great thx! -
A way to focus on a marker rather than the playable unit when briefing start.
Crazy_Man posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have a pre init function that randomly choose a marker and i want to focus on it rather than on the inital position of the playable unit when briefing is shown. Any ideas? -
Ideas for a script to remove AI units when they've been stuck for a while
Crazy_Man replied to Crazy_Man's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok so I've done some tests with the EH "PathCalculated" but for now it doesn't seems to help. It can detect whether or not the vehicle can reach the desired position (water for a vehicle that is not amphibious for example). But even if the vehicle is on its back and can therefore no longer move, it will still find a path. With the player placed in the desired vehicle and a logic game named "logictest" (for the position to reach) : Water on the way without an amphibious land vehicle : return false No water on the way and same vehicle but on its back : return true KK_fnc_setPosAGLS = { params ["_obj", "_pos", "_offset"]; _offset = _pos select 2; if (isNil "_offset") then {_offset = 0}; _pos set [2, worldSize]; _obj setPosASL _pos; _pos set [2, vectorMagnitude (_pos vectorDiff getPosVisual _obj) + _offset]; _obj setPosASL _pos; }; mission_fnc_calculatedPath = { params ["_veh", "_destPos"]; _agent = createAgent [typeOf (crew _veh select 0), [0,0,10000], [], 100, "CAN_COLLIDE"]; //_vehAgent = createVehicle [(typeOf _veh), [0,0,10000], [], 100, "CAN_COLLIDE"]; _vehAgent = createVehicle [(typeOf _veh), position _veh, [], 0, "NONE"]; _agent moveInDriver _vehAgent; //_vehAgent hideObjectGlobal true; //sleep 0.5; //[_vehAgent, position _veh] call KK_fnc_setPosAGLS; _vehAgent setVectorDirAndUp [vectorDir _veh, vectorUp _veh]; sleep 0.5; _agent addEventHandler ["PathCalculated", { params ["_agent","_path"]; if (isNil {_agent getVariable "passed"}) then { _agent setVariable ["passed", true]; { _marker = createMarker ["marker" + str _forEachIndex, _x]; _marker setMarkerType "mil_dot"; _marker setMarkerText str _forEachIndex; } forEach _path; } } ]; _agent setDestination [_destPos, "LEADER PLANNED", false]; _timeOut = time + 5; waitUntil {_agent getVariable ["passed", false] or _timeOut <= time}; systemChat str (_agent getVariable ["passed", false]); //deleteVehicle _agent; //deleteVehicle _vehAgent; }; [vehicle player, position logictest] spawn mission_fnc_calculatedPath; -
Ideas for a script to remove AI units when they've been stuck for a while
Crazy_Man posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi all, I'm interested in a script that would detect AI units that get stuck for a while and are not in combat. If you have good ideas on the subject, don't hesitate to post them. I am creating a mission where, once a city is taken, reinforcements are spawned at random and secure positions and must reach the city. So I don't want to be bothered by vehicles stuck on the way slowing the reinforcements, I prefer to delete them if they are not in combat. for the moment, I've this: if (!isServer) exitWith {}; timeIdle = 60*10; // 10 minutes //timeIdle = 30; // TEST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! mission_fnc_idle = { params ["_gr"]; //{_x disableAI "PATH"} forEach units _gr; // TEST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! _distToDelete = 5; // Get all group's vehicle(s) _vehs = [_gr, true] call BIS_fnc_groupVehicles; // initialize vars {if (alive _x) then {_x setVariable ["idlePos", position _x]}} forEach units _gr; _timeOut = time + timeIdle; // MAIN LOOP while {{alive _x} count units _gr > 0} do { sleep 5; if (isNil "_gr" or {{alive _x} count units _gr < 1}) exitWith {}; // CHECK IDLE UNITS if ({alive _x} count units _gr > 0 and _timeOut < time) then { _units = []; _unitsToDelete = []; _vehsToDelete = []; // get all units near their idle position {if (alive _x and _x distance (_x getVariable "idlePos") < _distToDelete) then {_units pushBackUnique _x}} forEach units _gr; { // if unit in vehicle if (vehicle _x != _x) then { _veh = vehicle _x; if (!((crew _veh) call mission_fnc_isEngaging)) then { {_unitsToDelete pushBackUnique _x} forEach crew _veh; _vehsToDelete = _vehsToDelete + [_veh]; }; }; // if unit not in vehicle if (vehicle _x == _x and !(_x call mission_fnc_isEngaging)) then { _unitsToDelete pushBackUnique _x; }; } forEach _units; // delete idle units and vehicles {deleteVehicle _x} forEach _unitsToDelete + _vehsToDelete; // reset vars {if (alive _x) then {_x setVariable ["idlePos", position _x]}} forEach units _gr; _timeOut = time + timeIdle; }; }; }; // Thanks to rübe mission_fnc_isEngaging = { /* Author: rübe Description: returns true if anybody of the given unit(s)/group is engaging Parameter(s): _this: unit(s)/group (unit, array of units or group) Returns: boolean */ private ["_units", "_engaging"]; _units = []; _engaging = false; switch (true) do { case ((typeName _this) == "ARRAY"): { _units = _this; }; case ((typeName _this) == "GROUP"): { _units = units _this; }; default { _units = [_this]; }; }; { if ((currentCommand _x) in ["ATTACK", "ATTACKFIRE", "FIRE"]) exitWith { _engaging = true; }; } forEach _units; // return status _engaging }; -
disableAI "AUTOTARGET" by keyboard press.
Crazy_Man replied to dbun30's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi dbun30. for the entire group : { _x disableAI "AUTOTARGET"; _x groupChat "Autotarget disabled"; } forEach units group player - [player]; for the selected units : if (count groupSelectedUnits player > 0) then { { _x disableAI "AUTOTARGET"; _x groupChat "Autotarget disabled"; } forEach groupSelectedUnits player; }; Works only for single player. I suggest you to use only one keyboard button since you can select the entire group and disable their autotarget. In that case use only the second code. -
HoldAction Disabled for Specific Player
Crazy_Man replied to fin_soldier's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok 😉 If you want you can show me the error. -
Do you want all three groups to hear the same music (music depending on which group triggers it) or each group to hear their own music when triggered?