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