Jump to content

Blitzen88

Member
  • Content Count

    152
  • Joined

  • Last visited

  • Medals

Everything posted by Blitzen88

  1. Greetings, Can anyone enlighten me regarding the correct syntax for setting a SpawnAI Module’s variables via scriot? For instance, I know that setvariable “side” and “faction” can be used to set the module’s side and faction parameters. Can someone tell me what the command(s) would be for the remaining parameters: Manpower cap Spawn Rate Vehicles in Group Expression Faction Unit type %'s (Inf, Motorized, Mechanized) Blacklist Thank you!
  2. Greetings, I am trying to expand my scripting knowledge by taking a look at existing AI garrison scripts. After digging through a couple, I have a few questions I was hoping someone could explain to me. 1) How do you limit an array of building positions to positions contained within one building? It seems like most garrison scripts gather an array of nearby objects (buildings/houses) and then use that array to gather building positions. How can you limit the array to only use building positions from a single building before “considering” a different building? For example, a script gathers building positions from buildings A, B, and C. The script then places units in random positions from buildings A, B, and C. However, how can you make the script fill up building A before considering spots from building B or C? Ie, how can you fill buildings up one by one instead of considering building positions from all available buildings? 2) How do you filter out buildings that do not have a minimum number of positions? How can you ignore buildings that have less than X number of positions? 3) How do you remove a building/position from the script if a friendly unit already occupies that position? This is a difficult one for me to wrap my head around. I understand that, once a unit has been placed in a position, that position can be removed from the array. However, what if I have two squads executing the same building position script…how do you prevent them from randomly selecting the same building…? Could you run a check on the building position to see if a friendly unit is within 2 meters of the position? If so, then remove that position?
  3. Im trying to create a random position script for missions. The idea is the script will take an array of positions (placed objects) and, after a unit has been placed, that position will be removed from the array. Here is how it is called: ([Pos1, Pos2, Pos3], [Obj1, Obj2]) execvm Scripts/Misc/RandomPos. However, the script doesnt seem to recognize the array from the call/input...?
  4. Okay, thought count just returned a numerical value. Didnt know it could be used as a loop
  5. Whats the _dummy for? Also, how does it loop through all of the objects?
  6. ([Pos1, Pos2, Pos3], [Obj1, Obj2]) execvm .... First array (“Pos1”) would be available positions. These would be named objects. Second array (“Obj1”) are objectives (hostages, etc) that would be placed via the script. These would be named units, etc. _SelectedObject setpos getpos _RandomPosition; Thought this would move the objective to the position...? 
  7. Yes. The idea is to use the script with hostage rescue style missions. Since I play single player and I play my own missions, I know where an objective (hostage, etc) is placed. The idea is to randomly place the hostage from a selection of available positions. Once a position is “used” then that position should be removed. This is to prevent a situation where multiple hostages could be placed at the same location.
  8. Greetings, Im trying to figure out how to gather a magazine from each unit of a group and add it to an ammobox. The idea is that necessary magazines will be added to the ammobox regardless of the loadout. Here is what I got: But it isnt working...?
  9. This seems to work perfectly. Thank you! Now I gotta read up on “flatten” and “apply”
  10. Would only be used for single player. Dont know if that changes anything but I will checkout the wiki.
  11. Would disabling the default AI combat behavior work?
  12. Got a "clear building script" that orders friendly squad mates to move from building position to building position to clear a building. Script works great but squad mates will not move to a building position that is occupied by an enemy AI. For example, if an enemy AI is in building position #5 then the AI squad mates will move to positions 1, 2, 3, 4, and then stop at #4. Is there anyway to fix this? Here is the script: /*========================================================================================== Arma III AI Squad Mates Clear Building Created by WWI AI Mod Edited by Blitzen =========================================================================================== * WARNING: Script can be BUGGY! * Orders a player's AI squad mates to clear the building that the player is looking at * Intended to allow a player to quickly and, with as little headaches as possible, clear a building * Call with (Radio Trigger): Null = execVM "Scripts\Support\Support_PlayerGrpGarrison.sqf" ===========================================================================================*/ // Define Variables for the Clear Building Function //--------------------------------------- //Define some variables for the rest of the script _PlayersGroup = group player; _PlayerSquadMates = (units _PlayersGroup - [player]); //Save the Cursor target building _TargetedBuilding = Cursorobject; //Get Building positions from the building & count them _BuildingPos = _TargetedBuilding buildingpos -1; _BuildingPosCount = count _BuildingPos; //Call out / ID the building Player groupChat format ["Roger, clearing %1. Setting status to Careless",getText (configFile >> "CfgVehicles" >> (typeOf _TargetedBuilding) >> "displayName")]; //Cancel the script if no building positions are found if ((_BuildingPosCount) == 0) exitWith {Player groupChat "Unable to clear building - No building positions detected";}; // Create a Clear Building Function //--------------------------------------- Blitz_fnc_ClearBuilding = { //Define/Re-Define "New" Variables and make them private variables for the function private ["_unit","_BuildingPosCount", "_CurrentBuildingPos", "_Building"]; _unit = _this select 0; _BuildingPosCount = _this select 1; _Building = _this select 2; _CurrentBuildingPos = 0; _unit setbehaviour "CARELESS"; //Start the Movement Loop while {_CurrentBuildingPos <= _BuildingPosCount} do { _unit doMove (_Building buildingpos _CurrentBuildingPos); waitUntil {( unitReady _unit ) || !( alive _unit ) || (((expectedDestination _unit) select 1)!= "DoNotPlan" && ((expectedDestination _unit) select 1)!= "LEADER PLANNED")}; if(((expectedDestination _unit) select 1)!= "DoNotPlan" && ((expectedDestination _unit) select 1)!= "LEADER PLANNED") exitWith {}; _CurrentBuildingPos = _CurrentBuildingPos + 1; //End the Movement Loop }; _unit setbehaviour "AWARE"; [_unit] joinSilent (group player); }; // Have Units Call/Exec the Newly Created Function //--------------------------------------- { [_x, _BuildingPosCount, _TargetedBuilding] spawn Blitz_fnc_ClearBuilding }foreach _PlayerSquadMates;
  13. Blitzen88

    RHS Escalation (AFRF and USAF)

    Question: Can the RHS grip system be applied to vanilla models? Im trying to figure out if you can use the system to add a vertical grip to the Spar 16
  14. Greetings, I am fooling around with a very basic script, called via a radio trigger, which orders a player's AI squad mates to "clear" a targeted building. AI squad mates "clear" the building by moving, one after another, to each building position. Although the AI can clear small buildings relatively well, with the AI being what it is, they sometimes get hung up. Is there anyway to build in an "If condition exitwith" statement which will exit the script if the squad mates are given a return to formation command (ie dofollow player)? I tried something like: if (_Playersquadmates !dofollow player) then {} else {exit} With the idea being that the AI squad mates are not following the player when they are moving to a position. If they were issued a regroup command then they would be following the player and the script would end. However, it didnt work. Does anyone have any ideas? Here is what I got: //Define some variables for the rest of the script _PlayersGroup = group player; _PlayerSquadMates = (units _PlayersGroup - [player]); _PlayerSide = side Player; _OriginalFormation = formation _PlayersGroup; //Save the Cursor target building _Building = Cursorobject; //Get Building positions from the building and count them _BuildingPos = _Building buildingPos -1; _BuildingPosCount = count _BuildingPos; //Try to sort the Building Positions in ascending order (closest to farthest) _BuildingPos sort true; //Dont try to run the loop if all of the squadmates are dead if ((count _PlayerSquadMates) == 0) exitWith {}; //Dont try to run the loop if there are no building positions if ((count _BuildingPos) == 0) exitWith {player groupchat "Unable to clear the building - no builiding positions detected"}; //Acknowledge the command Player groupChat " Roger, Clearing building"; //Put the units into a File formation before they clear the building {_x setformation "FILE"} foreach _PlayerSquadMates; //Start the Loop while {_BuildingPosCount > 0} do { //Select the first Building Position _position = _BuildingPos select 0; //Remove the Building Position from the array _BuildingPos = _BuildingPos - [_position]; //Subtract a Building Position/Number from the Building Count _BuildingPosCount = _BuildingPosCount - 1; //Order the Units to the designated Position {_x doMove _position; sleep 1} foreach _PlayerSquadMates; waituntil { {unitReady _x} foreach _PlayerSquadMates; }; sleep 1; }; Player groupChat "Building cleared, returning to formation"; {_x dofollow leader _PlayersGroup} foreach _PlayerSquadMates; {_x setformation _OriginalFormation} foreach _PlayerSquadMates;
  15. I think the script could be exited by using the currentCommand feature. Something like: if ( currentCommand _unit == "STOP" ) then { exit } else { *code*} However, I cant figure out how to implement it into the code. This way, the script should end if the units are given a stop command.
  16. Blitzen88

    ARMA 3 Addon Request Thread

    Are there any addons which have IR laser & light combos that work well with the vanilla Ak12? Specifically ones where the IR laser is mounted on the top of the handguard (as opposed to the side). All of the ones I have found sit too low and clip into the weapon
  17. Greetings, I'm having an issue hiding "forgotten" units with the Military Symbols Module (aka Marta). The module correctly assigns military symbols to enemy units which have been identified but does not remove the symbol when that unit has lost contact with friendly forces. In other words, once a unit is identified, the Marta symbol stays with that unit until its death. Is there any way to fix this issue? I have tried both changing both of the following values: BIS_marta_mainscope setVariable ["delay", 0.1]; BIS_marta_mainscope setVariable ["duration", 600]; However neither command seems to work. If it is not possible to implement this by changing values, then is it possible to fix it via a script? Something sort of loop along the lines of: If player side does not know about enemygroup, then Marta_hide foreach unknown group...? I cant seem to figure it out and any help would be appreciated
  18. I tried this and it didnt seem to work. Here is what I did: Copied and pasted the code into init.sqf Identified a CSAT unit and then ran to the other side of the map The CSAT marker remained visible even when the unit was on the other side of the map. I suppose this test is based off of the assumption that the unit will no longer know about a target after a certain distance Is there any way to use BIS_Marta_getVisibleGroups to get a list of id'd groups, filter that list down to a selection of enemy groups, and then run that list of enemy groups to see if the players side knows about that particular unit? If not, then get rid of the marker(s)? If this is possible, then I dont believe you could use Marta_Hide because there is a chance that enemy unit could be re-identified after its initial identification Also, just out of curiosity, what does this part of the script do/mean: >-1}]; ==-1}]; Thank you for your help
  19. Trust me, I have been looking a loooottt at that post. The original poster in that thread actually asks, at the end, how to set the “duration” setting for Marta and seems to indicate that it was not working.
  20. Just as a backup do you mind sharing your marker script?
  21. Im making a mission where enemy units are put into positions via the BIS_fnc_ambientAnim function. For whatever reason this function creates a gamelogic on the map. Unfortunately, these gamelogics also show up on the map as a Blufor unit when the military symbols module is used. Is there anyway to disable military symbols for gamelogics? I tried putting this in the mission init but it didnt work: _gamelogics = allMissionObjects "Logic"; player setVariable ["MARTA_hide", [_gamelogics]]; Any help would be appreciated
  22. Thank you for this. I will give it a shot.
  23. Greetings, Im having some problems with a script (provided below) that I am using in an attempt to improve upon the default BIS_fnc_ambientAnim function. What the script does is place the unit in a stance, waits until that unit is in combat, and then has the unit either guard their location (via BIS_fnc_taskDefend) or stay in place (for a unit in a guard tower, etc.). Since certain animations remove the unit's weapon, the script also gives the unit their weapon back when they enter combat mode. I am having some issues getting this script to work with some other scripts/things that I am trying to do. Setup I placed a CSAT Rifleman in the editor and executed the script via the unit's init. From my understanding, the unit's script should execute/run before the Init. The script should save the unit's initial starting weapon. I use the Init script to apply a loadout script to all of the East Units on the map. This loadout script also changes the unit's weapon to an AK12. I also use the Init script to run another script which, based upon the user's input, removes or applies nightvision goggles to units a particular side. This script also gives a weapon flashlight to units which do not have nightvision goggles. In this case, the CSAT Rifleman should receive a flashlight. Order of Execution Animation script executes via the CSAT unit's init. The CSAT unit's original rifle is saved by the script Loadout Script executes via Init. The CSAT's unit's weapon is changed to an AK12 Nightvision/Flashlight script executes via Init. The CSAT unit's Ak12 now has a flashlight Problems The script uses a waituntil loop to check if the unit has entered combat. Once the unit enters combat, he is weapon is given back to him. For whatever reason, the unit is being given his weapon back before he enters combat There is a weird interaction between the unit receiving a weapon and the built in loadouts of the BIS_fnc_ambientAnim function. If the unit's loadout is set to "None" via the BIS_fnc_ambientAnim function then he will use his original, pre-Init weapon. If the unit's loadout is set to "ASIS" then the unit will use the post-init weapon. I have no idea as to why... Is there anyway to fix to the unit receiving their weapon before entering combat mode? Is there any way to build in a check that "updates" the unit's weapon ( and weapon attachements, ie the flashlight) and then gives that weapon to the unit when they enter combat mode? /*========================================================================================== Arma III - AI Ambient Stances =========================================================================================== * Places units in an ambient animation (sitting, watching, etc) and makes them respond to combat * Units will respond to combat by either (based upon input) call Bis_Fnc_Defend, or remain at their placed position. * Unit Stances and "Loadout" inputs are Case Sensitive! * Any unit loadout script must be executed before the animation script!!! * Possible "Loadouts": - NONE - no goggles, headgear, vest, weapon - LIGHT - no goggles, headgear, vest - MEDIUM - no goggles, headgear - FULL - no goggles - ASIS - no changes to the unit's gear - RANDOM (default) - gear is randomized according to the animation set * Possible Stances: - STAND - standing still, slightly turning to the sides, with rifle weapon - STAND_IA - standing still, slightly turning to the sides, with rifle weapon - STAND_U1-3 - standing still, slightly turning to the sides, no weapon - WATCH1- - standing and turning around, with rifle weapon - GUARD - standing still, like on guard with hands behing the body - LISTEN_BRIEFIN - standing still, hands behind back, recieving briefing / commands, no rifle. - LEAN_ON_TABLE - standing while leaning on the table - LEAN - standing while leaning (on wall) - BRIEFING - standing, playing ambient briefing loop with occasional random moves - BRIEFING_POINT_LEFT - contains 1 extra pointing animation, pointing left & high - BRIEFING_POINT_RIGHT - contains 1 extra pointing animation, pointing right & high - BRIEFING_POINT_TABLE - contains 1 extra pointing animation, pointing front & low, like at table - SIT1-3 - sitting on chair or bench, with rifle weapon - SIT_U1-3 - sitting on chair or bench, without weapon - SIT_AT_TABLE - sitting @ table, hands on table - SIT_HIGH1-2 - sitting on taller objects like a table or wall, legs not touching the ground. Needs a rifle! - SIT_LOW - sitting on the ground, with weapon. - SIT_LOW_U - sitting on the ground, without weapon. - SIT_SAD1-2 - sitting on a chair, looking very sad. - KNEEL - kneeling, with weapon. - PRONE_INJURED_U1-2 - laying wounded, back on the ground, without weapon - PRONE_INJURED - laying wounded & still, back on the ground, with or without weapon - KNEEL_TREAT - kneeling while treating the wounded - REPAIR_VEH_PRONE - repairing vehicle while laying on the ground (under the vehicle) - REPAIR_VEH_KNEEL - repairing vehicle while kneeling (like changing a wheel) - REPAIR_VEH_STAND - repairing/cleaning a vehicle while standing * Call with: [this, "SIT3", "ASIS", True] execVM "Scripts\AI_AmbientStances.sqf" ==========================================================================================*/ //Define Variables/Input _unit = _this select 0; _stance = _this select 1; _loadout = _this select 2; _GuardMode = _this select 3; _OriginalPosition = position (_this select 0); _UnitsGroup = group (_this select 0); _UnitsPrimaryWeapon = primaryWeapon _unit; //Put the Unit in the Designated Position [_unit, _stance, _loadout] call BIS_fnc_ambientAnim; //Wait until the unit is in combat and then terminate the animation 0 = _unit spawn {waitUntil {behaviour _this == "combat"}; Sleep 1; _this call BIS_fnc_ambientAnim__terminate; }; Sleep 3; _unit setunitpos "Auto"; //Some animations remove the unit's primary weapon. Lets give the weapon back to him. [_unit, _UnitsPrimaryWeapon, 6] call BIS_fnc_addWeapon; _unit selectweapon (primaryweapon _unit); //The unit will either move/defend or remain at their position (useful for guardtowers, etc.) if (_GuardMode) then { [_UnitsGroup, _OriginalPosition] call bis_fnc_taskDefend; } else { _unit disableAI "Path"; }; Thank you for your help!
  24. Greetings, I use two sets of scripts to apply different equipment/guns/loadouts to AI groups. One script is a "loadout functions" script which creates functions which are used by other scripts which actually apply the loadout to the AI. This "loadout function" script is automatically run via the Init. Usually this works just fine but I have errors occur when an AI group execs a loadout script via its unit init box; I assume this is because unit init boxes exec before the init file. Is there a way to build in a check to the loadout scripts to see if a the loadout function script has run? Something like this: If ( loadoutFunctions.sqs has run ) then { (Do nothing) } else { exec LoadoutFunctions};
  25. This is the approach I was considering. Define a global variable in the loadout function script and then check for that variable in the loadout scripts.
×