Jump to content

scottb613

Member
  • Content Count

    731
  • Joined

  • Last visited

  • Medals

Posts posted by scottb613


  1. Hi Folks,

     

    Probably a basic question - why can't I use "_this" or "this" in a script - I get undefined variable.

     

    I have an init field on a vehicle:

    execVM "initBucks.sqf";

    and then if I try to use "this" or "_this" in the intiBucks.sqf - - - as simply as:

    _veh = _this;

    I get "_this is undefined".

     

    I'm trying to get away from having to name every single vehicle in a mission (and testing for said name) - so I can have a generic script - yet still do work on the individual vehicle calling the script.

     

    Thanks.

     

    Regards,
    Scott


  2. 5 hours ago, johnnyboy said:

    This makes sense and is a good idea, but its the module doing it.  I could add a CBA option to disable it entirely.  Note that the module drives their talking based on behavior.  So if the units are set to Stealth, they whisper infrequently.  If they are Careless or Aware and not in Combat, then they chatter.  So what you hear is dependent on the mission maker's behavior choices.

     

    I could do something where I dynamically turn the module off when player squad in stealth mode, and near Dac Cong enemy.  Then turn it back on if Combat, or no longer near Dac Cong.  But not a priority for me really.  Or this is something you could script and execute from console when playing a mission.

     

    Hi JB,

    No worries on the chatty OPFOR - just thinking about the experience as a whole. I spend most of my time in sandbox mode with the OPFOR populated by ALiVE or Drongo's Map Population Tools. So - I am the guilty party - LOL.
    🙂

     

    The "Take Point" is simply a [Select Scout & SOG_AI Move]. Pie In The Sky - it would be nice to have the function a bit more autonomous - ranging out in front and freezing when an enemy is detected - to report back. We definitely don't want to lose the existing [SOG_AI File] formation for getting out of Dodge. I know your options are limited by the buttons on the wheel interface.

     

    As for additional keystrokes for any new functions - the actual keystrokes matter little to me - as I just set them up in VA.

     

    If you ever need any help setting up VA - just holler - I'm pretty familiar with it and have used it on numerous applications for years. The built in Macro Language is pretty powerful and can do many things well - including actual Mouse Macros. I noticed on one of your videos you had a little trouble with the voice recognition - while it works surprisingly well - some words are easier to recognize - especially when you start speaking faster in the heat of battle - a little trial and error helps. I did so some of the training sessions to aid with the voice recognition.

     

    I'll leave the videos to the more talented among us - a man needs to know his limitations.
    😉

     

    When coding - you might want to try opening a Chat GPT window - as an aid when needed. In addition - to understanding ArmA scripting - to a degree - you can do many things - like when working on a problematic piece of code - feed it your program and tell it to edit the script and print and log every variable value to the clipboard. If you have a large number of variables - it's pretty handy. The uses seem endless. YMMV.

     

    Too funny - when I saw your "Burn this Hooch" video - I immediately thought of an old Oingo Boingo tune - "Only a Lad" (probably before your time - 80's)...

     

    Your new theme song: 

     

     

    Quote

    Johnny was bad, even as a child everybody could tell
    Everyone said, "If you don't get straight, you'll surely go to Hell!"
    But Johnny didn't care
    He was an outlaw by the time that he was ten years old
    He didn't wanna do what he was told
    Just a prankster - A juvenile gangster
    His teachers didn't understand, they kicked him out of school
    At a tender early age just because
    He didn't want to learn things
    Had other interests - He liked to burn things

     

    Here's my updated VA functions - everything tested:

     

    Link to Profile: https://mega.nz/file/g950nBzQ#FCC2UEoNNsocPY5i_Nm_Ba5Vu0Lp_WvZqTybMhvj9z4

     

    Capture.jpg

     

     

    Again - many thanks for all you do. 

     

    Regards,
    Scott
     

    • Thanks 1
    • Haha 1

  3. Hi JB,

     

    Man - this just keeps on getting better - I've been hitting my infantry squad tactics pretty hot and heavy with SOG_AI combined with Voice Attack. If it's all about immersion - this combo can't be beat. Your AI squad is actually an asset to the mission now.


    A couple things not everyone might notice:

     

    You can give [SOG_AI Move] commands down to the Unit level - which is handy. When out on maneuvers - say "Sniper Go" [Select Sniper & SOG_AI Move] and my sniper is immediately off and running for a good perch to snipe from. Same - if I want to setup my heavy machine gunner in an equally advantageous position. Say "Take Point" [Select Scout & SOG_AI Move] - and my assigned Scout is running out front to make sure the path is clear. You have to assign which unit is which at the start of a mission and VA remembers: [Select Unit & say "Assign Sniper"].

     

    The other great thing about SOG_AI is you can setup a defensive line and hold it - [SOG_AI Line and SOG_AI Halt].  Sometimes it's a little difficult to get the squad line orientated in the desired direction to repel an attack. It seems the player needs to move in the proper direction to get the squad lined up. Really comes in handy.

     

    I also added some compound commands such as "Squad Patrol" which does [SOG_AI Silence & SOG_AI File & SOG_AI Follow Me] and "Squad Attack" which does [SOG_AI Line & SOG_AI Follow Me]. Really helpful especially in the heat of battle. All the individual SOG_AI commands are still available.

     

    Just curious - would it be possible to add some of the remaining action menu commands to the "T" key assignments? Less menus = more immersion. Stuff like "Place a Charge". 

     

    In general - for the SOG CDLC - it seems the REDFOR is always blabbing and seldom surprises you - while the talking should get less the more disciplined the troops - VC - to PAVN - to SPECOPS. I don't want it eliminated (definitely adds to immersion) - realizing you can completely disable voices with an included module - just reduced so you get some nasty surprises. 

     

    I've updated my VA profile accordingly - I'll post a new link when I get it cleaned up. I had mistakenly added commands by team (red & green) for [SOG_AI Halt] and [SOG_AI Follow Me] - that only work on the squad level.

     

    Just my two cents - please take it for what it's worth.

     

    THANK YOU for all your hard work.

     

    Back to drilling on the grinder - practicing for the next real mission...

    😉

     

    Regards,

    Scott

    • Like 3

  4. On 9/8/2023 at 11:26 AM, billz4money said:

    Hi, So Im trying out the New Spearhead DLC with IFa3 and the AI is Like Refusing to Drive completely. is it this Mod? 

     

    Hi Folks,

     

    I usually disable Lambs in vehicles and aircraft with the following in each of the crews "init field":

     

    this setVariable ["lambs_danger_disableAI", true];

     

    Regards,
    Scott

    • Like 1

  5. Hi Folks,

     

    RE: Missions - http://alivemod.com/missions

     

    (SP) with SOG AI.

     

    Anyone play the ALiVE official mission Paper Hands? What am I supposed to destroy at the first task - Ammo Cache? I made it there - eliminated the enemy and left a breaching charge on the crate at the location - Task never completed.

     

    I can't believe I've never played these (4) official missions before.

     

    Thanks.

     

    Regards,

    Scott

     

     


  6. Hi Folks,

     

    Resolved - I needed to move the add action to each squad member. The add action line needed is commented in the code:

     

    //SCOunitDel.sqf
    //Insert the following into [Init Field] of AI squad members to delete unit when it runs AMOK.
    
    //this assignteam "RED"; this addAction ["<t color='#00FFFF'>Unit Del</t>","Scripts\SCOunitDel.sqf","ALL",1.5,true,true,"","true",3];
    
    // Test to see if global group "deadPool" exists - if not - create it.
    if (isNil "deadPool") then {
        deadPool = createGroup west; // Create the group if it doesn't exist
    } else {
        // Group already exists, you can use it
    };
    
    // Get the selected unit into array
    _unitArr = [_this];
    
    // Get the selected unit
    _unit = _this select 0;
    
    // Add the units to the new group
    [_unitArr] join deadPool;
    	
    // Max out the unit's damage to disable it
    _unit setDamage 1;
    
    // Display contents of _unit
    hint format ["Kill %1", _unit];

     

    Regards,
    Scott


  7. Hi Folks,

     

    I'm trying to get the hang of editing (SP) scrolling Action Menu.

     

    I tried placing this in the players init - to simply call a script (just removes defective AI from player group).

    _actionText = "<t color='#FF0000'>Remove AI</t>"; 
    _actionExpression = "execVM 'Scripts\SCOremove.sqf'"; 
    player addAction [_actionText, _actionExpression, [], -1, true, true, ""]; 

    The addAction shows up fine and will execute the script - however - I need to have AI units selected as input for the script. As soon as I select some units the addAction menu item vanishes. 

     

    Thanks.

     

    Regards,
    Scott


  8. Hi Folks,

     

    Yep - it usually takes a little time - but if you keep feeding it your error messages - it seems to get there eventually.

     

    Script to Teleport AI Squad Members - to "unstick" them.

     

    // Define your AI squad's group
    _mySquad = units group player; // Change 'player' to the leader of your squad if needed
    
    // Loop through all units in the squad
    {
        _unit = _x;
    
        // Check if the unit is AI and a member of the squad
        if (!isPlayer _unit && _unit in _mySquad) then {
            // Calculate the distance between the player and the AI unit
            _distance = player distance _unit;
    
            // Check if the distance is greater than 75 meters
            if (_distance > 75) then {
                // Teleport the AI unit to a random location within 10 meters of the player
                _teleportPosition = player modelToWorld [10 * (random 2 - 1), 10 * (random 2 - 1), 0];
                _unit setPos _teleportPosition;
            }
        }
    } forEach _mySquad;

     

    Works like a champ - all ChatGPT - on about the 3rd try - after feeding it thrown errors from previous iterations.

     

    At least it seems to get you in the ballpark - great for learning how to script - - - AND it comments the code.

     

    I use ChatGPT for Blender Python scripts as well.

     

    Regards,
    Scott

     

     

     


  9. Hi Folks,

     

    Resolved - by the man - the myth - the legend - Drongo graciously responded to my request for help.

     

    Quote

    Hey man, how goes?

     

    DMP doesn't support custom loadouts, to attempt to do so would require a lot more scripting and create some other problems. To get around this issue, use the Init (Men) field in the Define Faction module. Put a script in your mission folder like "Scripts\Custom.sqf". In the script do something like:

    private _man=_this;
    if (_man isKindOf "UNIT_CLASSNAME_???")then{
        _man addUniform "UNIFORM_CLASSNAME";
        // add weapons etc here
    };

    WIth DCG, have you manually installed the .DLLs that come with it? It is impossible for me to install those via steam workshop, they have to be manually copied across. You can navigate to the required files by right-clicking on the mod in the Arma launcher. The folder is called "z  Copy contents to Arma 3 directory".

     

    Let me know if there are any other problems.

     

    Have a good one!

     

    Cheers,

     

    Drongo

     

     

    Regards,

    Scott


  10. Hi Folks,

     

    I see Drongo has another application to build factions "Drongo's Config Generator" - tried that as well - but it doesn't seem to write out the config file (.cpp) even though the system gives the message that it properly did so. I see multiple comments in Steam reporting the same issue - without answer. I guess it may have been broken in an update of ArmA.

     

    Regards,
    Scott


  11. Hi Folks,

     

    One more question - I'm pretty familiar with Drongo's Map Population Modules. I'm using the [Define Faction] module - - - which works fine as long as I'm placing down existing units. When I take the time to try and to customize the loadouts and uniforms with the Arsenal - then start the game - the units revert to their native loadouts and uniforms (I get CSAT uniforms when I should have CUP/CWRIII uniforms as defined in the editor). I know some factions have scripts to randomize them - while I started with CWRIII units - I went back to vanilla units and the same problem persists. I didn't think vanilla used randomization scripts.

     

    How do I get my custom loadout and uniform changes to stick - when I actually run the mission?

     

    Just thought of this - could it be the ACE Arsenal creating the issue? Perhaps I should try the BI Arsenal.

     

    Thanks.

     

    Regards,
    Scott


  12. Hi Folks,

     

    RE: 1980's Spanish Carribean/South or Central American Faction

     

    Operation Urgent Fury

     

    Anyone know of a good faction to represent what I have in my title?

     

    Preferably CUP based - ideal would be Grenada or Cuba.

     

    I've checked the Community Factions Project - they have some appropriate factions listed but it appears they were never completed.

     

    I tried 9CAG - which has appropriate factions defined however the units load with vanilla uniforms - while other factions in this mod seem to have appropriate uniforms - seems hit or miss.

     

    Thanks.

     

    Regards,

    Scott


  13. Hi Folks,

     

    Can't play ArmA without SOG_AI anymore - thanks Johnny...

     

    Just posting my Voice Attack profile that has been updated for SOG_AI. I no longer use the wheel menu. If new to VA - you can just copy the commands listed here into any of your own profiles - saving yourself a little time. I included my full profile just for reference and/or inspiration. To use VA you don't even need to use voice - if preferred - you can assign commands to any joystick button and/or keyboard shortcut. I'm not affiliated with VA other than being a very happy customer.

     

    Voice Attack Profile:

    https://mega.nz/file/dlpBHBIb#JzU0lE7OkwHW7RX0SJQQCNGQrPgWD9-vrb178_ahk0M

     

    Capture.jpg

     

    Regards,
    Scott

     

     

    • Like 1
    • Thanks 2

  14. Hi Folks,

     

    Works like a champ - I had to make one small edit though and remove my tag line from the header - as that would be pure plagiarism on my part - LOL. 

    😉

     

    I did split the weapon string (different source) and that worked without the annoying extra quote - odd.

     

    Nicely done - sir. I'll try to put it to good use and use your fine example in my other projects.

     

    Thank you and everyone that helped me here.

     

    Regards,

    Scott

    • Like 1

  15. 55 minutes ago, Larrow said:
      Hide contents
    
    
    // SCOsquadStatus.sqf
    
    private _hint = "";
    
    _fnc_stringPadding = {
    	params[
    		[ "_string", "", [ "", 0 ] ],
    		[ "_numDigits", 0, [ 0 ] ]
    	];
    	
    	if ( _string isEqualType 0 ) then {
    		_string = str _string;
    	};
    	
    	private _padding = "000";
    	
    	_padding select[ 0, _numDigits - count _string ];
    };
    
    _fnc_getUnitPositionId = {
    	params[ "_unit" ];
    	
    	private _vvn = vehicleVarName _unit;
    	_unit setVehicleVarName "";
    	private _str = str _unit;
    	_unit setVehicleVarName _vvn;
    	_str select[ (_str find ":") + 1 ]
    };
    
    {
    	//Unit Info
    	_x params[ "_unit" ];
    		
    	//Get weapon display name
    	private _priWeapon = primaryWeapon _unit;
    	private _priWeapDisplayName = getText( configFile >> "CfgWeapons" >> _priWeapon >> "displayName" );
    	
    	//Get unit health
    	private _health = round ((1 - damage _unit) * 100);
    	_health = format[ "%1%2", [ _health, 3 ] call _fnc_stringPadding, _health ];
    	
    	//Count Primary Weapon Magazines
    	private _compMags = compatibleMagazines _priWeapon;
    	private _magCnt = { _x in _compMags }count magazines _unit;
    	_magCnt = format[ "%1%2", [ _magCnt, 2 ] call _fnc_stringPadding, _magCnt ];
    	
    	//Get unit formation position
    	_unitFormPos = [ _unit ] call _fnc_getUnitPositionId;
    	_unitFormPos = format[ "%1%2", [ _unitFormPos, 2 ] call _fnc_stringPadding, _unitFormPos ];
    			
    	// Format Output
    	_hint = format[ "%1<t align='center'>%2 || Fit: %3 || Mag: %4 || Wep: %5</t><br/>", _hint, _unitFormPos, _health, _magCnt, _priWeapDisplayName ];
    		
    }forEach units player;
    
    // Display Status
    hint parseText _hint;

     

     

     

    Hi Folks,

     

    Thank you again as well. Hah - I know I'm not much of a coder and my solutions aren't very elegant. Seeing better ways of coding is very helpful and appreciated. Let me play with this as well and see if I can grasp all of what you're doing.

    🙂

     

    Regards,
    Scott


  16. Hi Folks,

     

    Thanks - I'll give that a shot. I've found that when using "heal and revive" scripts the unit numbers and team assignments are lost on occasion - needing me to reevaluate the number assignments periodically.

     

    27 minutes ago, Ibragim A said:

    Try by this way:

    
    getUnitPositionId = 
    {
    	private ["_vvn", "_str"];
    	_vvn = vehicleVarName _this;
    	_this setVehicleVarName "";
    	_str = str _this;
    	_this setVehicleVarName _vvn;
    	parseNumber (_str select [(_str find ":") + 1])
    };
    
    _id = _unit call getUnitPositionId;

     

     

    Regards,
    Scott


  17. 1 hour ago, awdsawds said:

     

    Really? Is that interesting! What about the famous air battles in Mig Alley?

    They fought the Migs quite often. So the game should include some sort of air battle. Otherwise only an idiot creates useless planes when there are no missions for them.

     

    Mig Alley was in the Korean War up near the Yalu River - wrong war - buddy. Sometimes it's far better to remain silent...

     

    Regards,
    Scott

    • Like 2
    • Haha 1

  18. Hi Folks,

     

    I've updated my script based on the help I've gotten here. It's working pretty well from my perspective.

     

    Two more questions come to mind.

     

    Question: Is there a way to get the unit number assigned to a unit in the HUD (1,2,3,4 for F1, F2, F3, F4 respectively)? 

     

    Question: I split the "weapon" variable via [splitString] as most of the info I didn't feel was needed in the display. For SOG - I just needed field 1 as their weapon syntax made it pretty easy. The issue is that [splitString] introduced a trailing quote on my status display and I don't know how to remove it. It's not impacting the output very much - just irksome.

     

    Updated Script

    Spoiler
    
    // SCOsquadStatus.sqf
    
    private _unitArr = units player;
    private _hintStr = "";
    private _unitCnt = 1;
    private _unitCntStr = "";
    private _healthStr = "";
    
    {
    	//Unit Info
    	private _unit = _x;
    	private _health = round ((1 - damage _unit) * 100);
    	private _weapPri = primaryWeapon _unit;
    	private _weapPriStr = (str _weapPri splitstring "_") select 1;
    	private _magUnit = magazines _unit;
    	private _magCompArr = compatibleMagazines _weapPri;
    	private _magCnt = 0;
    	private _magCntStr = "";
    	
    	// Count Primary Weapon Magazines
    		{
    			if (_x in _magCompArr) then {_magCnt = _magCnt + 1};	
    		} foreach _magUnit;
    		
    		// Pad Zero Mag
    		if (_magCnt < 10) then
    		{
    			_magCntStr = format ["0%1", _magCnt];
    		}
    		else
    		{
    			_magCntStr = _magCnt;
    		};
    	
    	// Pad Zero Unit
    	if (_unitCnt < 10) then
    	{
    		_unitCntStr = format ["0%1", _unitCnt];
    	}
    	else
    	{
    		_unitCntStr = _unitCnt;
    	};		
    		
    	// Format Output - Pad Zero Health
    	if (_health == 100) then
    	{
    		_healthStr = format ["%1", _health];
    		private _logger = format ["<t align='center'>%1  ||  Fit:%2  ||  Mag:%4  ||  Wep:%3</t><br/>", _unitCntStr, _healthStr, _weapPriStr, _magCntStr];
    		_hintStr = _hintStr + _logger;
    	};
    	
    	if ((_health < 100) and (_health >= 10)) then
    	{
    		_healthStr = format ["0%1", _health];
    		private _logger = format ["<t align='center'>%1  ||  Fit:%2 ||  Mag:%4  ||  Wep:%3</t><br/>", _unitCntStr, _healthStr, _weapPriStr, _magCntStr];
    		_hintStr = _hintStr + _logger;
    	};
    	
    	if (_health < 10) then
    	{
    		_healthStr = format ["00%1", _health];
    		private _logger = format ["<t align='center'>%1  ||  Fit:%2  ||  Mag:%4  ||  Wep:%3</t><br/>", _unitCntStr, _healthStr, _weapPriStr, _magCntStr];
    		_hintStr = _hintStr + _logger;
    	};
    	
    	//Increment Unit
    	_unitCnt = _unitCnt + 1;
    	
    } foreach _unitArr;
    
    // Display Status
    hint parseText _hintStr;
    sleep 10;
    hint parseText _hintStr;

     

     

    Thanks...

     

    Regards,
    Scott

×