ARMA3 Transcript of Making UI For player targetting

  1. Prepping the visuals
    1. open eden editor
    2. spawn a few units from off the side bar on right by dragging them over
    3. hit the play senario button
      1. in senario play mode hit escape key
        1. select gui editor
          1. right click on square that appears to get a menu
          2. select |GUI|Back
            1. give it a title
            2. push ok button
          3. right click again to get a rsclist
            1. repeat previous #2 steps
          4. right click again to get a rscButton
            1. repeat previous #2 steps
        2. hit escape, exit, save with a name
    4. save mission
  2. Setting up the scripts to use the visuals
    1. Locate your mission folders – Link
    2. Make files to hold our stuff
      1. Descriptions.ext
        1. #include "defines.hpp"
        2. #include "controls.hpp"
        3. save & close
      2. defines.hpp
        1. open the mission / senario
        2. goto the play senario
        3. keyboard shortcut control+p to copy menu we made
        4. keyboard shortcut alt+tab to get back to the defines document open in  `​notepad++`
        5. paste it & save
      3. controls.hpp
        1. create a class with name you remember, dialogTest is used here.
        2. set idd = 1234;
        3. make a class inside of the class
        4. back in eden editor’s play senario mode do a control+shift+s
        5. return to the controls.hpp & paste the menu classes into it
      4. initPlayerLocal.sqf
        1. player addAction [{"Open Dialog", execVM "openDialog.sqf"}];
      5. openDialog.sqf
        1. Get a handle for the display to work with
          1. ​​createDialog "dialogTest";
          2. _display = findDisplay 1234;
          3. _ctrl = _display displayCtrl 1500;
        2. Fill the control’s list with names
          1. { _name = name _x; lbAdd [1500, _name]; } forEach allUnits;
        3. Attach the object as entity to list
          1. Public variable (don’t use publics once done testing it)
            1. Goes before the forEach loop
            2. playerListArray = [];
          2. Loop should save each object to the playerListArray
            1. `playerListArray pushBack _x;`
      6. killUnit.sqf
        1. Need to call this from controls.hpp inside the class for the killButton
          1. This has reserved word in it – so don’t use this format but the idea that you can keep the menu open is what matters
            1. action = “CloseDialog = false; execVM ‘killUnit.sqf'”;
          2. Working version …
            1. action = “execVM ‘killUnit.sqf'”;
        2. In the killUnit script …
          1. _index = lbCurSel 1500;
            _unit = playerListArray select _index;
            hint str _unit;
            _unit setDamage 1;

Leave a comment