Jump to content

juleshuxley

Member
  • Content Count

    72
  • Joined

  • Last visited

  • Medals

Posts posted by juleshuxley


  1. I see red, green and blue items, some of them at indentation levels.
    I can use getText in a script to retrieve red items.
    getText when used on a green item just returns an empty string.
    Blue items can always be retrieved, but getArray has to be used.

    What do the colors and indentation mean? And how do I retrieve a green item? I'm guessing it's to do with inheritance but I'd appreciate an encompassing answer. And the best way to get a green item.

    Currently trying to get reloadTime for a weapon and all I get is an empty string:
     

    getText(configfile >> "CfgWeapons" >> "CUP_optic_LeupoldMk4_20x40_LRT" >> "reloadTime"); // ""

     


  2. _name = getText(configfile >> "CfgWeapons" >> "CUP_optic_LeupoldMk4_20x40_LRT" >> "displayName");
    
    _reloadTime = getText(configfile >> "CfgWeapons" >> "CUP_optic_LeupoldMk4_20x40_LRT" >> "reloadTime");
    
    _name; // "Leupold Mark 4 6.5-20x50mm LR/T"
    _reloadTime; // ""

    Attempting to retrieve reloadTime results in an empty string?

    reload.png

    reloadTime is most definitely in the config, unless the indentation or colors mean something?

    Update,  just realised displayName is red and unindented I'm guessing that's something to do with it...


  3. If I want to get the active weapon of a vehicle's primary turret ("gunner" position) I simply do this:

    _weaponClass = currentWeapon (vehicle player);

    However, how am I meant to get the active weapon of a non-primary turret such as the commander turret?
    commanderrr.png


    I've got a feeling it's not possible. I am irritated and gobsmacked. There are literally no commands to get the current weapon for a non primary turret. No way to get "M2" in that image into a variable. I'm so annoyed. Arma has this big API that makes you think your idea is possible, then it has these random holes that makes your idea impossible. Thinking of giving up modding and just developing full games, fed up being at the mercy of some patchy API. So annoyed as I am half way through a mod that requires knowing what the current weapon is for the non primary turret. What a waste of ***** time.

    Surely there's a way to get the weapon a unit is controlling? Surely? The weapon class is right there on the **** screen, M2.


  4. I'm trying to make a minimalist UI. I've had some success but one thing I'm struggling with is recreating the "waiting for the next round" bar. You know, this thing:

    barrrrr.png

    My UI is constantly getting refreshed in a while loop, so I was hoping I could query if a certain weapon was ready to fire. Functions such as CanFire and WeaponState unfortunately didn't give me what I wanted and are misleadingly named.

    So is there a function I've missed that  can query the weapon state i.e ready to fire, not ready to fire?

    Failing that, where is the m256's "time taken for next round to be loaded" set? In a config? What attribute am I looking for? Can I use getText to extract it to a variable in my script? If it's listed in seconds somewhere in the config I could use an event handler and BIS_fnc_deltaTime to work out if a weapon is ready to fire or not.


  5. I'm trying to create a vehicle HUD that shows what crew member is in what position. This would need a HUD that changes, because different vehicles have different number of positions.

    I thought I was getting somewhere with various GUI commands such as ctrlCreate and ctrlSetPosition which allowing me to create a UI with a loop that would iterate through all the crew positions.

    However, I then had a nasty shock:

    _display = findDisplay 46 createDisplay "RscDisplayEmpty";

    This disables the player from aiming with mouse, and puts a mouse cursor on screen! This is so the user can click the interface I imagine. But it's not a clickable interface it's purely controlled with the keyboard.

    So how do I enable aim with mouse? Static GUIs that use c classes definited in description.ext don't deactive aim with mouse, but they're static, and I can't move them with ctrlSetPosition.


  6. _veh = vehicle player;
    _turretPaths = [[-1]] + allTurrets _veh;
    _turretConfigs = [_veh, configNull] call BIS_fnc_getTurrets;
    _array = [];
    { _array append [getText (_x >> "gunnerName")] } forEach _turretConfigs;

    I can get all the names of a vehicle's positions through using the getText function as demonstrated above. That's great, but how can I get the turret path / cargo index AND its name name?

    I was hoping I could do something like this:

    _paths = [];
    _names = [];
    {
    	_names append [getText (_x >> "gunnerName")];
    	_paths append [getText (_x >> "gunnerPath")];
    
    } forEach _turretConfigs;

    gunnerPath is pseudo code and obviously doesn't work. But can I write something else to get the position's turret path / cargo index? I'm trying to create an array of all of a vehicle's position's names AND each position's turret path / cargo index.

    For example, passenger left seat 2 would look like this: (it's name and then its cargo index)

    ["Passenger Left Seat 2",[6]];

    The commander turret would look like this: (it's name and then its cargo index)

    ["Commando",[0,0]];


    I want to do this to help with an AI overhaul I'm making. It would be very useful to have every named position and it's path linked logically in a datastructure like this.


  7. 44 minutes ago, Larrow said:

    Supplies a variable called _pos to the menu items expression. Which is the land position currently at the user's crosshairs.

    e.g How calling in support knows where the user is looking.

    So no, it has nothing to do with the menu position. 


    Fair enough, any idea how I can programatically control highlighted menu item? Or is it totally locked off and controlled only by mouse wheel?


  8. I know I can put diag_activeSQFScripts inside a function. But is it possible to get the line number of the call to that function.                   

    lineCalledFrom = { // 1st line
        diag_activeSQFScripts select 0 select 3; // returns 2, but I want to return 5
    };
    
    call lineCalledFrom; // 5th line

    May be a bit confusing, but as you can see, diag_activeSQF always returns 2 because it's written on the 2nd line. I want it to return the line that `call lineCalledFrom` is written on, in this example 5. Thinking of creating some debugging tools that this would be really useful and awesome.


  9. You can give this command a multidimensional array and it will generate a menu for you: showCommandingMenu 

     

    However, I'm finding it very difficult to reverse engineer this array. Here's an example of a menu:

     

    AIO_MENU_GroupCommunication =
    [
        ["All-In-One Command Menu",true],
        [parseText"<img color='#a532c9' image='\A3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa'/><t font='PuristaBold'> Disembark Non-Essential", [], "", -5, [["expression", "[(groupSelectedUnits player)] call AIO_fnc_disembarkNonEssential"]], "NotEmptyInVehicle", "1"],
        [parseText"<img color='#95ff44' image='\A3\ui_f\data\IGUI\Cfg\simpleTasks\types\meet_ca.paa'/><t font='PuristaBold'> Infantry Commands", ([[2], [2, 79]] select _useNumpad), "#USER:AIO_infantry_subMenu", -5, [["expression", ""]], "1", "1"],
        [parseText"<img color='#ffff00' image='\A3\ui_f\data\IGUI\Cfg\simpleTasks\types\navigate_ca.paa'/><t font='PuristaBold'> WayPoints", ([[3], [3, 80]] select _useNumpad), "", -5, [["expression", "call AIO_fnc_startWaypointUI"]], "1", "1"],
        [parseText"<img color='#ffa43d' image='\A3\ui_f\data\IGUI\Cfg\simpleTasks\types\heli_ca.paa'/><t font='PuristaBold'> Vehicle Commands", ([[4], [4, 81]] select _useNumpad), "#USER:AIO_vehicle_subMenu", -5, [["expression", ""]], "1", "1"],
        [parseText"<img color='#8c3825' image='\A3\ui_f\data\IGUI\Cfg\simpleTasks\types\rifle_ca.paa'/><t font='PuristaBold'> Manage equipment", ([[5], [5, 75]] select _useNumpad), "#USER:AIO_weaponAcessories_subMenu", -5, [["expression", ""]], "1", "1"],
        ["", [], "", -1, [["expression", ""]], "1", "0"],
        [parseText"<img color='#ffd6df' image='\A3\ui_f\data\IGUI\Cfg\Actions\take_ca.paa'/><t font='PuristaBold'> Actions", ([[6], [6, 76]] select _useNumpad), "#USER:AIO_action_subMenu", -5, [["expression", ""]], "1", "1"],
        ["", [], "", -1, [["expression", ""]], "1", "0"],
        [parseText"<img color='#f94a4a' image='\A3\ui_f\data\IGUI\Cfg\simpleTasks\types\takeoff_ca.paa'/><t font='PuristaBold'> Unstick Unit", ([[7], [7, 77]] select _useNumpad), "", -5, [["expression", "[(groupSelectedUnits player)] spawn AIO_fnc_unstickUnit "]], "1", "1"],
        ["", [], "", -1, [["expression", ""]], "1", "0"],
        [parseText"<img image='AIO_AIMENU\pictures\advance1.paa'/><t font='PuristaBold'> High Command", ([[8], [8, 71]] select _useNumpad), "", -5, [["expression", "[] spawn AIO_fnc_Menu_HC"]], "1", "1"],
        [parseText"<img image='\A3\ui_f\data\IGUI\Cfg\simpleTasks\types\documents_ca.paa'/><t font='PuristaBold'> Cheats", ([[9], [9, 72]] select _useNumpad), "", -5, [["expression", "[groupSelectedUnits player] spawn AIO_fnc_createCheatsMenu"]], AIO_Cheats_Enabled_STR, "1"],
        [parseText"<img color='#5c3fd9' image='AIO_AIMENU\pictures\zeus.paa'/><t font='PuristaBold'> Activate AIO Zeus", _zeusShortcut, "", -5, [["expression", "[0] call AIO_fnc_zeus"]], AIO_Zeus_Enabled_STR, "1"]
    ];

    Can someone explain every array entry for one item and what it does?
     

    Entry 1: Is the button's description. Font and an image can also be inserted through using the parseText function here.

    Entry 2: An emty array, sometimes contains small arrays??
    Entry 3: sometimes contains the function select _useNumpad
    Entry 4: Contains a string that will be evaluated as code, it's what happens when the button is chosen by the user
    Entry 5: An interger ???
    Entry 6 An integer???

    Something like that, it's really hard to read what's going on. Very poor documentation on showCommandingMenu, I have no idea how the person who made the mod I'm reverse engineering figured all this out.

    Can someone help me figure out the array structure for showCommandingMenu? Thanks


  10. I'n an addon that gives vehicles more smoke grenades, I've patched the smokeLauncherMag to contain 16 smokes:

    config.cpp:

    class CfgMagazines{
        class VehicleMagazine;
        class CA_Magazine;
        class Default;
        class SmokeLauncherMag: Default
        {
            count = 16;
        };
    };

    I'm wondering, can that 16 be a variable? And can that variable be changed during a mission, so that on reload, smoke launchers now contain a different number of smokes by default?


  11. Well, I'm disappointed. I thought I would be able to make an addon that would enable team switcher in the single player campaign (or any single player mission). Apparently not.

    Firstly, I started the Fait Accompli mission as specs ops in ArmA 3's Stepping Stone mini-campaign. The team switcher key (default is U) is disabled, the team switcher window does not show up.
    Secondly, using the Simple Single Player Cheat Menu, I ran:

    enableTeamSwitch true;

    The team switcher now works! But there are no soldiers in it.
    teamswitch.png
    So let's select a team member:

    _units = units group player; // [BIS_SpecialPlayer,B Pariah:2,B Pariah:3,B Pariah:4]
    _unit = _units select 2; // B Pariah:3

    So close, now let's make him switchable:

     addSwitchableUnit _unit;

    Aaaand nothing happens. Weirdly, when I press the team switcher button it is now disabled (nothing shows up). Even if I run enableTeamSwitch true again it remains disabled, almost as if it knows I'm trying to hack it.

    Does anyone know why this is? Anyone have any solutions? I'm a fan of the Arma 3 single player experience and a addon that would enable team switcher in the single player campaign would be brilliant! It would give missions a GTA V feel where you can switch from a sniper you've put on a hill instantly to a HMG operator in the middle of the action... 😞 seems to be locked off though. Any ideas, it is a bit of a hack so I guess it might not be possible.

    Update, I can manually switch player doing this, so I think it's just a matter of creating my own team switcher window:

    _gang = units group player;
    _target = _gang select 2;
    selectPlayer _target;

    Still if any BI staff or geniuses have any tricks to 'properly' allow the team switcher in a single player mission I would be interested!

    Update and TLDR, once enabled, team switch works perfectly in all sp campaigns. It's ONLY Stepping Stone that aggresively shuts down Team Switch. Why is this?


  12. this is so dumb. I've created a really complicated mod, but it's in script form for one of my eden projects. I've done the hard bit. It works. Now I just need to package it into a addon and have an initialization function fire on mission start. That's it. Insane. Day wasted. In a C++ project, init.cpp is always run first. In a website, index.html is opened first. In Arma 3?!?! god only knows how you create an init script.


  13. 24 minutes ago, maihym said:

    Try this just replace "modFolderName" with the name of the folder your mod is in. To call the function you would use [] call fnc_myFunction; if calling from another file or SQF but the preInit will launch the script when the mod gets loaded in.

    
    class CfgPatches{
      class SinglePlayerCharacterSwitcher{
        author = "CaptainDucko";
        version = 1.0;
        units[]={};
        weapons[]={};
        requiredAddons[]={};
        requiredVersion = 0.1;
      };
    };
    
    class CfgFunctions
    {
        class myCategory {
            file = "modFolderName\myCategory"; 
            class myFunction{
                preInit = 1;
            };
        };
    };

     

    Where is the reference to myFile.sqf . And what's myCategory?

×