Jump to content

Blitzen88

Member
  • Content Count

    244
  • Joined

  • Last visited

  • Medals

Everything posted by Blitzen88

  1. All of that got it work perfectly! Is there anyway you could show me how to take the framework of that script and apply it to equiping/removing a unit's nightvision goggles? I have tried and tried but I dont know what I am doing wrong. This is what I got: //Define Variables _NVGWest = _this select 0; _NVGEast = _this select 1; _NVGIndep = _this select 2; // Now save this array of units for later use _CheckedUnits = []; // We now have all Units that started on the map with configured with our new settings. // We can now set up a loop to monitor for anything new being created (3 minute second loop) While {True} do { _NewUnits = allUnits - _CheckedUnits; // Remove checked Units from the updated Unit array to create a list of new Units if (count _NewUnits > 0) then { // Now only do the following if there are new units found. If (_NVGWest) then { {If ((side _x) == West) then {_x AddItem "NVGoggles"; _x AssignItem "NVGoggles";}}forEach allunits; } Else {_x UnAssignItem "NVGoggles"; _x RemoveItem "NVGoggles";}forEach allunits; If (_NVGEast) then { {If ((side _x) == East) then {_x AddItem "NVGoggles_Opfor"; _x AssignItem "NVGoggles_Opfor";}}forEach allunits; } Else {_x UnAssignItem "NVGoggles_Opfor"; _x RemoveItem "NVGoggles_Opfor";}forEach allunits; If (_NVGIndep) then { {If ((side _x) == Independent) then {_x AddItem "NVGoggles_Indep"; _x AssignItem "NVGoggles_Indep";}}forEach allunits; } Else {_x UnAssignItem "NVGoggles_Indep"; _x RemoveItem "NVGoggles_Indep";}forEach allunits }; composeText [parsetext format["<t size='1.5' align='left' color='#ffffff'>There are <t color='#00ff00'>%1 <t color='#ffffff'>new units found and <t color='#ff0000'>%2 <t color='#ffffff'>Checked Units",count _NewUnits,count _CheckedUnits]] remoteExec ["hint"];// Debug _CheckedUnits append _NewUnits; sleep 15; };
  2. Still trying to figure out what I am doing wrong
  3. I have modified my description.ext file to add an init eventhandler to the CAManBase: class Extended_Init_Eventhandlers { class CAManBase { init = "_this execVM 'Scripts\AISkillSettings.sqf';"; }; }; That code snippet executes my AI skill script whenever the unit is spawned. The relevant part of the script is: { _x AllowFleeing 0; _x AllowCrewInImmobile True; _x setSkill ["aimingAccuracy", 0.5 + (random 0.25)]; _x setSkill ["aimingShake", 0.25 + (random 0.25)]; _x setSkill ["aimingSpeed", 0.75 + (random 0.25)]; _x setSkill ["commanding", 1 + (random 0.15)]; _x setSkill ["courage", 1 + (random 0.15)]; _x setSkill ["general", 0.75 + (random 0.25)]; _x setSkill ["reloadSpeed", 0.8 + (random 0.05)]; _x setSkill ["spotDistance", 1 + (random 0.20)]; _x setSkill ["spotTime", 0.75+ (random 0.25)]; } forEach allUnits; Is there anyway to change this script from applying to all units to just applying to the individual unit that has spawned? I have tried "this" and "_this" instead of "foreach allunits" but it I always get errors when I mess around with it. Thanks
  4. That seems to work. Thank you!
  5. I’ve tried “_this” and it didnt work...?
  6. Can someone explain to me how to “modify” the vanilla ak-12 and ak-12u to accept modded suppressors such as the ones included in the EricJ and RH mods? All of the scopes and rail attachments (lasers, etc) work on the Ak-12. None of those work on the Ak-12u. Can anyone tell me how to get it to work?
  7. You guys are amazing lol. I assumed there would be an update to CBA at some point.
  8. Im making a mission where Nato and Csat start at their base and then proceed to capture a handful of sectors. New spawn points are unlocked depending upon who controls a sector. However, as more and more sectors are captured, more and more spawn points are available for the AI to spawn at. This leads to AI spawning at positions that are not always near the frontline. Is there anyway to force AI to spawn at spawn points that are closest to the nearest enemy controlled sector?
  9. Vanilla Units. Only thing I can think of that might mess it up would be the Advanced AI Command mod. However, that mod doesnt cause any issues with weapon attachments when units are spawned via script. Edit I forgot to add that I blacklisted alot of group types. Im not 100% sure but I think units used to spawn with attachments before the blacklist was applied.
  10. How would I implement an approach like this: _unit = ??? _possibleScopes = [ "optic_Arco" ,"optic_Hamr" ,"optic_Holosight" ,"optic_Aco" ]; _randomScope = selectRandom [_possibleScopes]; _unit addPrimaryWeaponItem _RandomScope}; I know its probably full of errors but hopefully it gets my point/approach across...? Thank you so much for your help by the way. I appreciate it! Im also learning too!
  11. From my understanding, thats going to cause issues: 1) The spawned units will copy that loadout and there will be no diversity for scopes. I wanted to define a list of scopes and then have a random selection of the available scopes. That way there is a certain degree of uniqueness in a unit’s loadout. 2) For the Ak12’s, all units will copy the reference unit’s loadout. I do not want machinegunners to have Ak12’s; only riflemen and grenadiers
  12. Two things: 1) For whatever reason, units that are spawned by the AI Spawn Module are stripped of their weapon attachments (scopes and IR lasers). I want to have each unit exec a script that adds those attachments. 2) Sometimes I like to have CSAT use Ak12s. I want a script to remove their current weapon and add an Ak12. I have a general idea how to write/setup the script but I dont know how to call it/apply it.
  13. How would you call a script from the expression field? What would you put there to exec a script for each group member and how would you define the group member in the script?
  14. Thats a great; I just need to know how to call it, etc. Im a moron
  15. Greetings, I’m trying to create a script which will rearm CSAT units with Ak12s. However, I do not want the script to apply to machinegunners and marksmen. Can someone show me how to either: 1) Ignore/do not run the script for machinegunners/marksmen (would this be done be excluding certain unit classnames??) 2) Apply the script to units which are armed with a specific type/array of weapon Thank you!
  16. Im a scripting newbie but wouldn't this resupply the unit instead of changing weaponry? i think something like this is what Im looking for..? //Add LMG for Autorifleman, otherwise give rifle if (_unitType in _MGSoldiers) then { [_unit, (_possibleMGs call Bis_fnc_selectRandom), 6] call BIS_fnc_addWeapon; } else { if (_unitType in _GLSoldiers) then { {_unit addMagazine "1Rnd_HE_Grenade_shell"} forEach [1,2,3,4,5,6]; [_unit, (_possibleGLWeapons call Bis_fnc_selectRandom), 6] call BIS_fnc_addWeapon; } else { if (_unitType in _MarksmanSoldiers) then { [_unit, (_possibleMarksmanWeapons call Bis_fnc_selectRandom), 6] call BIS_fnc_addWeapon; _unit addPrimaryWeaponItem "optic_Hamr"; } else { [_unit, (_possiblePrimaryWeapons call Bis_fnc_selectRandom), 6] call BIS_fnc_addWeapon; }; }; }; [_unit, (_possibleHandguns call Bis_fnc_selectRandom), 4] call BIS_fnc_addWeapon; //Give AT weapon where appropriate if (_unitType in _ATSoldiers) then { [_unit, (_possibleLaunchers call Bis_fnc_selectRandom), 3] call BIS_fnc_addWeapon; }; //Give Medikit to Medics if (_unitType in _MedicSoldiers) then { _unit addItemToBackpack "Medikit"; {_unit addItemToBackpack "FirstAidKit";} forEach [1,2,3,4,5,6,7,8,9,10]; }; //Give Toolkit to Engineers, etc. if (_unitType in _RepairSoldiers) then { _unit addItemToBackpack "ToolKit"; _unit addItemToBackpack "MineDetector"; {_unit addItemToBackpack "FirstAidKit";} forEach [1,2]; };
  17. I didnt know about the unitloadout command. I was wondering if it would be possible to do something along the lines of: If unit class is machinegunner or marksman then exit; else removeweapon, etc
  18. Greetings, Whenever I play Arma I rely heavily on AI spawn scripts for my missions. Generally speaking I like to apply the same skill settings for all of the units in a mission but issues arise when AI units are spawned after the mission starts. My current solution is to use an eventhandler to run an AI skill script whenever a unit is spawned. However, I recently found a script which applies AI skill settings by looping/re-running every 30 seconds or so. Would one method be more efficient (performance wise) than the other?
  19. The 30 second delay doesnt bother me that much. Im still torn as to which method would be more effective. Ultimately it might not matter since I seem to get good performance with what Im using. This question also applies to another issue I have: If I want to re-equip all Csat units with AK 12s would it be better to do that via an event handler or a looping script?
  20. The EH script is a simple SetAIskill # for each all units type of script. The loop script would be This script. I would be using about four eight man squads per side plus three to four vehicles. The EH script would execute around 32 times at mission start and then only when the groups respawn.
  21. Good morning. Im trying to have a trigger repeatedly call a function when the trigger countdown reaches zero. I placed the trigger (with no conditions) with a countdown. The trigger counts down but the function (spawn a helicopter) never activates. I added a condition to the trigger (opfor capturing a sector) and the function activated. However, I want the trigger to activate repeatedly. Even when the condition is met, the function is only called one time. Is there anyway to have a trigger countdown repeatedly and call the function everytime the countdown reaches zero? Thank you
  22. This is what I have so far: Sleep 5; _Vehicle = _this select 0; _VehicleCrew = crew _Vehicle; _LZMrk = _this select 1; _RTB = _this select 2; _WayPoint1 = (group _Vehicle) addWaypoint [getMarkerPos _LZMrk, 0]; _WayPoint1 setWaypointType "TR UNLOAD"; _WayPoint1 setWaypointBehaviour "Aware"; _WayPoint1 setWaypointCombatMode "Yellow"; _WayPoint1 setWaypointSpeed "FULL"; _WayPoint1 setwaypointstatements ["this land 'land'"]; _WayPoint2 = (group _Vehicle) addWaypoint [getMarkerPos _RTB, 0]; _WayPoint2 setWaypointType "MOVE"; _WayPoint2 setWaypointBehaviour "Aware"; _WayPoint2 setWaypointCombatMode "Yellow"; _WayPoint2 setWaypointSpeed "FULL"; _Waypoint2 setWaypointStatements ["true", "{deletevehicle _x} foreach units (group _Vehicle)"]; Im having an issue with the last waypoint: the helicopter is not deleted... Can anyone point me in the right direction? Thanks
  23. Blitzen88

    Alive’s Caching System

    Wow, I had no idea that it did that. That’s pretty cool. Thanks for the explanation!
  24. I play almost all of my missions with the Advanced AI Command mod. As a player I will remotely controll friendly AI units but I also spend time away from the frontlines issuing orders. This style of play can conflict with a lot of caching systems. This conflict arises from the fact that a lot of caching systems will only un-cache a unit when the PLAYER is nearby; the system does not un-cache inits when an enemy AI unit is nearby. Ultimately this leads to a situation where enemy units never spawn in if I am a far distance from the frontlines issuing orders. Does Alive cache units based upon how close/far away a player is or based upon how close/far away an enemy unit is? Thanks!
×