Jump to content

Crazy_Man

Member
  • Content Count

    75
  • Joined

  • Last visited

  • Medals

Community Reputation

35 Excellent

1 Follower

About Crazy_Man

  • Rank
    Corporal

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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.
  2. Ok 😉 If you want you can show me the error.
  3. 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?
  4. 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 😉
  5. 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.
  6. 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
  7. 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.
  8. 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 😉
  9. 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.
  10. 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 🙂
  11. [ 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 😉
  12. 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
  13. 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
  14. In fact, it works BUT, if you press respawn button the onPlayerKilled.sqf will not fire and you will loose all your stuff and get the default stuff of the unit... I don't know how to fix that, but if you get killed on the battlefield it will works like a charm 😉 Maybe some one can help us?
  15. Wait I've tested and that didn't works, i will check now why.. sorry
×