Jump to content

Crazy_Man

Member
  • Content Count

    88
  • Joined

  • Last visited

  • Medals

Everything posted by Crazy_Man

  1. Crazy_Man

    [MP] co40 Domination!

    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.
  2. Crazy_Man

    [MP] co40 Domination!

    We use : - S.O.G. - CBA_A3 - Unsung Redux - Zeus Enhanced
  3. Crazy_Man

    [MP] co40 Domination!

    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.
  4. Crazy_Man

    Name Tags JIP issues

    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
  5. 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.
  6. Crazy_Man

    Name Tags JIP issues

    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";
  7. Crazy_Man

    Name Tags JIP issues

    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...
  8. 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
  9. 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?
  10. 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 };
  11. 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;
  12. 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.
  13. Ok 😉 If you want you can show me the error.
  14. Crazy_Man

    Music for each group

    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?
  15. Crazy_Man

    Spawn unit in each vehicle?

    Maybe, just loop 3 times the script where you create the vehicles and use alternative synthax of createVehicle command. Finally add some distance between spawned vehicles to avoid collisions. _Pos_1 = SP_Mission_Pos; _Pos_Spawn = [[[_Pos_1, 25 + random 250]],["water"]] call BIS_fnc_randomPos; _Light_Vehicle = selectRandom SP_Patrols_Vehicle_Array; // This line can be inside the "_i" loop to get random vehicles for the groups ** for "_i" from 1 to 3 do { // ** here _Spawned_Light_Vehicle = createVehicle [_Light_Vehicle, _Pos_Spawn, [], 0, "NONE"]; _Seats_Number = [_Light_Vehicle,true] call BIS_fnc_crewCount; _Seats_Number_Crew = [_Light_Vehicle,false] call BIS_fnc_crewCount; _Group = createGroup SP_Missions_Enemy_Side; _Group_Crew = createGroup SP_Missions_Enemy_Side; for "_x" from 1 to _Seats_Number_Crew do { _unit_Crew = _Group_Crew createunit [SP_Civilian_Array select floor(random count SP_Civilian_Array), _Pos_Spawn, [], 0, "None"]; [_unit_Crew] JoinSilent _Group_Crew; _unit_Crew moveInAny _Spawned_Light_Vehicle; (leader _Group_Crew) setSkill 1; _Spawned_Light_Vehicle forceFollowRoad true; _Spawned_Light_Vehicle setConvoySeparation 30; removeAllWeapons _unit_Crew; removeAllItems _unit_Crew; removeAllAssignedItems _unit_Crew; removeVest _unit_Crew; removeBackpack _unit_Crew; removeGoggles _unit_Crew; _Headgear = selectRandom SP_Civilian_Headgear_Array; _Goggles = selectRandom SP_Civilian_Goggles_Array; _Vests = selectRandom SP_Civilian_Vests_Array; _Backpacks = selectRandom SP_Civilian_Backpacks_Array; _unit_Crew addHeadgear _Headgear; //_unit_Crew addGoggles _Goggles; // add possibility if (floor (random 30) < 6) then {_unit_Crew addGoggles _Goggles;}; if (floor (random 30) < 5) then {_unit_Crew addVest _Vests;}; if (floor (random 30) < 15) then {_unit_Crew addBackpack _Backpacks;}; _Primary_Weapon = selectRandom SP_Civilian_primaryWeapon_array; _secondaryWeapon = selectRandom SP_Civilian_secondaryWeapon_array; _handgunWeapon = selectRandom SP_Civilian_HandGunWeapon_array; _Primary_Weapon_Magazines = getArray (configFile / "CfgWeapons" / _Primary_Weapon / "magazines"); _Spawn_Primary_Weapon_magazines = selectRandom _Primary_Weapon_Magazines; _unit_Crew addWeapon _Primary_Weapon; for "_i" from 1 to 3 do {_unit_Crew addItemToUniform _Spawn_Primary_Weapon_magazines;}; for "_i" from 1 to 1 do {_unit_Crew addItemToUniform "FirstAidKit";}; for "_i" from 1 to 1 do {_unit_Crew addItemToUniform "LIB_Shg24";}; for "_i" from 1 to 2 do {_unit_Crew addItemToVest _Spawn_Primary_Weapon_magazines;}; for "_i" from 1 to 2 do {_unit_Crew addItemToBackpack _Spawn_Primary_Weapon_magazines;}; _unit_Crew selectweapon primaryWeapon _unit_Crew; reload _unit_Crew; // add possibility if (floor (random 10) < 4) then {_unit_Crew linkItem "ItemMap";}; if (floor (random 10) < 4) then {_unit_Crew linkItem "LIB_GER_ItemCompass";}; if (floor (random 10) < 4) then {_unit_Crew linkItem "LIB_GER_ItemWatch";}; }; _Seats_Number_Cargo = _Seats_Number - _Seats_Number_Crew; for "_x" from 1 to _Seats_Number_Cargo do { _unit = _Group createunit [SP_Civilian_Array select floor(random count SP_Civilian_Array),_Pos_Spawn,[],0,"None"]; [_unit] JoinSilent _Group; _unit moveInAny _Spawned_Light_Vehicle; (leader _Group) setSkill 1; removeAllWeapons _Unit; removeAllItems _Unit; removeAllAssignedItems _Unit; removeVest _Unit; removeBackpack _Unit; removeGoggles _Unit; _Headgear = selectRandom SP_Civilian_Headgear_Array; _Goggles = selectRandom SP_Civilian_Goggles_Array; _Vests = selectRandom SP_Civilian_Vests_Array; _Backpacks = selectRandom SP_Civilian_Backpacks_Array; _Unit addHeadgear _Headgear; //_Unit addGoggles _Goggles; // add possibility if (floor (random 30) < 6) then {_Unit addGoggles _Goggles;}; if (floor (random 30) < 5) then {_Unit addVest _Vests;}; if (floor (random 30) < 15) then {_Unit addBackpack _Backpacks;}; _Primary_Weapon = selectRandom SP_Civilian_primaryWeapon_array; _secondaryWeapon = selectRandom SP_Civilian_secondaryWeapon_array; _handgunWeapon = selectRandom SP_Civilian_HandGunWeapon_array; _Primary_Weapon_Magazines = getArray (configFile / "CfgWeapons" / _Primary_Weapon / "magazines"); _Spawn_Primary_Weapon_magazines = selectRandom _Primary_Weapon_Magazines; _Unit addWeapon _Primary_Weapon; for "_i" from 1 to 3 do {_Unit addItemToUniform _Spawn_Primary_Weapon_magazines;}; for "_i" from 1 to 1 do {_Unit addItemToUniform "FirstAidKit";}; for "_i" from 1 to 1 do {_Unit addItemToUniform "LIB_Shg24";}; for "_i" from 1 to 2 do {_Unit addItemToVest _Spawn_Primary_Weapon_magazines;}; for "_i" from 1 to 2 do {_Unit addItemToBackpack _Spawn_Primary_Weapon_magazines;}; _Unit selectweapon primaryWeapon _Unit; reload _Unit; // add possibility if (floor (random 10) < 4) then {_Unit linkItem "ItemMap";}; if (floor (random 10) < 4) then {_Unit linkItem "LIB_GER_ItemCompass";}; if (floor (random 10) < 4) then {_Unit linkItem "LIB_GER_ItemWatch";}; }; [_Group_Crew, _Pos_1, 5000] call BIS_fnc_taskPatrol; [_Group, _Pos_1, 5000] call BIS_fnc_taskPatrol; _Pos_Spawn = [(_Pos_Spawn select 0) + 5, _Pos_Spawn select 1, 0]; // Make space between spawned vehicles to avoid BOOM! ^^ }; Hope this help 😉
  16. You can use the BIS_fnc_findSafePos function instead/(or with) the BIS_fnc_randomPos function. // [center, minDist, maxDist, objDist, waterMode, maxGrad, shoreMode, blacklistPos, defaultPos] call BIS_fnc_findSafePos; _randomPos = [getMarkerPos _missionArea, 0, 200, 5, 0, 0, 0, [], []] call BIS_fnc_findSafePos; // this will return a random position around the _missionArea marker with 200 radius and 5 meters from any objects. See the wiki page for the other arguments Keep in mind that if this function doesn't find any safe place it will use the defaultPos (last argument wich is empty array in my example). if you encounter a problem in this case, you can set a value to the defaultPos like [0,0,0] and create a while loop who increment de maxDist until the function find a safe place. An example : _randomPos = [0,0,0]; _maxDist = 200; while {_randomPos isEqualTo [0,0,0]} do { _randomPos = [getMarkerPos _missionArea, 0, _maxDist, 5, 0, 0, 0, [], [0,0,0]] call BIS_fnc_findSafePos; _maxDist = _maxDist + 20; }; Yes. So don't repeat the createGroup command for each unit. Finally, you can make some groups patrol and other groups don't patrol. An example : // Marker random choice _areas = allMapMarkers; _missionArea = selectRandom _areas; // Faction class names _faction = "BLU_F"; // for test //_faction = paramsArray select 0; // replace 0 by the right params _unitsFaction = format ["getNumber (_x >> 'scope') >= 2 AND configname _x isKindOf 'CAManBase' AND gettext (_x >> 'faction') == '%1'", _faction] configClasses (configFile >> "CfgVehicles") apply {configName _x}; // Config main loop _side = getNumber (configfile >> "CfgVehicles" >> (_unitsFaction select 0) >> "side") call BIS_fnc_sideType; // get the right side of the choosen faction _amountOfGroups = 4; _amountOfPatrols = 3; _minUnitsPerGroup = 8; // Main loop for "_i" from 0 to _amountOfGroups-1 do { // Search for safe random position _randomPos = [0,0,0]; _maxDist = 200; while {_randomPos isEqualTo [0,0,0]} do { _randomPos = [getMarkerPos _missionArea, 0, _maxDist, 5, 0, 0, 0, [], [0,0,0]] call BIS_fnc_findSafePos; _maxDist = _maxDist + 20; }; // Difficulty _nbePlayers = count (call BIS_fnc_listPlayers - entities "HeadlessClient_F"); // count the amount of players without headLessClient _amountOfUnits = _minUnitsPerGroup + _nbePlayers; // It s just an idea, do as you like // Spawn the group _group = createGroup [_side, true]; for "_j" from 0 to _amountOfUnits-1 do { _enemy = _group createUnit [selectRandom _unitsFaction, _randomPos, [], 0, "NONE"]; }; // Make it patrol or not if (_i < _amountOfPatrols) then { [_group, getPos leader _group, 100] call BIS_fnc_taskPatrol; }; }; Beware, if your choosen faction isn't in the his right side (faction "BLU_F" but group created with east side), the units will kill each other.
  17. If you want to use icon marker you can try : // _randomPos = [[[center, radius]], ["water"]] call BIS_fnc_randomPos; _randomPos = [[[getMarkerPos _missionArea, 200]], ["water"]] call BIS_fnc_randomPos; // circle with 200 radius // or for rectangle or ellipse // _randomPos = [[[center, [a, b, angle, rect]]], ["water"]] call BIS_fnc_randomPos; _randomPos = [[[getMarkerPos _missionArea, [100, 200, 0, false]]], ["water"]] call BIS_fnc_randomPos; // ellipse with 100x200 size with 0° angle _randomPos = [[[getMarkerPos _missionArea, [100, 200, 0, true]]], ["water"]] call BIS_fnc_randomPos; // rectangle with 100x200 size with 0° angle
  18. The error comes from the BIS_fnc_randomPos function. Your marker need to be an area and not an icon. It's for the search condition in the config to get all the units class names of a given faction.
  19. Try : _enemy1 = _group1 createUnit [selectRandom _opforUnits, _randomPos, [], 0, "NONE"]; _group1 is already a group so you don't need the group command before it. Also for the random position : _randomPos = [[_missionArea], ["water"]] call BIS_fnc_randomPos; Just an example of what I will use : _areas = allMapMarkers; _missionArea = selectRandom _areas; _randomPos = [[_missionArea], ["water"]] call BIS_fnc_randomPos; // random pos in the marker area but not in water _faction = "BLU_F"; // delete this after configuring your params under, just here for test //_faction = paramsArray select 0; // change 0 by the right number _unitsFaction = format ["getNumber (_x >> 'scope') >= 2 AND configname _x isKindOf 'CAManBase' AND gettext (_x >> 'faction') == '%1'", _faction] configClasses (configFile >> "CfgVehicles") apply {configName _x}; // Get all the units from the choosen faction _group1 = createGroup [east, true]; // better delete the group when empty so use this synthax _enemy1 = _group1 createUnit [selectRandom _unitsFaction, _randomPos, [], 0, "NONE"]; Hope this help 😉
  20. EDITED Try this : [ p3, "Release Player", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unbind_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unbind_ca.paa", "_this distance _target < 5 && !(captive _this)", "_caller distance _target < 5", {}, {}, { (_this select 0) playMove "Acts_AidlPsitMstpSsurWnonDnon_out"; (_this select 0) setCaptive false; [[(_this select 0), (_this select 2)], { params ["_target", "_actionId"]; [_target, _actionId] call BIS_fnc_holdActionRemove; }] remoteExec ["call", 0, true]; }, {}, [], 5, 0, false, false ] remoteExecCall ["BIS_fnc_holdActionAdd", 0, true]; Normaly it will work for hosted games.
  21. The effect of the action with addaction or BIS_fnc_holdActionAdd is local to the client who performs the action, only issue i know. Since you use playMove and setCaptive in the script, these two command are broadcasted over the network but the arguments they take need to be local to the machine that performs these commands. See Multiplayer Scripting I think (I'm not sure) that objects named in the Eden editor are broadcasted. If it doesn't works let me know 🙂
  22. [ p3, "Release Player", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unbind_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unbind_ca.paa", "p1 distance p3 < 5 && !(captive _this)", // HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "p1 distance p3 < 5", {}, {}, {p3 playMove "Acts_AidlPsitMstpSsurWnonDnon_out"; p3 setCaptive false;}, {}, [], 5, 0, true, false ] remoteExec ["BIS_fnc_holdActionAdd", 0 , p3]; Not in the trigger condition but in the "condition for the action to be shown", see the HERE !!!! in the code above. In the trigger condition just keep the p1 distance p3 < 5 😉
  23. Ok I've got the solution. You only need one file named onPlayerRespawn.sqf with : params ["_newUnit","_oldUnit"]; _loadOut = getUnitLoadout _oldUnit; _newUnit setUnitLoadout _loadOut; This will work even with the repsawn button, and with every settings of respawnOnStart parameter in the description.ext
  24. Same as "BASE" repsawn, just say to your freinds to do not use the respawn button in the menu 🙂 The menu when you press "esc" I mean
×