Jump to content

Blitzen88

Member
  • Content Count

    244
  • Joined

  • Last visited

  • Medals

Everything posted by Blitzen88

  1. Im using a handful of scripts to create a "single player respawn." The "system" works by adding an evenhandler to the player and, once the player dies, creates a new playable unit that the player can switch to. The problem is, once the player dies and selects the new unit, the player/new unit looses access to the military symbols module. Map markers which were displayed for the "original" player unit are not longer displayed for the new unit. Here is what I am using: Init File: PlayerLoadOut = getUnitLoadout player; _RespawnMarker = createMarkerLocal ['PlayerRespawn', getpos Player]; _RespawnMarker setMarkerTypeLocal 'mil_dot'; _RespawnMarker setMarkerTextLocal 'Respawn Point'; _RespawnMarker setMarkerColorLocal 'ColorOrange'; _RespawnMarker setMarkerSizeLocal [0.5, 0.5]; Player addEventHandler ["Killed", {[(_this select 0)] execVM "Scripts\Support\Support_PlayerRespawn.sqf";}]; PlayerRespawn File: params ["_oldUnit"]; [_oldUnit] join grpnull; _newUnit = group _oldUnit createUnit [typeOf _oldUnit, getMarkerPos "PlayerRespawn",[],0,"NONE"]; _newUnit addEventHandler ["Killed", {[(_this select 0)] execVM "Scripts\Support\Support_PlayerRespawn.sqf";}]; addSwitchableUnit _newUnit; _newUnit disableai "path"; _newUnit setUnitLoadout PlayerLoadout; Is there anyway to re-apply the military symbols module to the new unit once the player dies? Any help would be appreciated. **EDIT** I've been doing some testing and I've found something unusual. I joined a game, killed myself via trigger (setdamage 1), and then switched units. Once I switch to the new unit, I killed myself with the map open. After the death of the unit but before I switched again, the enemy map marker's reappeared on the map....?
  2. Blitzen88

    RHS Escalation (AFRF and USAF)

    Does anyone have a description.ext file that defines RHS groups for the Spawn AI module?
  3. Holy shit, that seems to work perfectly! If the MARTA variables are set in the MARTA modules' init line, will the variables still be pulled to the new unit? Or do those variables need to be defined in the player's init line? Thank you so much for the help!
  4. It seems this is related to teamswitch in general and is not really related to the script; switching to a playable unit breaks Marta too. @Larrow might have some knowledge (puhllleeezzzee)
  5. I tried the suggested fix and its still not working. Map symbols appear for the original unit but do not appear upon "respawn" Is there a way to create a map marker on known enemy units for an entire side? It might be easier to just create my own spotter style of script...? EDIT Im thinking about using the event handler “Handle Damage.” Basically, teleport the player back to the respawn marker when the player’s health drops below a certain point…? Something like that..? That way the playable unit doesnt change.
  6. I think I understand the basics of what you’re saying but Im not sure I understand 100%. I want the new unit to be in a different group from the original (killed) unit’s group. Reason being, if the original (killed) unit is leading a group and the new unit is added to that group…wouldnt the original (killed) unit’s teammates join the new unit? Im trying to avoid a situation where the player dies, “respawns”, and the player’s squadmates are on the other side of the map where the death occurred. I havent tested the proposed fix (Im at work) but I hope it works because it seems like an easy solution.
  7. If the vehicle is created, I would have to get the driver of the vehicle and delete him before the player is moved in?
  8. Well that would be an easy fix. How can I refer to a created unit? For instance if I want that unit to copy the player’s loadout? Also, how could I move the player into a created vehicle as a driver, etc?
  9. I know that this is a topic that has come up before but I can't find the solution that I'm looking for and, after trying for about an hour now, I cant figure it out on my own. Im trying to create a script that will delete vehicles if: The crew is dead The vehicle is empty The vehicle is cannot move I also need for the script to ignore static weapons since those will commonly be empty for long periods of time. This is what I got: /*========================================================================================== * Delete Empty Vehicles WIP * Call with: [] execVM "Scripts\AI_Test.sqf" ===========================================================================================*/ While {True} do { _AllVehicles = Vehicles; if { (not canMove _x) || (alive _x OR count crew _x isEqualTo 0) || (not _x isKindOf "staticWeapon")} then { deletevehicle _x; } foreach _AllVehicles; Player SideChat "AI Vehicle Script Loaded"; sleep 600; _AllVehicles = []; }; I've never been good with decoding IF statements with multiple conditions. Im also not sure I have the "alive crew" part right. Can anyone please help me with this? Any help would be much appreciated. Thank you!
  10. Blitzen88

    RHS Escalation (AFRF and USAF)

    What controls the muzzle flash effect in RHS? Is there a way to change it to the vanilla muzzle flash?
  11. Good morning, I’m having some trouble figuring out how to delete “extra” units after an array has been resized. Here is what I got if (count _SquadUnits > count _TrenchPos) then { _SquadUnits resize (count _TrenchPos) }; //Delete "Extra" Units _SquadUnitsToDelete = _TrenchGroup - _SquadUnits; {deletevehicle _x } foreach _SquadUnitsToDelete; Basically, I want to delete “extra” units so that the number of SquadUnits is equal to the number of Trenchpos.
  12. Im just not that good at scripting and I try to stick to what I know. I will check out your script and will check out deleteat. thank you!
  13. This is what I came up with....seems to work for me: /*========================================================================================== Arma III - Trench Created by Blitzen =========================================================================================== * Defines "positions" by capturing user placed objects * Can be used to define defensive positions in a trench/FOB style of fortification * Script is necessary for units that respawn and need to occupy the same position * Script will delete "unused" units and will hide unused trench positions * Parameters: - SquadLeader: Trench group's squadleader - Radius: Search radius for defined object (trench position) - Object: Object that is used to identify a trench position (highly recommend the "helper signs (ie arrows) since they dont have collision * Call with: [This, 200, "Sign_Arrow_Blue_F"] execVM "Scripts\AI\AI_Trench.sqf" ===========================================================================================*/ //Define Input Variables _SquadLeader = _this select 0; _Radius = _this select 1; _TrenchPosObject = _this select 2; //Create Variables that will be used by the script _TrenchUnits = units group _Squadleader; //Get Trench Positions and shuffle the array _TrenchPositions = getpos _SquadLeader nearObjects [_TrenchPosObject, _Radius]; _TrenchPositions = _TrenchPositions call BIS_fnc_arrayShuffle; {hideObject _x} foreach _TrenchPositions; {_x allowDamage false} foreach _TrenchPositions; if ((Count _TrenchPositions) == 0) exitWith {Player groupChat "Trench Script - No Trench Positions Detected;"}; //Count the Trench units for the loop _CountTrenchPositions = count _TrenchPositions; //Go ahead and disable movement and set unit positions {_x disableai "path"} foreach _TrenchUnits; {_x setUnitPos "Up"} foreach _TrenchUnits; //Start Loop _Go = True; while {_Go} do { if ((count _TrenchUnits) == 0) exitWith {_Go = False}; if ((count _TrenchPositions) == 0) exitWith {_Go = False}; //Select the Unit _Unit = _TrenchUnits select 0; //Remove the selected unit from the array _TrenchUnits = _TrenchUnits - [_Unit]; //Select the Trench object _SelectedTrenchPosition = _TrenchPositions select 0; //Remove the Selected Trench object from the array _TrenchPositions = _TrenchPositions - [_SelectedTrenchPosition]; //Get the Object's position - thats what we really want _SavedTrenchPosition = getpos _SelectedTrenchPosition; _unit setpos _SavedTrenchPosition; sleep 1; //Reduce the SquadUnits Count by 1 _CountTrenchPositions = _CountTrenchPositions - 1; //End Loop }; if (count _TrenchUnits > 0) then { {deletevehicle _x} foreach _TrenchUnits; };
  14. Will do. Does my deletion of extra units work?
  15. /*========================================================================================== Arma III - Trench WIP Created by Blitzen =========================================================================================== * Blah * Parameters: - SquadLeader: Trench group's squadleader - Radius: Search radius for defined object (trench position) * Call with: [This, 200, "Sign_Arrow_Blue_F"] execVM "Scripts\AI\AI_Trench.sqf" ===========================================================================================*/ //Define Input Variables _SquadLeader = _this select 0; _Radius = _this select 1; _TrenchPosObject = _this select 2; //Create Variables that will be used by the script _TrenchUnits = units group _Squadleader; //Get Trench Positions and shuffle the array _TrenchPositions = getpos _SquadLeader nearObjects [_TrenchPosObject, _Radius]; _TrenchPositions = _TrenchPositions call BIS_fnc_arrayShuffle; //If there are more units than positions then resize the units array and delete "extra" units if (count _TrenchUnits > count _TrenchPositions) then { _TrenchUnits = _TrenchUnits resize (count _TrenchPositions); if !(_x in _TrenchUnits) then {deletevehicle _x} foreach units group _Squadleader; }; //Count the squad units for the loop _CountTrenchUnits = count _TrenchUnits; //Start Loop while {_CountTrenchUnits > 0} do { //Select the Unit _Unit = _TrenchUnits select 0; //Remove the selected unit from the array _TrenchUnits = _TrenchUnits - [_Unit]; //Select the Trench object _SelectedTrenchPosition = _TrenchPositions select 0; //Remove the Selected Trench object from the array _TrenchPositions = _TrenchPositions - [_SelectedTrenchPosition]; //Get the Object's position - thats what we really want _SavedTrenchPosition = getpos _SelectedTrenchPosition; //Delete the object since we have the object's position saved deletevehicle _SelectedTrenchPosition; _unit setpos _SavedTrenchPosition; _unit disableAI "Path"; _unit setUnitPos "Up"; sleep 1; //Reduce the SquadUnits Count by 1 _CountSquadUnit = _CountSquadUnit - 1; //End Loop }; //Delete Remaining positions if (count _TrenchPositions > 0) then { {deletevehicle _x} foreach _TrenchPositions; };
  16. Blitzen88

    Tier 1 Weapons

    Any chance this mod would ever be released without RHS as a dependency? i know the answer but figured I would ask.
  17. Been a bit since I played around with mods. Does CUP have modern ARs like the urgi or mlok variants?
  18. Good morning, Im trying to figure out how to remove units that are in a vehicle from an array. I feel like this is probably an easy solution but my little brain cant figure it out. This is what I have: //Define the Group _PlayersGroup = group player; //Remove the player from the array _PlayerSquadMates = (units _PlayersGroup - [player]); //Remove units which are in a vehicle: _PlayerSquadMates = _PlayerSquadMates – Units in a vehicle //Have the filtered units call the function { [_x, blah blah blah] spawn Example_fnc_FunctionName } foreach _PlayerSquadMates;
  19. Does this need to be units group player instead of units player? Just curious because Im stuck at work and cant test stuff right now.
  20. 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!
  21. 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?
  22. 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...?
  23. Okay, thought count just returned a numerical value. Didnt know it could be used as a loop
  24. Whats the _dummy for? Also, how does it loop through all of the objects?
  25. ([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...? 
×