Jump to content

juleshuxley

Member
  • Content Count

    72
  • Joined

  • Last visited

  • Medals

Everything posted by juleshuxley

  1. ok, thanks for answering
  2. 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"); // ""
  3. _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? 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...
  4. 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.
  5. 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? 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.
  6. I'm such an idiot. Or maybe sleep depreived. thank you
  7. hasWeapon is another red herring. 😡 https://community.bistudio.com/wiki/hasWeapon
  8. Would really appreciate a straight answer rather than getting ignored. I get ignored 80% of the time but this one takes the **** as I'm halfway though developing something and i've ony just realised there's no commmand to get. It's just so fundamental I assumed there would be a function. So annoyed.
  9. please can someone answer this question 🙏🙏🙏🙏🙏
  10. _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.
  11. When I'm the only person in a vehicle and I change seats, the vehicle screaches to a halt as if the brakes have suddenly been slammed on. Is there a way to supress this in a script? If you were to scramble into a gun turret from the driver's seat the vehicle would keep rolling under in its own inertia. How do I stop the brakes being slammed on? It happens if I teleport out of the vehicle as well. If arma detects no driver, the brakes come on it seems.
  12. It's almost like Arma devs didn't want you to be able to drive a car full of C4 at a bunch of enemies and bail out at the last second 🤔
  13. Two things happen when you kill your own teammates: 1, your team opens fire on you and 2, in most single player missions, BIS_fnc_endMission is called Do you think it would be possible to create an addon that patches out this behaviour? So you can literally do what you want to your own team mates with no repercussions, sort of like how you could shoot marines in Halo?
  14. Fair enough, any idea how I can programatically control highlighted menu item? Or is it totally locked off and controlled only by mouse wheel?
  15. So apparently showCommandingMenu takes a _pos local variable? Does this allow me to set what item in the menu is highlighted? I can create my menu with showCommandingMenu "#User:MyArray" but how do I use _pos to set the highlight to, say, the third item?
  16. 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?
  17. 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.
  18. 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
  19. juleshuxley

    How do I hide the commanding menu?

    Is there a function or method to hide the menu created by showCommandingMenuu ?
  20. 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. 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?
  21. I want to run a function before EVERY mission. This is a QOL addon, not a scenario. I do not want the CBA dependency for something that should be so simple. I've spent 8 hours trying to get fn_myFunction to run when a mission is started. 🙃🙃🤬 This is the structure of my mod: This is the contents of config.cpp: class CfgPatches{ class SinglePlayerCharacterSwitcher{ author = "CaptainDucko"; version = 1.0; units[]={}; weapons[]={}; requiredAddons[]={}; requiredVersion = 0.1; }; }; class CfgFunctions { class myTag { class myCategory { class myFunction {}; }; }; }; This is the result: 🤬🤬🤬🤬🤬🤬🤬🤬🤬🤬🤬🤬 WHY IT'S RIGHT HERE Sorry but 8 hours trying backslashes, forward slashes, changing directory structures, building, building, building I'm going insane.
  22. juleshuxley

    Call a function via config.cpp

    Thank you for your example it was invaluable. This stuff is simple but very fiddly for a beginner imho. Thankyou maihym. My mod is working!!
  23. juleshuxley

    Call a function via config.cpp

    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.
×