Jump to content

sizraide

Member
  • Content Count

    111
  • Joined

  • Last visited

  • Medals

Posts posted by sizraide


  1. 1 minute ago, Larrow said:

    Yes, but it is slow and looks like crap and would have to be done every time the ui is shown.

    Could possibly do it with macros so its updated as the game loads the config. Would still mean you have to go through and update all x,y,w,h definitions though.

     

    I haven't seen anywhere where I can convert my grid (ctrl + G) to pixelGrid definitions, if it helps.

    Because I am willing to recreate the entire dialog.


  2. 6 hours ago, Larrow said:
    
    x = 0.00492199 * safezoneW;

    Well, this is basically saying start at .4% of the screen's width. ( from 0 x which is not the left side of the screen )

    
    x = "safezoneX + (5 * pixelGridNoUIScale * pixelW)";

    this is saying start at the left edge of the screen( safeZoneX ) plus 5 grids converted to pixel widths. Where a pixel width is in screen space dimensions( width of screen ).

    So...

    
    //Divide value by width of a pixel, rounded to the nearest pixel.
    _numPixels = round( 0.00492199 / pixelW );
    //num pixels divide by number of pixels in a pixel grid
    _numGrids = _numPixels / pixelGridNoUIScale;

    This will give you how many pixels grids your original value was. Rounded so your position is pixel-perfect.
    Which you can then plug into your UI.
    So...

    
    x = _numGrids * ( pixelW * pixelGridNoUIScale );

    Replace _numGrids with the answer from the previous calculation.

     

    This, Arma 3: Pixel Grid System ,maybe helpful.


    Considering I have hundred of classes in my .hpp files to convert the positions.


    Would it be possible to just run a function that converts there x, y, w, h to pixelGrid?

    class MenuFrame_StartButton_BG: RscPicture
    {
        idc = -1;
        text = "#(argb,8,8,3)color(0.05,0.05,0.05,1)";
        x = 0.849453 * safezoneW + safezoneX;
        y = 0.934 * safezoneH + safezoneY;
        w = 0.152578 * safezoneW;
        h = 0.07 * safezoneH;
        onLoad = "[_this # 0] call DES_fnc_changeToPixelGrid;"; // <-- For example.
    };

    Because right now my dialog in 16:9 1920 x 1080 looks like this:
    https://imgur.com/a/sKaihj4

    And in 21:9 2560 x 1080, it looks like this:
    https://imgur.com/undefined

    I want all aspect ratios to have consistent size in dialogs and text, just the way the dialog looks like in 21:9.


  3. I want my GUI dialogs to stay consistent in size with different ratio aspects.

    At the moment my dialogs stay consistent in size with different resolutions.

     

    How do I convert this (for example):

    x = 0.00492199 * safezoneW;
    y = 0.014 * safezoneH;
    w = 0.132891 * safezoneW;
    h = 0.056 * safezoneH;

    To something like this (taken from Dynamic Recon Ops)?

    x = "safezoneX + (5 * pixelGridNoUIScale * pixelW)";
    y = "safezoneY + (0.25 * pixelGridNoUIScale * pixelH)";
    w = "15 * pixelGridNoUIScale * pixelW";	
    h = "15 * pixelGridNoUIScale * pixelH";	


    I hope I made sense, thanks.


  4. 5 hours ago, _foley said:

    What's the value of _classname when it fails? Perhaps getUnitLoadout doesn't return array in the expected format for some inputs.

    It's put into a variable to check how many units are in a faction are suitable for the scenario.

    It's part of a larger function to collect every faction from CfgFactionClasses and determine if a faction is usable in a scenario based on how many amount of units are appropriate for the scenario.

    _index = { [configName _x] call SIZ_fnc_checkUnit } count ("(configName _x isKindOf 'Man') && getText (_x >> 'faction') == _faction" configClasses (configFile >> "CfgVehicles"));


    Here is the full function.
     

    _factions = [];
    {
    	_faction = configName _x;
    	_index = { [configName _x] call SIZ_fnc_checkUnit } count ("(configName _x isKindOf 'Man') && getText (_x >> 'faction') == _faction" configClasses (configFile >> "CfgVehicles"));
    
    	if(_index > 2) then { 
    		_displayName = getText (configFile >> "CfgFactionClasses" >> _faction >> "displayName");
    		if(_displayName isNotEqualTo "") then {
    
    			_icon = getText (configFile >> "CfgFactionClasses" >> _faction >> "icon");
    			_side = getNumber (configFile >> "CfgFactionClasses" >> _faction >> "side");
    
    			if(_icon == "") then 
    			{
    				switch(_side) do 
    				{
    					case 0: {_icon = "a3\data_f\flags\flag_red_co.paa"};
    					case 1: {_icon = "a3\data_f\flags\flag_blue_co.paa"};
    					case 2: {_icon = "a3\data_f\flags\flag_green_co.paa"};
    				};
    			};
    			_factions set [_forEachIndex, [_displayName, _faction, _side, _icon]];
    		};
    	};
    } forEach ("getNumber (_x >> 'side') in [0,1,2,3]" configClasses (configFile >> "CfgFactionClasses"));


    EDIT:

    I forgot to mention SIZ_fnc_checkUnit is where the classname is sent through.


  5. Hello, I have a script here that checks if the classname provided has any primary, secondary, or handgun.

    This script works sometimes, when it doesn't, it gets an error for Error Zero Divisor

    Script:

    // Check if unit has any weapons.
    _weapons = getUnitLoadout _classname select [0,3];
    if((_weapons select 0) isEqualTo [] && (_weapons select 1) isEqualTo [] && (_weapons select 2) isEqualTo []) exitWith { false };

     

    Any help is appreciated.


  6. 5 hours ago, Harzach said:

    The HandleDamage EH can fire multiple times per "hit" due to penetration - see the first sentence in the entry:

      

    https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage

     

    So your check for SIZ_Bleeding, the sleep, and the function call can initiate multiple times within the space of the first sleep.

     

    _projectile should remain the same for each "sub-hit" so you could maybe filter them out that way.

     

    That said, the HitPart EH might be a better choice as it registers all "sub-hits" as one event.


    So, I tried using HitPart, but I have one more issue.

    I am trying to get the accumulated damage of the unit based off hitpoint damage.

    Somehow, this script doesn't run at all when the accumulated damage reaches beyond 1.5.

     

    SIZ_enableReviveForUnit = {
    	params["_unit"];
    
    	// HandleDamage event handler
    	_unit addEventHandler ["HitPart", {
    		(_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"];
    		
    		_totalDmg = 0;
    		{ _totalDmg = _totalDmg + _x } forEach (getAllHitPointsDamage _target select 2);
    		
    		hint str _totalDmg; // DEBUG, it works.
    
    		if(_totalDmg >= 1.5) then { // Doesn't fire when _totalDmg goes beyond 1.5?
    			if !(_unit getVariable "SIZ_Downed") then 
    			{
    				_unit spawn 
    				{
    					[_this, true] call SIZ_setUnitState;
    
    					waitUntil{sleep 0.5; (lifeState _this == "INCAPACITATED" && _this getVariable "SIZ_Downed")};
    
    					_this call SIZ_addReviveAction;
    					_this call SIZ_startBleedout;
    
    					if(!isPlayer _this && _this getVariable "SIZ_Bleeding") then { 	
    						sleep 1;						
    						if(alive _this) then { _this call SIZ_reviveCallOut; };
    					};
    				};
    			};
    		};
    	}];
    
    	// Killed event handler
    	_unit addEventHandler ["Killed", {
    		params ["_unit"];
    		[_unit, false] call SIZ_setUnitState; 
    	}];
    };

     


  7. Hello, I have a script that calls when a unit gets damaged, and depending on that damage it incapacitates the unit.

    My issue is that SIZ_reviveCallOut calls out twice sometimes.

    This frequently HAPPENS when I shoot the AI on the head once first, then shoot at it's legs a few times until the script sets off and incapacitates the unit, where it will randomly play the SIZ_reviveCallOut function twice.

    My script, any solution is appreciated:

    SIZ_enableReviveForUnit = {
    	params["_unit"];
    
    	// HandleDamage event handler
    	_unit addEventHandler ["HandleDamage", {
    		params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
    		
    		if (_damage >= 0.99 && !(_unit getVariable "SIZ_Downed")) then 
    		{
    			_unit spawn 
    			{
    				[_this, true] call SIZ_setUnitState;
    
    				waitUntil{sleep 0.5; (lifeState _this == "INCAPACITATED" && _this getVariable "SIZ_Downed")};
    				
    				_this call SIZ_addReviveAction;
    				_this call SIZ_startBleedout;
    
    				if(!isPlayer _this && _this getVariable "SIZ_Bleeding") then { 	
    					sleep 1;						
    					if(alive _this) then { _this call SIZ_reviveCallOut; }; // <----- THIS IS THE ERROR
    				};
    			};
    		};
    		_damage;
    	}];
    
    	// Killed event handler
    	_unit addEventHandler ["Killed", {
    		params ["_unit"];
    		[_unit, false] call SIZ_setUnitState; 
    	}];
    };

     


  8. 9 hours ago, Larrow said:
      Hide contents
    
    
    SIZ_Test = {
    	params["_injured"];
    		
    	// Get all nearby healers in order of distance
    	_nearbyHealers = _injured nearEntities["Man", 25] select{
    		_x isNotEqualTo _injured && { side _x isEqualTo side _injured && { [ _x, "FirstAid", true ] call BIS_fnc_hasItem }}
    	} apply{ [ _x distance _injured, _x ] };
    	_nearbyHealers sort true;
    
    	if( _nearbyHealers isNotEqualTo [] ) then {
    		
    		[ _nearbyHealers select 0 select 1, _injured ] spawn {
    			params["_healer", "_injured"];
            //...

     

     


    I really appreciate the solution Larrow, I have an unrelated problem.

    How do you work around when a unit radio's "NEGATIVE" in chat when it refuses to perform a doMove command.

    I often get this issue when the position is inside a building, because I have this command running in a script where the healer moves to the incapacitated unit.

     

    I have tried getting all the positions in a building and looping through all those positions to find the nearest one to the incapacitated unit, but it doesn't work.


  9. Hello,

    I have made a script here that runs on a player and gets a nearby AI to heal that player (player must be in incapacitated state).

    The problem is, this code works completely fine when the player is not unconscious, but the moment the player is unconscious I get an error that waitUntil returns nil.

    Here is the code:

    Spoiler
    
    SIZ_Test = {
    	params["_injured"];
    	_nearbyUnits = [];
    	
    	_list = getPos _injured nearEntities["Man", 25]; // Get all nearby units
    	_list = _list - [_injured];
    
    	if(count _list > 0) then 
    	{
    		{
    			if(side _x == side _injured && [_x, "FirstAidKit", true] call BIS_fnc_hasItem) then { _nearbyUnits pushBack _x; };
    		} forEach _list; // Sort units by side and if they have first aid
    		
    		for "_i" from 0 to count _nearbyUnits - 1 do // Loop to get the nearest unit from the list nearby incapacitated player.
    		{
    			_currentDistance = (_nearbyUnits select _i) distance _injured;
    			
    			for "_j" from 0 to count _nearbyUnits - 1 do 
    			{
    				_selectedDistance = (_nearbyUnits select _j) distance _injured;
    				
    				if(_selectedDistance < _currentDistance) then 
    				{ 
    					_currentDistance = _selectedDistance; 
    					_healer = _nearbyUnits select _j;
    				};
    			};  
    		};	 
    
    		[_healer, _injured] spawn 
    		{
    			params["_healer", "_injured"];
    			
    			_injuredPos = getPosATL _injured;
    			_healer doMove _injuredPos; // Move to incapacitated unit
    			
    			waitUntil{moveToCompleted _healer};	// Error occurs here <----	
    			doStop _healer;		
    			
    			_relDir = (_healer getDir _injured);
    			_healer setFormDir (_healer getDir _injured);
    			
    			sleep 1;
    			
    			_injured setVariable ["SIZ_BeingRevived", true];
    			_healer setVariable ["SIZ_RevivingUnit", true];
    
    			_time = _injured call SIZ_calculateReviveTime; // Function to calculate revive time based on damage of incapacitated unit.
    
    			while{alive _healer} do // Perform healing animation
    			{
    				_time = _time - 1;
    				hint str _time;
    
    				if(_time == 0) exitWith {
    					_injured setVariable ["SIZ_BeingRevived", nil];
    					_healer setVariable ["SIZ_RevivingUnit", nil];
    
    					_healer playMoveNow "AinvPknlMstpSnonWnonDnon_medicEnd";
    				};
    
    				_healer playMove "AinvPknlMstpSnonWnonDnon_medic1";
    				_healer playMove "AinvPknlMstpSnonWnonDnon_medic2"; 
    				_healer playMove "AinvPknlMstpSnonWnonDnon_medic3";
    				
    				sleep 1;
    			};
    			
    			if(alive _healer) then { // Return to leader once done.
    				_leader = leader _healer;
    				_healer setFormDir (_healer getDir _leader);
    				_healer doFollow _leader;
    			};
    		};		
    
    	} else {
    		// Do bunch of stuff here if healer is not found
    	};
    };
    
    player call SIZ_Test;

     


    Any help would be appreciated.

    EDIT:

    I fixed it, I used the wrong unit for moveToCompleted.

    The code kind of works, but only works when the unit is not in a incapacitated state.


  10. Is there a way to fade in a image from RscPicture? I am trying to create visual effects for a downed player/unit.

    Code below:

    SIZ_postProcessEffects = 
    {
    	params["_unit"];
    
    	"radialBlur" ppEffectEnable true;
    	"radialBlur" ppEffectAdjust [0.05,0.05,0.21,0.21];
    	"radialBlur" ppEffectCommit 1;
    
    	"ChromAberration" ppEffectEnable true;
    	"ChromAberration" ppEffectAdjust [0.05,0.05,true];
    	"ChromAberration" ppEffectCommit 1;
    
    	_ctrl = findDisplay 46 ctrlCreate ["RscPicture", -1]; // Picture being created
    	_ctrl ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH];
    	_ctrl ctrlSetText selectRandom
    	[
    		"a3\ui_f\data\igui\rsctitles\healthtextures\blood_middle_ca.paa",
    		"a3\ui_f\data\igui\rsctitles\healthtextures\blood_lower_ca.paa",
    		"a3\ui_f\data\igui\rsctitles\healthtextures\blood_upper_ca.paa"
    	];
    	_ctrl ctrlSetFade random 0.35;
    	_ctrl ctrlCommit 0;
    	
    	waitUntil{!alive _this || (lifeState _this == 'HEALTHY' && alive _this)};
    
    	ctrlDelete _ctrl;
    	"radialBlur" ppEffectEnable false;
    	"ChromAberration" ppEffectEnable false;
    };

     


  11. FIXED:

     

    I fixed it guys. If anyone wants to use this script for whatever purpose to gather all groups of factions and place them under each seperate category. Here it is:

     

    Spoiler
    
    private _side = "West"; // Test side
    private _findFaction = "USA (SOCOM)"; // Test name
    private _returnArray = []; // Return
    
    private _allGroups = "getText (_x >> 'name') == _findFaction" configClasses (configFile >> "CfgGroups" >> _side);
    private _factionName = configName (_allGroups select 0);
    
    // Gather all types of factions under _findFaction 
    private _allFactionGroups = []; 
    { 
    	_allFactionGroups pushBack (configName _x); 
    } forEach ("true" configClasses (configfile >> "CfgGroups" >> _side >> _factionName));
    
    for "_i" from 0 to (count _allFactionGroups) - 1 do 
    {
    	// Get all groups under type of faction
    	private _allGroupsUnderFaction = []; 
    	private _selectedFaction = (_allFactionGroups select _i);
    	{ 
    		_allGroupsUnderFaction pushBack (configName _x); 
    	} forEach ("true" configClasses (configfile >> "CfgGroups" >> _side >> _factionName >> _selectedFaction));
    
    	_returnArray pushBack [_selectedFaction, _allGroupsUnderFaction]; 
    };
    
    hint str _returnArray;
    copyToClipboard str _returnArray;
    /*
    [
    	["Infantry",["BUS_InfSquad","BUS_InfSquad_Weapons","BUS_InfTeam","BUS_InfTeam_AT","BUS_InfTeam_AA","BUS_InfSentry","BUS_ReconTeam","BUS_ReconPatrol","BUS_ReconSentry","BUS_SniperTeam","BUS_InfAssault","BUS_ReconSquad","B_InfTeam_Light"]],
    	["SpecOps",["BUS_DiverTeam","BUS_DiverTeam_Boat","BUS_DiverTeam_SDV","BUS_SmallTeam_UAV","BUS_ReconTeam_UGV","BUS_AttackTeam_UGV","BUS_ReconTeam_UAV","BUS_AttackTeam_UAV"]],
    	["Support",["BUS_Support_CLS","BUS_Support_EOD","BUS_Support_ENG","BUS_Recon_EOD","BUS_Support_MG","BUS_Support_GMG","BUS_Support_Mort"]],
    	["Motorized",["BUS_MotInf_Team","BUS_MotInf_AT","BUS_MotInf_AA","BUS_MotInf_MGTeam","BUS_MotInf_GMGTeam","BUS_MotInf_MortTeam","BUS_MotInf_Reinforce"]],
    	["Mechanized",["BUS_MechInfSquad","BUS_MechInf_AT","BUS_MechInf_AA","BUS_MechInf_Support"]],
    	["Armored",["BUS_TankPlatoon","BUS_TankPlatoon_AA","BUS_TankSection","BUS_SPGPlatoon_Scorcher","BUS_SPGSection_Scorcher","BUS_SPGSection_MLRS","B_TankDestrSection_Rhino","B_TankDestrSection_RhinoUP"]]
    ];
    */

     

     


  12. Hello,

     

    I have a script here that completely works by itself standalone.

    test.sqf

    Spoiler
    
    _inheritGroup = 
    {
    	private _factionName = "rhs_faction_usarmy_wd";
    	private _factionGroups = "true" configClasses (configFile >> "CfgGroups" >> "West" >> _factionName);
    	private _groupNames = [];
    
    	{
    		private _factionClass = configName _x;
    		private _allGroups = "true" configClasses (configFile >> "CfgGroups" >> "West" >> _factionName >> _factionClass);
    		private _placeholderArray = [];
    
    		for "_i" from 0 to (count _allGroups - 1) do {
    			private _groupName = configName (_allGroups select _i);
    			_placeholderArray pushBack _groupName;
    		};
    
    		_groupNames pushBack [_factionClass, _placeholderArray];
    
    	} forEach _factionGroups;
    	_groupNames;
    };
    
    // Debug
    copyToClipboard str ([] call _inheritGroup);

     

     

    Output

    Spoiler
    
    [
    	["rhs_group_nato_usarmy_wd_infantry",["rhs_group_nato_usarmy_wd_company_hq","rhs_group_nato_usarmy_wd_platoon_hq","rhs_group_nato_usarmy_wd_infantry_squad","rhs_group_nato_usarmy_wd_infantry_weaponsquad","rhs_group_nato_usarmy_wd_infantry_squad_sniper","rhs_group_nato_usarmy_wd_infantry_team","rhs_group_nato_usarmy_wd_infantry_team_MG","rhs_group_nato_usarmy_wd_infantry_team_AA","rhs_group_nato_usarmy_wd_infantry_team_support","rhs_group_nato_usarmy_wd_infantry_team_heavy_AT"]],
    	["rhs_group_nato_usarmy_wd_infantry_arb",["rhs_group_nato_usarmy_wd_company_hq","rhs_group_nato_usarmy_wd_platoon_hq","rhs_group_nato_usarmy_wd_infantry_squad","rhs_group_nato_usarmy_wd_infantry_weaponsquad","rhs_group_nato_usarmy_wd_infantry_squad_sniper","rhs_group_nato_usarmy_wd_infantry_team","rhs_group_nato_usarmy_wd_infantry_team_MG","rhs_group_nato_usarmy_wd_infantry_team_AA","rhs_group_nato_usarmy_wd_infantry_team_support","rhs_group_nato_usarmy_wd_infantry_team_heavy_AT"]],
    	["rhs_group_nato_usarmy_wd_RG33",["rhs_group_nato_usarmy_wd_RG33_squad","rhs_group_nato_usarmy_wd_RG33_squad_2mg","rhs_group_nato_usarmy_wd_RG33_squad_sniper","rhs_group_nato_usarmy_wd_RG33_squad_mg_sniper","rhs_group_nato_usarmy_wd_RG33_m2_squad","rhs_group_nato_usarmy_wd_RG33_m2_squad_2mg","rhs_group_nato_usarmy_wd_RG33_m2_squad_sniper","rhs_group_nato_usarmy_wd_RG33_m2_squad_mg_sniper"]],
    	["rhs_group_nato_usarmy_wd_FMTV",["rhs_group_nato_usarmy_wd_FMTV_1078_squad","rhs_group_nato_usarmy_wd_FMTV_1078_squad_2mg","rhs_group_nato_usarmy_wd_FMTV_1078_squad_sniper","rhs_group_nato_usarmy_wd_FMTV_1078_squad_mg_sniper","rhs_group_nato_usarmy_wd_FMTV_1083_squad","rhs_group_nato_usarmy_wd_FMTV_1083_squad_2mg","rhs_group_nato_usarmy_wd_FMTV_1083_squad_sniper","rhs_group_nato_usarmy_wd_FMTV_1083_squad_mg_sniper"]],
    	["rhs_group_nato_usarmy_wd_HMMWV",["BUS_MotInf_Team_GMG","BUS_MotInf_Team_HMG","BUS_MotInf_AT","BUS_MotInf_AA"]],
    	["rhs_group_nato_usarmy_wd_M113",["rhs_group_nato_usarmy_wd_M113_squad","rhs_group_nato_usarmy_wd_M113_squad_2mg","rhs_group_nato_usarmy_wd_M113_squad_sniper","rhs_group_nato_usarmy_wd_M113_squad_mg_sniper"]],
    	["rhs_group_nato_usarmy_wd_bradley",["rhs_group_nato_usarmy_wd_bradley_squad","rhs_group_nato_usarmy_wd_bradley_squad_2mg","rhs_group_nato_usarmy_wd_bradley_squad_sniper","rhs_group_nato_usarmy_wd_bradley_squad_mg_sniper","rhs_group_nato_usarmy_d_bradley_aa"]],
    	["rhs_group_nato_usarmy_wd_bradley_busk",["rhs_group_nato_usarmy_wd_bradley_squad","rhs_group_nato_usarmy_wd_bradley_squad_2mg","rhs_group_nato_usarmy_wd_bradley_squad_sniper","rhs_group_nato_usarmy_wd_bradley_squad_mg_sniper","rhs_group_nato_usarmy_d_bradley_aa"]],
    	["rhs_group_nato_usarmy_wd_bradleyA3",["rhs_group_nato_usarmy_wd_bradleyA3_squad","rhs_group_nato_usarmy_wd_bradleyA3_squad_2mg","rhs_group_nato_usarmy_wd_bradleyA3_squad_sniper","rhs_group_nato_usarmy_wd_bradleyA3_squad_mg_sniper","rhs_group_nato_usarmy_d_bradleyA3_aa"]],
    	["rhs_group_nato_usarmy_wd_bradleyA3_busk",["rhs_group_nato_usarmy_wd_bradleyA3_squad","rhs_group_nato_usarmy_wd_bradleyA3_squad_2mg","rhs_group_nato_usarmy_wd_bradleyA3_squad_sniper","rhs_group_nato_usarmy_wd_bradleyA3_squad_mg_sniper","rhs_group_nato_usarmy_d_bradleyA3_aa"]],
    	["rhs_group_nato_usarmy_wd_bradleyA3_busk3",["rhs_group_nato_usarmy_wd_bradleyA3_squad","rhs_group_nato_usarmy_wd_bradleyA3_squad_2mg","rhs_group_nato_usarmy_wd_bradleyA3_squad_sniper","rhs_group_nato_usarmy_wd_bradleyA3_squad_mg_sniper","rhs_group_nato_usarmy_d_bradleyA3_aa"]],
    	["rhs_group_nato_usarmy_wd_stryker",["rhs_group_nato_usarmy_wd_stryker_squad","rhs_group_nato_usarmy_wd_stryker_wpnsquad"]],
    	["rhs_group_nato_usarmy_wd_m1a1",["RHS_M1A1AIM_wd_Platoon","RHS_M1A1AIM_wd_Platoon_AA","RHS_M1A1AIM_wd_Section","RHS_M1A1AIM_wd_TUSK_Platoon","RHS_M1A1AIM_wd_TUSK_Platoon_AA","RHS_M1A1AIM_wd_TUSK_Section"]],
    	["rhs_group_nato_usarmy_wd_M1A2",["RHS_M1A2SEP_wd_Platoon","RHS_M1A2SEP_wd_Platoon_AA","RHS_M1A2SEP_wd_Section","RHS_M1A2SEP_wd_TUSK_Platoon","RHS_M1A2SEP_wd_TUSK_Platoon_AA","RHS_M1A2SEP_wd_TUSK_Section","RHS_M1A2SEP_wd_TUSK2_Platoon","RHS_M1A2SEP_wd_TUSK2_Platoon_AA","RHS_M1A2SEP_wd_TUSK2_Section"]],
    	["rhs_group_nato_usarmy_wd_M109",["RHS_M109_wd_Platoon","RHS_M109_wd_Section"]]
    ];

     

     

     

    However, when implemented into my scripts that takes in the currently selected faction from a GUI, it completely breaks down.

     

    get_variables.sqf

    Spoiler
    
    /****************************************************************
    Gather all groups from each faction
    ****************************************************************/
    
    private _SIZ_fn_inheritGroup = 
    {
    	private _factionName = (_this select 0);
    	private _side = (_this select 1);
    	private _groupNames = [];
    
    	switch(_side) do 
    	{
    		case 0: {_side = "East"};
    		case 1: {_side = "West"};
    		case 2: {_side = "Indep"};
    	};
    	
    	private _factionGroups = "true" configClasses (configFile >> "CfgGroups" >> _side >> _factionName);
    	{
    		private _factionClass = configName _x;
    		private _allGroups = "true" configClasses (configFile >> "CfgGroups" >> _side >> _factionName >> _factionClass);
    		private _placeholderArray = [];
    
    		for "_i" from 0 to (count _allGroups - 1) do 
    		{
    			private _groupName = configName (_allGroups select _i);
    			_placeholderArray pushBack _groupName;
    		};
    
    		_groupNames pushBack [_factionClass, _placeholderArray];
    
    	} forEach _factionGroups;
    	_groupNames;
    };
    
    // INDEP
    private _ctrl = (findDisplay 0001) displayCtrl 2105;
    private _index = lbCurSel _ctrl;
    private _factionName = _ctrl lbData _index;
    _INDEP_GroupsArray = [_factionName, 2] call _SIZ_fn_inheritGroup;
    
    // OPFOR
    private _ctrl = (findDisplay 0001) displayCtrl 2106;
    private _index = lbCurSel _ctrl;
    private _factionName = _ctrl lbData _index;
    _OPFOR_GroupsArray = [_factionName, 0] call _SIZ_fn_inheritGroup;
    
    // BLUFOR
    private _ctrl = (findDisplay 0001) displayCtrl 2107;
    private _index = lbCurSel _ctrl;
    private _factionName = _ctrl lbData _index;
    _BLUFOR_GroupsArray = [_factionName, 1] call _SIZ_fn_inheritGroup;
    
    [
    	_OPFOR_GroupsArray, 
    	_BLUFOR_GroupsArray,
    	_INDEP_GroupsArray,
    	_RandomArt,
    	_BetterSounds,
    	_AmbientCombatSounds,
    	_RandomTime,
    	_RandomWeather,
    	_Difficulty,
    	_PlayerGroup
    ];
    
    // Debug
    copyToClipboard str 
    [
    	_OPFOR_GroupsArray, 
    	_BLUFOR_GroupsArray,
    	_INDEP_GroupsArray
    ];

     

     

    Output (currently)

    Spoiler
    
    // Output
    [
    	[],
    	[],
    	[["Infantry",["I_G_InfSquad_Assault","I_G_InfTeam_Light"]]]
    ]

     

    As you can see, for some reason it doesn't fill out the array.

     

    Here are my other files (GUI files):

    controls.hpp

    Spoiler
    
    class MenuScreen 
    {
        idd = 0001;
        onKeyDown = "if ((_this select 1) isEqualTo 1) then {false};";
    
        class controls
        {
            class SettingsStart: RscButton
            {
                idc = 1600;
                text = "START"; 
                style = ST_CENTER;
                font = "PuristaBold";
                x = 0.849453 * safezoneW + safezoneX;
                y = 0.934 * safezoneH + safezoneY;
                w = 0.152578 * safezoneW;
                h = 0.07 * safezoneH;
                sizeEx = 0.05 * safezoneH;
                colorBackground[] = 
                {
                    0,
                    0,
                    0,
                    0.5
                };
                colorBackgroundActive[] = 
                {
                    0,
                    0,
                    0,
                    0.5
                };
                action = "execVM 'escape_script\menu\confirm_settings.sqf'";
            };
            class SettingsFrame: RscPicture
            {
                text = "images\background.paa";
                idc = 1800;
                x = 0.849453 * safezoneW + safezoneX;
                y = -0.00399977 * safezoneH + safezoneY;
                w = 0.152578 * safezoneW;
                h = 0.938 * safezoneH;
                //colorBackground[] = {0,0,0,0.5};
            };
            class RandomArt_Title: RscStructuredText
            {
                idc = 1100;
                text = "Random Artillery"; 
                x = 0.854375 * safezoneW + safezoneX;
                y = 0.234 * safezoneH + safezoneY;
                w = 0.142734 * safezoneW;
                h = 0.042 * safezoneH;
                colorText[] = {1,1,1,1};
                tooltip = "Enable random artillery around the player(s).";
                colorBackground[] = {0,0,0,0};
                class Attributes
                {
                    font = "PuristaLight";
                    color = "#ffffff";
                    colorLink = "#D09B43";
                    shadow = 1;
                    size = 1;
                };
            };
            class RandomArtilleryComboBox: RscCombo
            {
                idc = 2100;
                x = 0.859297 * safezoneW + safezoneX;
                y = 0.276 * safezoneH + safezoneY;
                w = 0.132891 * safezoneW;
                h = 0.028 * safezoneH;
                class ComboScrollBar
                {
                    color[] = {1,1,1,1};
                    colorActive[] = {1,1,1,1};
                    colorDisabled[] = {1,1,1,0.3};
                    style = ST_MULTI + ST_NO_RECT;
                    thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
                    arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
                    arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
                    border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
                    shadow = 0;
                    scrollSpeed = 0.06;
                    width = 0;
                    height = 0;
                    autoScrollEnabled = 0;
                    autoScrollSpeed = -1;
                    autoScrollDelay = 5;
                    autoScrollRewind = 0;
                };
                colorBackground[] = 
                {
                    0,
                    0,
                    0,
                    0.8
                };
            };
            class BetterSoundsTitle: RscStructuredText
            {
                idc = 1103;
                text = "Better Sounds"; 
                x = 0.854375 * safezoneW + safezoneX;
                y = 0.318 * safezoneH + safezoneY;
                w = 0.147656 * safezoneW;
                h = 0.042 * safezoneH;
                colorText[] = {1,1,1,1};
                colorBackground[] = {0,0,0,0};
                tooltip = "Add in extra HUD sound elements that increase immersion.";
                class Attributes
                {
                    font = "PuristaLight";
                    color = "#ffffff";
                    colorLink = "#D09B43";
                    shadow = 1;
                    size = 1;
                };
            };
            class BetterSoundsCheckBox: RscCheckbox
            {
                idc = 2800;
                x = 0.9725 * safezoneW + safezoneX;
                y = 0.318 * safezoneH + safezoneY;
                w = 0.0196875 * safezoneW;
                h = 0.028 * safezoneH;
            };
            class AmbientCombatTitle: RscStructuredText
            {
                idc = 1104;
                text = "Ambient Combat Sounds"; 
                x = 0.854375 * safezoneW + safezoneX;
                y = 0.388 * safezoneH + safezoneY;
                w = 0.147656 * safezoneW;
                h = 0.042 * safezoneH;
                colorText[] = {1,1,1,1};
                colorBackground[] = {0,0,0,0};
                tooltip = "Enable random explosions and firefights around the player(s) that are not real.";
                class Attributes
                {
                    font = "PuristaLight";
                    color = "#ffffff";
                    colorLink = "#D09B43";
                    shadow = 1;
                    size = 1;
                };
            };
            class AmbientCombatCheckBox: RscCheckbox
            {
                idc = 2801;
                x = 0.9725 * safezoneW + safezoneX;
                y = 0.388 * safezoneH + safezoneY;
                w = 0.0196875 * safezoneW;
                h = 0.028 * safezoneH;
                class ComboScrollBar
                {
                    color[] = {1,1,1,1};
                    colorActive[] = {1,1,1,1};
                    colorDisabled[] = {1,1,1,0.3};
                    style = ST_MULTI + ST_NO_RECT;
                    thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
                    arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
                    arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
                    border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
                    shadow = 0;
                    scrollSpeed = 0.06;
                    width = 0;
                    height = 0;
                    autoScrollEnabled = 0;
                    autoScrollSpeed = -1;
                    autoScrollDelay = 5;
                    autoScrollRewind = 0;
                };
            };
            class RandomTimesTitle: RscStructuredText
            {
                idc = 1105;
                text = "Time"; 
                x = 0.854375 * safezoneW + safezoneX;
                y = 0.458 * safezoneH + safezoneY;
                w = 0.147656 * safezoneW;
                h = 0.042 * safezoneH;
                colorText[] = {1,1,1,1};
                colorBackground[] = {0,0,0,0};
                tooltip = "Choose a time for the scenario to start with.";
                class Attributes
                {
                    font = "PuristaLight";
                    color = "#ffffff";
                    colorLink = "#D09B43";
                    shadow = 1;
                    size = 1;
                };
            };
            class RandomTimesComboBox: RscCombo
            {
                idc = 2101;
                x = 0.928204 * safezoneW + safezoneX;
                y = 0.458 * safezoneH + safezoneY;
                w = 0.0639844 * safezoneW;
                h = 0.028 * safezoneH;
                class ComboScrollBar
                {
                    color[] = {1,1,1,1};
                    colorActive[] = {1,1,1,1};
                    colorDisabled[] = {1,1,1,0.3};
                    style = ST_MULTI + ST_NO_RECT;
                    thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
                    arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
                    arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
                    border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
                    shadow = 0;
                    scrollSpeed = 0.06;
                    width = 0;
                    height = 0;
                    autoScrollEnabled = 0;
                    autoScrollSpeed = -1;
                    autoScrollDelay = 5;
                    autoScrollRewind = 0;
                };
                colorBackground[] = 
                {
                    0,
                    0,
                    0,
                    0.8
                };
            };
            class RandomWeatherTitle: RscStructuredText
            {
                idc = 1106;
                text = "Weather"; 
                x = 0.854375 * safezoneW + safezoneX;
                y = 0.528 * safezoneH + safezoneY;
                w = 0.147656 * safezoneW;
                h = 0.042 * safezoneH;
                colorText[] = {1,1,1,1};
                colorBackground[] = {0,0,0,0};
                tooltip = "Choose a weather for the scenario to start with.";
                class Attributes
                {
                    font = "PuristaLight";
                    color = "#ffffff";
                    colorLink = "#D09B43";
                    shadow = 1;
                    size = 1;
                };
            };
            class RandomWeatherComboBox: RscCombo
            {
                idc = 2102;
                x = 0.928204 * safezoneW + safezoneX;
                y = 0.528 * safezoneH + safezoneY;
                w = 0.0639844 * safezoneW;
                h = 0.028 * safezoneH;
                class ComboScrollBar
                {
                    color[] = {1,1,1,1};
                    colorActive[] = {1,1,1,1};
                    colorDisabled[] = {1,1,1,0.3};
                    style = ST_MULTI + ST_NO_RECT;
                    thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
                    arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
                    arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
                    border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
                    shadow = 0;
                    scrollSpeed = 0.06;
                    width = 0;
                    height = 0;
                    autoScrollEnabled = 0;
                    autoScrollSpeed = -1;
                    autoScrollDelay = 5;
                    autoScrollRewind = 0;
                };
                colorBackground[] = 
                {
                    0,
                    0,
                    0,
                    0.8
                };
            };
            class DifficultyTitle: RscStructuredText
            {
                idc = 1107;
                text = "Difficulty"; 
                x = 0.854375 * safezoneW + safezoneX;
                y = 0.598 * safezoneH + safezoneY;
                w = 0.147656 * safezoneW;
                h = 0.042 * safezoneH;
                colorText[] = {1,1,1,1};
                colorBackground[] = {0,0,0,0};
                tooltip = "Choose a difficulty.";
                class Attributes
                {
                    font = "PuristaLight";
                    color = "#ffffff";
                    colorLink = "#D09B43";
                    shadow = 1;
                    size = 1;
                };
            };
            class DifficultyComboBox: RscCombo
            {
                idc = 2103;
                x = 0.928204 * safezoneW + safezoneX;
                y = 0.598 * safezoneH + safezoneY;
                w = 0.0639844 * safezoneW;
                h = 0.028 * safezoneH;
                colorBackground[] = 
                {
                    0,
                    0,
                    0,
                    0.8
                };
                class ComboScrollBar
                {
                    color[] = {1,1,1,1};
                    colorActive[] = {1,1,1,1};
                    colorDisabled[] = {1,1,1,0.3};
                    style = ST_MULTI + ST_NO_RECT;
                    thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
                    arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
                    arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
                    border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
                    shadow = 0;
                    scrollSpeed = 0.06;
                    width = 0;
                    height = 0;
                    autoScrollEnabled = 0;
                    autoScrollSpeed = -1;
                    autoScrollDelay = 5;
                    autoScrollRewind = 0;
                };
            };
            class ChooseGroupComboBox: RscCombo
            {
                idc = 2104;
                x = 0.89375 * safezoneW + safezoneX;
                y = 0.766 * safezoneH + safezoneY;
                w = 0.0639844 * safezoneW;
                h = 0.028 * safezoneH;
                class ComboScrollBar
                {
                    color[] = {1,1,1,1};
                    colorActive[] = {1,1,1,1};
                    colorDisabled[] = {1,1,1,0.3};
                    style = ST_MULTI + ST_NO_RECT;
                    thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
                    arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
                    arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
                    border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
                    shadow = 0;
                    scrollSpeed = 0.06;
                    width = 0;
                    height = 0;
                    autoScrollEnabled = 0;
                    autoScrollSpeed = -1;
                    autoScrollDelay = 5;
                    autoScrollRewind = 0;
                };
            };
            class GroupChooseTitle: RscStructuredText
            {
                idc = 1101;
                text = "Select your group"; 
                x = 0.854375 * safezoneW + safezoneX;
                y = 0.71 * safezoneH + safezoneY;
                w = 0.142734 * safezoneW;
                h = 0.042 * safezoneH;
                colorText[] = {1,1,1,1};
                colorBackground[] = {0,0,0,0};
                class Attributes
                {
                    font = "PuristaLight";
                    color = "#ffffff";
                    align = "center";
                    valign = "middle";
                    shadow = false;
                    shadowColor = "#000000";
                    size = "1";
                };
            };
            class MenuTitle: RscStructuredText
            {
                idc = 1108;
                text = "SETTINGS"; 
                x = 0.854375 * safezoneW + safezoneX;
                y = 0.15 * safezoneH + safezoneY;
                w = 0.142734 * safezoneW;
                h = 0.07 * safezoneH;
                colorText[] = {1,1,1,1};
                colorBackground[] = {0,0,0,0};
                class Attributes
                {
                    font = "PuristaBold";
                    color = "#ffffff";
                    align = "center";
                    valign = "middle";
                    shadow = false;
                    shadowColor = "#000000";
                    size = "2";
                };
            };
            class OPFORComboBox: RscCombo
            {
                idc = 2106;
                x = 0.209609 * safezoneW + safezoneX;
                y = 0.29 * safezoneH + safezoneY;
                w = 0.1575 * safezoneW;
                h = 0.028 * safezoneH;
                class ComboScrollBar
                {
                    color[] = {1,1,1,1};
                    colorActive[] = {1,1,1,1};
                    colorDisabled[] = {1,1,1,0.3};
                    style = ST_MULTI + ST_NO_RECT;
                    thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
                    arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
                    arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
                    border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
                    shadow = 0;
                    scrollSpeed = 0.06;
                    width = 0;
                    height = 0;
                    autoScrollEnabled = 0;
                    autoScrollSpeed = -1;
                    autoScrollDelay = 5;
                    autoScrollRewind = 0;
                };
                colorBackground[] = 
                {
                    0,
                    0,
                    0,
                    0.8
                };
            };
            class INDEPComboBox: RscCombo
            {
                idc = 2105;
                x = 0.632891 * safezoneW + safezoneX;
                y = 0.29 * safezoneH + safezoneY;
                w = 0.1575 * safezoneW;
                h = 0.028 * safezoneH;
                class ComboScrollBar
                {
                    color[] = {1,1,1,1};
                    colorActive[] = {1,1,1,1};
                    colorDisabled[] = {1,1,1,0.3};
                    style = ST_MULTI + ST_NO_RECT;
                    thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
                    arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
                    arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
                    border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
                    shadow = 0;
                    scrollSpeed = 0.06;
                    width = 0;
                    height = 0;
                    autoScrollEnabled = 0;
                    autoScrollSpeed = -1;
                    autoScrollDelay = 5;
                    autoScrollRewind = 0;
                };
                colorBackground[] = 
                {
                    0,
                    0,
                    0,
                    0.8
                };
            };
            class BLUFORComboBox: RscCombo
            {
                idc = 2107;
                x = 0.42125 * safezoneW + safezoneX;
                y = 0.234 * safezoneH + safezoneY;
                w = 0.1575 * safezoneW;
                h = 0.028 * safezoneH;
                class ComboScrollBar
                {
                    color[] = {1,1,1,1};
                    colorActive[] = {1,1,1,1};
                    colorDisabled[] = {1,1,1,0.3};
                    style = ST_MULTI + ST_NO_RECT;
                    thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
                    arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
                    arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
                    border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
                    shadow = 0;
                    scrollSpeed = 0.06;
                    width = 0;
                    height = 0;
                    autoScrollEnabled = 0;
                    autoScrollSpeed = -1;
                    autoScrollDelay = 5;
                    autoScrollRewind = 0;
                };
                colorBackground[] = 
                {
                    0,
                    0,
                    0,
                    0.8
                };
            };
            class OPFORTitle: RscStructuredText
            {
                idc = 1102;
                text = "OPFOR GROUP"; 
                x = 0.209609 * safezoneW + safezoneX;
                y = 0.22 * safezoneH + safezoneY;
                w = 0.1575 * safezoneW;
                h = 0.07 * safezoneH;
                colorText[] = {1,1,1,1};
                colorBackground[] = {0,0,0,0};
                tooltip = "Choose a East faction.";
                class Attributes
                {
                    font = "PuristaBold";
                    color = "#ff0000";
                    align = "center";
                    valign = "middle";
                    shadow = false;
                    shadowColor = "#000000";
                    size = "1.5";
                };
            };
            class BLUFORTitle: RscStructuredText
            {
                idc = 1109;
                text = "BLUFOR GROUP"; 
                x = 0.42125 * safezoneW + safezoneX;
                y = 0.164 * safezoneH + safezoneY;
                w = 0.1575 * safezoneW;
                h = 0.07 * safezoneH;
                colorBackground[] = {0,0,0,0};
                tooltip = "Choose a West faction.";
                class Attributes
                {
                    font = "PuristaBold";
                    color = "#00ffff";
                    align = "center";
                    valign = "middle";
                    shadow = false;
                    shadowColor = "#000000";
                    size = "1.5";
                };
            };
            class INDEPTitle: RscStructuredText
            {
                idc = 1110;
                text = "INDEP GROUP"; 
                x = 0.632891 * safezoneW + safezoneX;
                y = 0.22 * safezoneH + safezoneY;
                w = 0.1575 * safezoneW;
                h = 0.07 * safezoneH;
                colorText[] = {1,1,1,1};
                colorBackground[] = {0,0,0,0};
                tooltip = "Choose a Independent faction.";
                class Attributes
                {
                    font = "PuristaBold";
                    color = "#00ff00";
                    align = "center";
                    valign = "middle";
                    shadow = false;
                    shadowColor = "#000000";
                    size = "1.5";
                };
            };
        };
    };

     

     

    And here is my second file:
    menu.sqf

    Spoiler
    
    // Create camera
    _cam = "camera" camCreate (getPosATL arrow_cam_1);
    _cam cameraEffect ["internal", "back"];
    _cam camSetTarget arrow_cam_2;
    _cam setDir 0;
    _cam camSetFov 0.7;
    _cam camSetFocus [-1,-1];
    _cam camCommit 0;
    waitUntil{camCommitted _cam};
    
    createDialog "MenuScreen";
    
    private _arrayRandomTimes =
    [
    	["Day", "Start at random day times."],
    	["Night", "Start at random night times."],
    	["Random", "Start at any random time."]
    ];
    
    private _arrayRandomWeather =
    [
    	["Rain", "Weather is rain only."],
    	["Foggy", "Weather is foggy only."],
    	["Windy", "Weather is windy only."],
    	["Random", "Weather occurs randomly."]
    ];
    
    private _arrayRandomArt =
    [
    	0, 5, 10, 15, 20, 25, 30
    ];
    
    private _arrayDifficulty =
    [
    	["Easy", "AI are dumb."],
    	["Normal", "AI have default settings."],
    	["Veteran", "AI are terminators."]
    ];
    
    private _arrayGroups =
    [
    	["BLUFOR", "West faction."],
    	["OPFOR", "East faction."],
    	["INDEP", "Guerilla faction."]
    ];
    
    private _allFactionClasses = "true" configClasses (configFile >> "CfgFactionClasses");
    private _allOPFOR = [];
    private _allBLUFOR = [];
    private _allINDEP = [];
    
    {
    	private _factionName = configName _x;
    	private _side = getNumber (configFile >> "CfgFactionClasses" >> _factionName >> "side");
    	private _displayName = getText (configFile >> "CfgFactionClasses" >> _factionName >> "displayName");
    	private _icon = getText (configFile >> "CfgFactionClasses" >> _factionName >> "icon");
    
    	if(_displayName != "") then 
    	{
    		switch(_side) do 
    		{
    			case 0: { _allOPFOR pushBack [_displayName, _icon, _factionName]; };
    			case 1: { _allBLUFOR pushBack [_displayName, _icon, _factionName]; };
    			case 2: { _allINDEP pushBack [_displayName, _icon, _factionName]; };
    		};
    	};
    } forEach _allFactionClasses;
    
    private _ctrl = (findDisplay 0001) displayCtrl 2800;
    _ctrl cbSetChecked true;
    private _ctrl = (findDisplay 0001) displayCtrl 2801;
    _ctrl cbSetChecked true;
    
    {
    	private _ctrl = (findDisplay 0001) displayCtrl 2105;
    	private _index = _ctrl lbAdd (_x select 0);
    	_ctrl lbSetPicture [_index, (_x select 1)];
    	_ctrl lbSetData [_index, (_x select 2)];
    	_ctrl lbSetColor [_index, [0, 1, 0, 1]];
    } forEach _allINDEP;
    
    {
    	private _ctrl = (findDisplay 0001) displayCtrl 2106;
    	private _index = _ctrl lbAdd (_x select 0);
    	_ctrl lbSetPicture [_index, (_x select 1)];
    	_ctrl lbSetData [_index, (_x select 2)];
    	_ctrl lbSetColor [_index, [1, 0, 0, 1]];
    } forEach _allOPFOR;
    
    {
    	private _ctrl = (findDisplay 0001) displayCtrl 2107;
    	private _index = _ctrl lbAdd (_x select 0);
    	_ctrl lbSetPicture [_index, (_x select 1)];
    	_ctrl lbSetData [_index, (_x select 2)];
    	_ctrl lbSetColor [_index, [0, 1, 1, 1]];
    } forEach _allBLUFOR; 
    
    {
    	private _ctrl = (findDisplay 0001) displayCtrl 2100;
    	if(_x > 0) then {
    		private _index = _ctrl lbAdd str _x + " minutes";
    		lbSetTooltip [2100, _index, "Artillery occurs every " + str _x + " minutes."];
    	} else {
    		private _index = _ctrl lbAdd "No artillery";
    		lbSetTooltip [2100, _index, "Random artillery is disabled"];
    	};
    } forEach _arrayRandomArt;
    
    {
    	private _ctrl = (findDisplay 0001) displayCtrl 2101;
    	private _index = _ctrl lbAdd (_x select 0);
    	lbSetTooltip [2101, _index, (_x select 1)];
    } forEach _arrayRandomTimes;
    
    {
    	private _ctrl = (findDisplay 0001) displayCtrl 2102;
    	private _index = _ctrl lbAdd (_x select 0);
    	lbSetTooltip [2102, _index, (_x select 1)];
    } forEach _arrayRandomWeather;
    
    {
    	private _ctrl = (findDisplay 0001) displayCtrl 2103;
    	private _index = _ctrl lbAdd (_x select 0);
    	lbSetTooltip [2103, _index, (_x select 1)];
    } forEach _arrayDifficulty;
    
    {
    	private _ctrl = (findDisplay 0001) displayCtrl 2104;
    	private _index = _ctrl lbAdd (_x select 0);
    	lbSetTooltip [2104, _index, (_x select 1)];
    	switch((_x select 0)) do 
    	{
    		case "BLUFOR": { lbSetColor [2104, _index, [0,1,1,1]]; }; 
    		case "OPFOR": { lbSetColor [2104, _index, [1,0,0,1]]; }; 
    		case "INDEP": { lbSetColor [2104, _index, [0,1,0,1]]; }; 
    	};
    } forEach _arrayGroups;
    
    lbSetCurSel [2105, 0];
    lbSetCurSel [2106, 0];
    lbSetCurSel [2107, 0];
    lbSetCurSel [2100, 2];
    lbSetCurSel [2101, 2];
    lbSetCurSel [2102, 3];
    lbSetCurSel [2103, 1];
    lbSetCurSel [2104, 0];
    
    private _ctrl = (findDisplay 0001) displayCtrl 2800;
    _ctrl ctrlSetChecked true;
    private _ctrl = (findDisplay 0001) displayCtrl 2801;
    _ctrl ctrlSetChecked true;
    
    waitUntil{!dialog};
    _cam cameraEffect ["terminate", "back"];
    camDestroy _cam;

     


    Any help would be appreciated.


  13. 6 minutes ago, pierremgi said:
    
    private _size =  worldSize;
    private _columnsAmount = 8;
    private _middleHeight = _size/2;
    private _width =  _size/_columnsAmount;
    private "_marker";
    for "_i" from 1 to _columnsAmount do  {
       _marker = createMarker ["Column_" + str _i, [_width* (-0.5+_i),_middleHeight]];
       _marker setMarkerSize [_width/2,_middleHeight];
       _marker setMarkerShape "rectangle";
       _marker setMarkerColor selectRandom ["ColorRed", "ColorYellow", "ColorBlue", "ColorGreen", "ColorPink"];
       _marker setMarkerAlpha 0.5;  
    };

     

    Thank you, I appreciate it.


  14. Update:

     

    I managed to get it working, but one more issue:

    Spoiler
    
    _path = configfile >> "cfgworlds" >> worldname;
    _size = getnumber (_path >> "mapSize");
    
    _columnsAmount = 8;
    _columnWidth = _size / _columnsAmount;
    _xOffset = (_size - (_columnsAmount * _columnWidth)) / 2;
    _yOffset = _size / 2;
    
    for "_i" from 1 to _columnsAmount do 
    {
    	_xCrd = (_i - 0.5) * _columnWidth + _xOffset;
    	_marker = createMarker ["Column_" + str _i, [_xCrd, _yOffset]];
    	_marker setMarkerSize [_columnWidth, _size];
    	_marker setMarkerShape "rectangle";
    	_marker setMarkerColor selectRandom ["ColorRed", "ColorYellow", "ColorBlue", "ColorGreen", "ColorPink"];
    	_marker setMarkerAlpha 0.5;
    };

     

     

    I've added a picture below to show that the column markers extend beyond the map above and below, is there any way I can adjust to the exact size of the map?

    https://imgur.com/a/DDVhBmf


  15. Hello, I am trying to split the map into columns and create a marker representing each column.

     

    My script is working, but its not working as intended, the columns are not positioned correctly.

    _path = configfile >> "cfgworlds" >> worldname;
    _size = getnumber (_path >> "mapSize");
    _size = _size / 2;
    _center = [_size,_size,0];
    
    _columnsAmount = 8;
    _xCrd = _size / _columnsAmount;
    _add = _size / _columnsAmount;
    
    _middleHeight = _size / 2;
    
    for "_i" from 1 to _columnsAmount do 
    {
    	_marker = createMarker ["Column_" + str _i, [(_xCrd/2), _middleHeight]];
    	_marker setMarkerSize [_xCrd/2, _size];
    	_marker setMarkerShape "rectangle";
    	_marker setMarkerColor selectRandom["ColorRed", "ColorYellow", "ColorBlue", "ColorGreen", "ColorPink"];
    	_marker setMarkerAlpha 0.5;
    
    	_xCrd = _xCrd + _add;
    };

     


  16. 5 minutes ago, Harzach said:
    
    str (selectRandom [_aafUnits])

    You are string-ing a string and array-ing an array.

    
    selectRandom _aafUnits

    You also used the local var "_marker" twice. With a few tweaks, your original works fine (your newer version does not avoid re-using houses/house positions):

    
    private _marker = _this select 0; 
    private _markerSize = ((getMarkerSize _marker) select 0);
    private _markerPos = getMarkerPos _marker;
    
    private _aafUnits = 
    [
    	"I_Soldier_A_F",
    	"I_Soldier_AR_F",
    	"I_Soldier_exp_F",
    	"I_Soldier_GL_F",
    	"I_Soldier_M_F",
    	"I_Soldier_F",
    	"I_Soldier_LAT2_F"
    ];
    
    private _nearbyBuildings = nearestObjects [_markerPos, ["House"], _markerSize];
    private _housesSelected = [];
    
    {
    	private _object = typeOf _x;
    	private _hasKeyword = false;
    
    	if (isClass (configFile >> "CfgVehicles" >> _object)) then
    	{
    		{ if (_object find _x > -1) then { _hasKeyword = true; }; } forEach ["House", "Building", "Shop", "Shed"];
    		if (_hasKeyword) then { _housesSelected pushBack _x; };
    	};
    } forEach _nearbyBuildings;
    
    private _amount = floor (count _housesSelected / 2);
    private _housesChosen = [];
    
    for "_i" from 1 to _amount do
    {
    	private _house = selectRandom _housesSelected;
    	_housesChosen pushBack _house;
    	_housesSelected = _housesSelected - [_house];
    };
    
    { 
    	private _grp = createGroup independent;
    	private _type = selectRandom _aafUnits;
    	private _unit = _grp createUnit [_type, [0,0,100], [], 0, "NONE"]; 
    	_unit setPos (selectRandom (_x buildingPos - 1)); 
    	_unit setDir (random 360); 
    
    	private _name = format ["BuildingMarker%1", _forEachIndex];
    	private _mkr = createMarkerLocal [_name, _unit]; 
    	_mkr setMarkerShapeLocal "ICON"; 
    	_mkr setMarkerTypeLocal "mil_dot"; 
    	_mkr setMarkerColor "ColorRed";
    } forEach _housesChosen;

    There is likely room for streamlining/optimization, but this tests fine.

    It works great, I appreciate it.

     

    Could you give me some sources to optimize code? Or some advice?


  17. 1 hour ago, mrcurry said:

    You sure about those classnames? BIS have a tendency to end their official classes with "_F"

     

    You can get the classes by:

    1. Place the units in the editor

    2. Select them all and right click one of them

    3. Click Log > Classes to clipboard

    4. Open your favorite text editor or the debug console and paste the contents there.

     

    If that's not it then start printing debug message with either systemChat, hint or diag_log to find where it brakes.

    Yes, that was stupid of me to not check the classes. I fixed it since but it still doesn't work.

     

    Here is my script.

    Spoiler
    
    _marker = _this select 0;
    _markerSize = ((getMarkerSize _marker) select 0);
    _markerPos = getMarkerPos _marker;
    
    _aafUnits = 
    [
        "I_Soldier_A_F",
        "I_Soldier_AR_F",
        "I_Soldier_exp_F",
        "I_Soldier_GL_F",
        "I_Soldier_M_F",
        "I_Soldier_F",
    	"I_Soldier_LAT2_F"
    ];
    
    _nearbyObjects = nearestObjects [_markerPos, ["House"], _markerSize];
    _housesArray = [];
    
    {
    	_object = typeOf _x;
    	_hasKeyword = false;
    
    	if (isClass (configFile >> "CfgVehicles" >> _object)) then
    	{
    		{ if (_object find _x > -1) then { _hasKeyword = true; }; } forEach ["House", "Building", "Shop", "Shed"];
    		if (_hasKeyword) then { _housesArray pushBack _x; };
    	};
    } forEach _nearbyObjects;
    
    _amount = (count _housesArray) / 2;
    
    for "_i" from 1 to _amount do
    {
    	_house = selectRandom _housesArray;
    	_housePos = (selectRandom (_house buildingPos -1)); // Get random position inside building
    
    	_group = createGroup [resistance, true];
    	_classUnit = str (selectRandom [_aafUnits]);
    
      	// _unit = _group createUnit [_classUnit, _housePos, [], 0, "NONE"];
      
      	// Spawn marker on every unit created
    	_marker = createMarker ["Marker_Unit_" + str _i, getPos _unit];
    	_marker setMarkerType "hd_dot";
    	_marker setMarkerAlpha 1;
    	_marker setMarkerColor "ColorRed";
    
    	_housesArray = _housesArray - [_house]; 
    };

     

     


  18. Hello,

     

    I created a script to spawn an AI in every building near the location with a marker on that unit. 

     

    The problem is that the AI is not spawning and I don't see any markers on the map.

     

    Here is my script:

    _marker = _this select 0;
    _markerSize = ((getMarkerSize _marker) select 0);
    _markerPos = getMarkerPos _marker;
    
    _aafUnits = 
    [
        "AAF_Soldier",
        "AAF_Soldier_GL",
        "AAF_Soldier_AR",
        "AAF_Soldier_AT",
        "AAF_Soldier_Medic",
        "AAF_Sniper"
    ];
    
    _nearbyBuildings = nearestObjects [_markerPos, ["House"], _markerSize];
    _housesSelected = [];
    
    {
    	_object = typeOf _x;
    	_hasKeyword = false;
    
    	if (isClass (configFile >> "CfgVehicles" >> _object)) then
    	{
    		{ if (_object find _x > -1) then { _hasKeyword = true; }; } forEach ["House", "Building", "Shop", "Shed"];
    		if (_hasKeyword) then { _housesSelected pushBack _x; };
    	};
    } forEach _nearbyBuildings;
    
    _amount = floor (count _housesSelected / 2);
    _housesChosen = [];
    
    for "_i" from 1 to _amount do
    {
    	_house = selectRandom _housesSelected;
    	_housesChosen pushBack _house;
    	_housesSelected = _housesSelected - [_house];
    };
    
    hint str _housesChosen;
    
    {
    	_unit = (createGroup INDEPENDENT) createUnit [str (selectRandom [_aafUnits]), getPos _x, [], 0, "none"];
    	_unit setPos (selectRandom (_x buildingPos - 1));
    	_unit setDir (random 360);
    
    	_marker = createMarkerLocal [format ["BuildingMarker%1", _forEachIndex], _unit];
    	_marker setMarkerShapeLocal "ICON";
    	_marker setMarkerTypeLocal "mil_dot";
    } forEach _housesChosen;

     


  19. I'd like to make a comment that also if I wanted to incorporate rendering BIS_fnc_showSubtitle with BIS_fnc_kbTell function, the subtitles doesn't appear.

     

    Here is the intro.bikb

    class Sentences
    {
    	class Sentence1
    	{
    		text = "";
    		textPlain = "Test1";
    		speech[] = { "\Sounds\thunder.ogg" };
    		class Arguments {};
    		actor = "nic";
    	};
    	class Sentence2
    	{
    		text = "";
    		textPlain = "Test2";
    		speech[] = { "\Sounds\thunder.ogg" };
    		class Arguments {};
    		actor = "william";
    	};
    	class Sentence3
    	{
    		text = "";
    		textPlain = "Test3";
    		speech[] = { "\Sounds\thunder.ogg" };
    		class Arguments {};
    		actor = "nic";
    	};
    };
    
    class Arguments {};
    class Special {};
    startWithVocal[] = { hour };
    startWithConsonant[] = { europe, university };

     


  20. Hello, I'm making a singleplayer scenario. And I'm using the conversations system in A3 for AI and the player to interact with each other.

     

    This is my intro.bikb file

    Spoiler
    
    class Sentences
    {
    	class Sentence1
    	{
    		text = "Test1";
    		speech[] = { "\Sounds\thunder.ogg" };
    		class Arguments {};
    		actor = "nic";
    	};
    	class Sentence2
    	{
    		text = "Test2";
    		speech[] = { "\Sounds\thunder.ogg" };
    		class Arguments {};
    		actor = "william";
    	};
    	class Sentence3
    	{
    		text = "Test3";
    		speech[] = { "\Sounds\thunder.ogg" };
    		class Arguments {};
    		actor = "nic";
    	};
    };
    
    class Arguments {};
    class Special {};
    startWithVocal[] = { hour };
    startWithConsonant[] = { europe, university };

     

     

    And here is my description.ext file

    Spoiler
    
    class CfgSentences
    {
    	class Beginning
    	{
    		class Introduction
    		{
    			file = "conv\intro.bikb";
    			#include "conv\intro.bikb"
    		};
    	};
    };

     

     

    However, when I type this function below, there is no audio for the conversation, but the lips syncing works and subtitles appear and they go in order and start one after the another when the audio finishes, except, there's no audio or noise, it's just silent.

    I suppose it recognizes the audio and is playing it, but there's no noise. 

    ["Introduction", "Beginning"] call BIS_fnc_kbTell;

    Any help?

    EDIT: William is the player and the audio works when I use playSound or any other function to play the .ogg file.
     

×