#arma3_gui
1 messages ยท Page 6 of 1
And in case you use 3den Enhanced. It has a tool to export all the base classes as well.
Understood.
Note that if you're basing stuff on the Rsc classes, there are some organisational differences when writing a UI for a mod versus a mission.
Huh, ui2tex is smoother you tell me?
#dev_rc_branch message
Yeah...
Does the... pixel rounding command (don't remember its exact name) make a difference?
It doesn't
Which tex you use and config?
Scale of the image is a power of 2
Don't know if that helps.
I'm trying to create a custom animation effect for the RscShortCutButton.
Will check later I guess
Seems like it might be related to something someone else said about how ArmA 3 handles images.
...But what is over4_ca.paa anyways?
Just this pattern.
512 x 64
it's a replacement for the Over_ca.paa that usually goes with the RscShortCutButton.
Very odd quirk.
Cracked it.
autoAdjustTexture fixed the problem
autoAdjustTexture = true;
I don't recall that param tho ๐ค
is there a way to disable listbox row in arsenal, to prevent players to pick up weapon/uniform when they select row?
I found in arsenal, there is LBSelChanged event, that is calling [ "SelectItem", [ ctrlParent _control, _control, _selectedIndex ] ] call BIS_fnc_arsenal;
Hello,
What events (UI Eventhandlers) I can use with
class GVAR(position) {
control = "Combo";
...
I want check when combo list item is selected.
yes
You need to apply the event on the combo box control through. Not on the attribute
Yeapp.
This what i was looking for and figured that out.
thanks again ๐
Hi, everyone. How do you create a child element for control group in gui editor?
hmm,
how i can get
class GVAR(UserDefined): Title
{
class Controls: Controls
{
all controls from here?
i can get #control -1, which is UserDefined control, but i want child controls
allControls command
Or controlsGroupCtrl command
Forget the GUI editor is the first step. And write in text editor
I was trying to reverse engineer the what I believe is rhs, their magical numbers make no sense to me
What magical numbers
their safezone formulas
For an instance
x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))";
y = "0 * (0.025 * SafezoneH) + (SafezoneY)";
w = "53.5 * (0.01875 * SafezoneH)";
h = "40 * (0.025 * SafezoneH)";
That's gui_grid it seems
This is just a macro
Yeaah, trying figure out easy way.
and found. Thx
{
private _ctrl = _x;
for "_i" from 101 to 103 do {
diag_log format ["userDefined Controls: %1",_ctrl controlsGroupCtrl _i];
};
} forEach _userDefined;
Ok, so that means 0.025 * SafezoneH and 0.01875 * SafezoneH are the height and width of 1 gui grid tile?
It's a bit more complicated than that. You might wanna read the Biki page about GUI_GRID
Yes
personally i dont think the UI editor is too bad. but the control group controls needs to be created via text or script
I think you can create controls groups. Then you need to drag the child controls into it or so.
oh have to try that sometime
I have BIS_fnc_holdActionAdd on object to open dialog with buttons.
Often, I hold [space] to open dialog and accidentally pressing first button that has focus in dialog.
Is there a way to prevent this accidental button press ? For now I use ctrlSetFocus on some non-essential button after I open dialog.
ctrlSetFocus is the best solution I know of.
You could disable input from the default action button in the UI. That's how I have done it in the past.
could point me to command to use ?
KeyDown event handler and the command to get the default action key.
@young patio You could share your content and where you are trying achieve?
get or set lbdata and where?
Currently working within an existing file where lbCurSel is typically set. Sometimes however it will not be selected, like on initialization of the dialgoue itself.
_exampleVariable = lbData[10101,lbCurSel (10102)];
Right now I am trying to create a check for if _exampleVariable does not have anything selected. Just confused on whether this would be -1 per lbCurSel or if lbData would have a default of it's own that perhaps isn't listed on the wiki.
i think lbData only gives you what you have given it by lbSetData
probably empty string otherwise
Out of curiosity if lbData only gives what it is given- wouldn't that be -1 instead of a string in this case since lbCurSel default is -1?
Ahhhh I see now- good catch. Thank you I really appreciate it ๐
This menu I am working in right now trying to case for an unselected option is inconsistent in whether a button is selected or not when it is opened. Likely due to some kind of race condition but is a pain since otherwise kind of a PITA to systemChat what it's unselected value would be.
if its the types that concern you there is https://community.bistudio.com/wiki/typeName command to check it
Hello,
is there way to dynamically load items to Combo box in eden attributes.
if i use onLoad / onattributesload event it doenst save selected item.
When i open attributes again, lbcursel is 0.
So what would be correct place to append stuff ?
It loads what's saved in the _value variable and if that doesn't exist uses the defaultValue from config.
If multiple entities are selected it selects nothing by default.
Or the common value of all entities
Can you post the code or GitHub link?
The function is not returning anything is it?
It just list stuff
It works, but when i select an item from the list,
Close attributes,
It doesn't show up as a selected item on the combo list when I open it again.
Like normally
Are you sure you are saving the value?
What does the onAttributeSave function return?
I'm not
How do you expect Arma to know what should be selected then?
Though it uses the class Combo attribute save,
Seems that doesn't work on my case.
I need to do something that saves _value.
I see..you wanted to reused the vanilla code.
Yeah. That might not work. Better write your own
Some snippet how to save _value?
Just look up vanilla combo save?
I did, I didn't get it ๐ค
Whatever the code returns is saved
I am at work right now so can't really post code. But you can check out the 3den Enhanced repository.
I will, thanks
Hmm,
Only saves 0 and 1 , not 2, 3 positions.
What exactly do you want to save?
Well nothing, because I do not need that value afterwards,
But the issue is that it doesn't save "value" on Eden, I want it to show the same value that I selected when I re-open vehicle attributes
Is the issue that I create items onload, or what?
If you just need it for the attribute then save it in missionNamespace
is there a way to disable selected row in CT_LISTBOX or CT_LISTNBOX ( disable user input )
Unlikely, but you can simulate this by using a value.
as in "make them not react to user clicks"? https://community.bistudio.com/wiki/ctrlEnable set to false, maybe?
But this command disables the entire control, not a specific row.
would probably require some https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onLBSelChanged shenanigans with saving lbCurSel to some variable on valid selection change and re-applying the saved one on invalid selection
Can't think of better way, sorry
Helloh peeps I need some guidance, I'm working on a mission and want to create a small gui that the players have to enter an encryption code into
I've already made the UI and I can open it fine, but I'm not quite sure whats the right way to 'extract' the text from it? At the moment I've got an editable text field for the players to write in and a button to 'confirm' the action, I assume I can use an event handler or parameter or something to get the text when the button is pressed and then check if its correct?
ctrlText
thanku smart arma peeps 
so my first thought would be to either use the event handler on its own to check the code, or alternatively to just have it put the text box's text into a variable that I can then use elsewhere
hello,
where i could find this error box ?
I have edited editboxes and i want check that added values is correct and display error message if those arent.
Tried dig from a3 configs but didnt find correct functio/ event where like in
similar like if i add non numerical to editXYZ editbox,
AFAIK an engine driven feature
Yeah, it pop up when i press OK and values is not correclty.
Maybe i need do my own check and error message box.
Not sure if it is anyhow possible to detect OK via an EH
(Theoretically yes using some config, but there's none as an Eden EH?)
Yeah, there was 3den Show message
0 spawn {
waitUntil {!isNull findDisplay 315};
["TEST","",true,false,"",findDisplay 315] call BIS_fnc_3DENShowMessage
;}
I said EH 
Yeah
I have EH on my ok ButtonClick
in my own attribute
but yeah, i need some how check if OK pressed , maybe on attribute save , and check is values is correct, if not retrun.
Don't know.
Is it an edit box you want to check?
Use EditChanged event. Then you have direct feedback.
hm, yes, but seems i do not how i can get "error" , "display" message on attributes (display 315),
currenlty i show message (hided display 315 on background), waituntil i press ok.
Attributes OK button error shows up on display 315, its not hiding other
Can't you provide the parent display to the 3denMsg function?
yes i can
but seems it doesnt work like it should
parent is 315, return it from ctrlParent
Do I need to do something differently?
Spawn it?
Don't know if something messes up.
Seems it's in the engine side so cannot find how it is done when you press attributes [ OK ], and you have the wrong data type on numerical data boxes.
Or like when you load a saved mission from saves, same kind of error displays on Load screen
What's the problem? Didn't catch.
Wouldn't something like this OK button click EH work for you:
params ["_control"];
_display = ctrlParent _control;
_input = _display displayCtrl INPUT_IDC;
_inputValue = ctrlText _input;
if (_inputValue regexMatch "^\d$") then {
_display closeDisplay IDC_OK;
} else {
[
_text,
_title,
true, // OK button
false, // Cancel button
"", // icon
_display
] call BIS_fnc_3DENShowMessage;
};
?
Noup, it shows up a 3DEN message, but it hides attributes display background.
When I press ok , it returns to the attributes window,
Just trying to figure out why it doesn't behave like the A3's own error message.
Not a big deal, but annoying
Yes, I also noticed, but it's OK for me.
Then try to investigate the function source code.
What if you set its parent to be display 313?
That the att. window disappears is correct
Let me test
If I remember correctly I tested all displays
And then it closes at 315.
Doing test...
same effect
Hmm yeah. Doesn't seem to work.
The function usually doesn't close the parent display but it does so for the attributes window
It's a minor thing so.
Yeah, damn I won't give up, but it seems I have to,
Cannot find a way to prevent it
Maybe I just do something else,
Force shutdown Arma if the user save list is full ๐
I mean you can always prevent the input of an invalid character
Via input eh, if user input is something else than numerical or . , it doesn't let it or errors that?
Hmm, easier just block alphabet?
I mean no error, but no input if text is not numerical?
That could be a way to handle that
Isn't there even a property for edit controls to allow only numbers.
But the error message, what I tried to figure out, is just notification to the user on other content.
Maybe I just hint or systemChat or Eden
Hmm, there should be
I need to check that too
Then I just need to build up new controls for those.
So what's the solution you came up with.
Im not sure if this is the proper channel but i was wondering if anyone knows how to do these vehicle functional screens
on the second pic i know how to display video with pip, but i wanted to add the menu on the bottom
The menus are part of vehicle geometry and they're animated with model.cfg
Well, maybe i just do hint on save error (when user save array is full) and with editXYZ maybe i just leave it.
I got working edit -> editChangedEH, but dont know do i need that .
User will do once "wrongly" and after that he wont because fnc will error if data type is wrong on position, dir or up values
Does anyone happen to have a reliable way to detect if the cursor position is over one of the checkboxes?
The y pos doesn't matter as I have the path that's currently being hovered over.
I wonder if it's reliable to just express the start and end of the checkbox by an offset from the left. The offset being % of the total width of the control + a fixed amount for each level.
Yeah, you'll probably need to calculate checkbox area yourself
maybe devs can share the hardcoded formula
At least I got a prototype now. Next step is to test it in different display settings
Might be useful: https://forums.bohemia.net/forums/topic/289480-getting-listbox-item-index-by-coordinates/
Hi! I wrote a function to get listbox item index by coordinates. It works fine if listbox height is a multiple of row height, otherwise a small error appears, which is especially noticeable at the end of listbox. Could anyone help solve this issue? Spoiler private [_index, _itemsCount]; _index = ...
The height is given in the tree control
But not in the listbox control.
Anyway, my code is for listboxes, you can adapt it for list of checkboxes.
Thanks ๐
ctrlAt command?
I can already get the coordinates with mouseMoving event
And the image is not a standalone control.
Yeah. Use the coordinates and ctrlAt to see whats under there.
And if the thing under there is a checkbox, bingo
Huh? Interesting.
I thought I added it to make it possible to fake mouse clicks at a position. For like UI on texture, aim at the texture to click a button and such.
So seems thats exactly what you want
I have just realized that I tricked you into thinking this is a checkbox. It's just the left picture of the tree view with the texture of the checkbox.
Well, that was surprisingly easy and not painful ๐
Wish all the magic offset formulas for pictures and texts would be released somewhere, its a pain to figure them out by trail and error
Well. Seems my approach didn't work.
I changed to pixelGrid and now the offsets are wrong. hmmm
// This is where the checkbox of the first level starts
#define TV_X_START 6.5 * GRID_W
// That's the amount we need to move to the right with each level that we go deeper
#define INDENT_SIZE_X 4.2 * GRID_W
// Width of the checkbox icon
#define CHECKBOX_WIDTH 3 * GRID_W
//...
private _checkboxStart = _indentCount * INDENT_SIZE_X + TV_X_START;
private _inCheckboxArea = _cursorPosX >= _checkboxStart && {_cursorPosX <= (_checkboxStart + CHECKBOX_WIDTH )};
This seems to work now
Hey guys, im relatively new to this kind of thing. Im not sure if its in the right place.
Essentially what Im trying to to is take certain elements from a mod (like RHS).
And remove excess mod files that I have no interest in. And only keep the pbo files I want to actually use.
Because RHS is on my pc, ive made a copy of it and named it something else.
Lets say once Ive removed all the excess stuff. I could then publish the new file folder on the workshop and just subscribe to that?
If you guys could @ me with any advice I would be grateful
- That has nothing to do with GUIs
- You need to get permission from RHS to re-upload assets
@loud flame where is the correct place to post this.
#other_ip_topics, or dming someone from RHS
does anyone know how to create really small text? I use the RobotoCondensed font but at some point it gets really blurry. (Using SizeEx to adjust size)
RscText SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 40) * 1)";
i put the 40 there..
thats actually not su blurry yet but need smaller text
Can you post a screenshot
sure this is a WIP screenshot
would be ideal to have readable text in those smaller flags
Another usage example
Basically render controls/text in higher resolution, then resample it down as picture instead of text
ok
anyone happen to know how to get handle to the hint dialog/ctrl? i just want to change its position a bit
I don't think it's possible -- I even find its display/control and tried to change it, but no luck.
hmm i tried "RscHintGroup" but wasnt able to get the control via the current display
Hello, I'm making a stupid little mod to add a font to my mission to use in titles and such, but it isn't showing up at all in my config file. is anything here wrong?
it isn't showing up at all in my config file.
How did you made it sure
I'm sorry, what do you mean?
Literally. How do you test it
I enter the in-game config viewer and look at cfgFontFamilies
How do you make a PBO?
Addon Builder
And do you load it?
Post the config
as a file, or just in sqf format?
config.cpp
config.cpp.txt
yes
It's config.cpp, not config.cpp.txt
I have been told that it doesn't matter, because after you pack it it fixes it
I can not find a file converter/opener for cpp, can Sublime text save it as so?
Actully, I'll check
cpp is likely to be binarized automatically
So, how do I save the file as .cpp?
fixed that
Rename config.cpp.txt into config.cpp
No. config.cpp is just a text file
Ok, well renaming it doesn't work for me then
How it doesn't work
Show the extension in Explorer
Wow.. Today I Learned. It's a CPP file now, should it work?
Try it
Font not working :(
How do you make it sure
titleText [
"<t>Hello There!</t>",
"PLAIN",
10,
true,
true
];
Works, can see it! But:
titleText [
"<t font='PirataOne'>Hello There!</t>",
"PLAIN",
10,
true,
true
];
Does not.
Any error messages
No
Hmm.. it seems even if I put a vanilla font in, it also doesn't display
that's a brand new problem
fixed it
Any other font other than mine works
Ok I think I found out why
I'll come back after I fix this thing
Okay, so I repacked and used a different font for unrelated reasons, this new font shows up in cfgFontFamilies, and the mod shows in cfgPatches, but it still doesn't display
hello guys im editing main menu, when i click on "configure" it end up like this, it overlay the multiplayer button, which code should i edit?
Just don't 
Hey folks, I am working on a GUI and there is a function where the Player can open the Map, choose a Position and the Position is transfered into the GUI.
I was hoping I could leave the GUI open and open the map over the GUI (so I don't need some further magic to save all the other Inputs the Player did before) but the map always opens behind the GUI.
Is there an option I am missing?
what is your current config? you can have things like the map on top of other displays, but it is wonky
heres a similar example, but I always had trouble with people clicking on it
<#1236183084836061284 message>
Well, for now I was just trying to open the map onButtonClick with openmap true.
Seems this is not gonna fly as I found nothing where I could determine something like a order in which Displays are shown.
So now I am thinking about creating another Display with the Map over the other display but honestly, I might come back to my initial thought and just "save" the values in a variable and close and create the dialog again ^^
@half orchid Here's what I do:
//Add a Mission Event Handler to handle left-clicks on the map:
private _mapSingleClickEH = addMissionEventHandler ["MapSingleClick", {
params ["", "_clickPos"];
/* Do something with _clickPos here ... */
[] spawn {
sleep 1;
openMap false;
};
removeMissionEventHandler [_thisEvent, _thisEventHandler]; //Prevents the player from marking a new position before the map has been closed.
}];
/* Save existing inputs from your GUI here ... */
//Open the map:
closeDialog 0;
openMap true;
systemChat "Left-click on the map to mark a position.";
//Add a Mission Event Handler to handle the map being closed:
addMissionEventHandler ["Map", {
/* Create your GUI again here ... */
removeMissionEventHandler ["MapSingleClick", _thisArgs # 0]; //The player can close the map without left-clicking.
removeMissionEventHandler [_thisEvent, _thisEventHandler];
}, [_mapSingleClickEH]];
Experimenting with separating my modules since they are starting to get up in number. Should I keep them all in one tab, or separate them?
Personally, I like the "all in one category" look until the list requires you to actually scroll up and down just to escape it haha
Separated, easier to navigate
People can filter by mod if they wanna see all your stuff at once
That's not related to modding GUIs, see #arma3_troubleshooting
oop sorry
I'm trying to improve on cTab's TAD map control (https://github.com/jetelain/cTab/blob/master/%40cTab/addons/cTab/TAD/cTab_TAD_controls.hpp) usable on aircraft by implementing a map color scheme similar to that of Enhanced GPS (https://steamcommunity.com/workshop/filedetails/?id=2480263219), with highlighted power lines and terrain that is higher than the current altitude.
Just a small issue:
Enhanced GPS uses the entries altitudeMapColorHigh/Mid/Low to define terrain coloring, but it isn't applied to the cTab RscMapControl. Is there any way to make it so?
I'm sure this has been asked a gajillion times, is there anyway to get an image 100% to scale from border to border in UI, for a 2048x2048 image? I need to be able to center it at all times.
So you want it to zoom in if it would not fill the screen?
yes essentially
Set it to the width of the monitor and calculate the needed height of the control by the aspect ration. Once you have the size of the control set. Center it on screen.
I've sent a DM example, will try to look at what you're saying here ๐ฎ
is it possible to make NVGs PiP
I am not sure if this the right channel to ask this question, but I need help i keep getting this undefined base class RscPicture even though it on there. what do i need to do to fix this?
#define true 1
#define false 0
class RscTutGUITextures
{
idd=7801;
movingEnable = false;
enableSimulation = true;
fadein=0;
duration = 1e+011;
fadeout=0;
OnLoad = "";
controlsBackground[]={};
controls[]=
{
RscTablet
};
objects[]={};
class RscTablet: RscPicture
{
idc = 1;
colorBackground[] = {0,0,0,1};
colorText[] = {1,1,1,1};
text = "image\40x26px.paa";
x = 0 * safezoneW + safezoneX;
y = 0 * safezoneH + safezoneY;
w = 1 * safezoneW;
h = 1 * safezoneH;
};
};
You need to reference a class before it can be used
You're also missing quotes around RscTablet in your controls list
You need to do either import RscPicture; or class RscPicture; before inheriting from RscPicture (see https://community.bistudio.com/wiki/GUI_Tutorial#Parent_Controls).
ohhh
thank you, i was missing was import RscPicture
Theoretically yes,
I've seen most of the individual pieces required to make it work
You might want to look at the dual render scope from the REAP-IR mod, they successfully got a PiP screen with a menu working in a scope
I can't help much with implementing it though
Yh, apparently someone tried it but stopped because it was too laggy, I might have a look at it, altho I have like negative experience with that sort of shit
The laggy issue should be less with some of the new stuff in perf/prof branch
The reap-ir mod seemed to have dealt with lag mostly, at least in the virtual arsenal
hi, is there a guide or any documentation on the rhs pip optics framework?
or atleast where could I look for it in the pbo
Pretty sure thye just use CBA's system, I could be wrong though
https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics
If it is their own system, it's probably not documented
alr thanks
If they use CBA's system, they use a completely independent copy/reimplementation of it, since RHS does not use CBA directly
They do not
took me a while to pick it back up but I got it to work 
I have added an item to the RscGroupRootMenu (the simplified command menu). However, it appears at the bottom. How can I adjust its position?
https://community.bistudio.com/wiki/ctrlSetPosition and then https://community.bistudio.com/wiki/ctrlCommit should do the trick
Thanks for the pointer. Those functions would allow me to move the entire menu I think. To be clearer: I want to re-order the individual menu entries.
Made some more progress since then ๐
My fix has been to create my own custom sub-menu in which I can control all the entries ๐
Hey folks, I have a question regarding GUIs, evne though its not modding, I hope this is the right place.
I have addActions and ACE Interactions to spawn a function that create the dialog but sometimes it seems like the GUI just shortly pops up and disappears instantly.
Anyone has an idea what could be causing this?
Post the code.
Calling the function
// VLS Terminal
_condition = { vlsStatus < 4 && ((vlsRolesCMDR findIf {_x == vehicleVarName player;} > -1) || (vlsRolesCMDR findIf {_x == groupID group player;} > -1) || (vlsRolesCMDR findIf {_x == player getVariable "loadout";} > -1)) };
_modifierFunc = {
params ["_target", "_player", "_params", "_actionData"];
// Getting the Status suffix for the Aactionname
_status = "";
switch vlsStatus do {
case 1 : {_status = " (Call in Progress)";};
case 2 : {_status = " (Executing Strike)";};
case 3 : {_status = " (Preparing new Strike)";};
default {_status = "";};
};
// Modify the action - index 1 is the display name, 2 is the icon...
_actionData set [1, format ["VLS Terminal%1",_status]];
};
_vlsTerminal = ["VLS Terminal","VLS Terminal","A3\ui_f\data\map\mapcontrol\Stack_CA.paa",{[] spawn vlsDialog_fnc_vlsCreateDialog;},_condition,{},[],"",0,[false, false, false, false, false],_modifierFunc] call ace_interact_menu_fnc_createAction;
[(typeOf player), 1, ["ACE_SelfActions"], _vlsTerminal] call ace_interact_menu_fnc_addActionToClass;
The function calling the dialog:
if (vlsStatus > 0) exitWith {
switch vlsStatus do {
case 1 : {["VLS not available. Another Element is currently requesting a VLS Strike", "Error"] call BIS_fnc_guiMessage;};
case 2 : {["VLS not available. VLS strike in progress", "Error"] call BIS_fnc_guiMessage;};
case 3 : {["VLS not available. Readying missile array after firemission.", "Error"] call BIS_fnc_guiMessage;};
};
};
createDialog "vlsDialog";
_map = findDisplay 99005 ctrlCreate ["RscMapControl", -1];
_map ctrlMapSetPosition [safeZoneX + safeZoneW * 0.316,safeZoneY + safeZoneH * 0.333,safeZoneW * 0.369,safeZoneH * 0.368];
vlsStatus = 1;
publicVariable "vlsStatus";
createMarker ["vlsMrk",[0,0,0]];
"vlsMrk" setMarkerAlpha 0;
"vlsMrk" setMarkerType "mil_destroy_noShadow";
"vlsMrk" setMarkerText "VLS Target";
_menuEntry = format ["Cruise Missile HE (%1 Missiles)",vlsHERounds];
lbAdd [9900501,_menuEntry];
_menuEntry = format ["Cruise Missile Cluster (%1 Missiles)",vlsClusterRounds];
lbAdd [9900501,_menuEntry];
lbSetCurSel [9900501,0];
[] onMapSingleClick {
_firezoneCheck = false;
{
_fireZoneCheck = _pos inArea _x;
}forEach vlsNoFireZones;
if (_fireZoneCheck) exitWith {
["Target is in No Fire Zone!", "Error"] call BIS_fnc_guiMessage;
};
"vlsMrk" setMarkerPos _pos;
"vlsMrk" setMarkerAlpha 1;
};
sleep 2;
if (findDisplay 99005 == displayNull) exitWith {
hint "Error when calling Terminal";
deleteMarker "vlsMrk";
onMapSingleClick "";
vlsStatus = 0;
publicVariable "vlsStatus";
};
Single- or multiplayer?
Multiplayer
Is there any code that closes vlsDialog (e.g. onButtonClick UI EH) or does it stay on screen for eternity? ๐
oh wow, i don't remember alt syntax at all[] onMapSingleClick { 
Eventhandler for ESC
//Remove ESC Close Display
(_display) displayAddEventhandler ['KeyDown', {(_this select 1) isEqualTo 1}];
//Add new ESC functionality
(_display) displayAddEventhandler ['KeyDown', {
//Add new function for ESC key
if ((_this select 1) isEqualTo 1) then {
call vlsDialog_fnc_vlsCloseDialog;
};
}];
vlsDialog_fnc_vlsCloseDialog:
closeDialog 0;
deleteMarker "vlsMrk";
onMapSingleClick "";
vlsStatus = 0;
publicVariable "vlsStatus";
There is also an Exit button in the GUI that calls the close function
Find it much easier to read for myself if its code and not a string when working with it.
toString {code} can help with that as well (just to have at least some positive input in the convo)
And just to clarify: Everything works fine in the dialog. It is just, sometimes it won't open, will change the status but not change the status back. It's weird... very weird. I was hoping I was just missing something about ACE Selfinteract or calling a dialog that could make it somehow more reliable.
No worries, I still always have the wiki up on seconds screen just to check if I did the switch syntax right ๐ And i didn't know the tostring thingy, so thank you.
And can you reliably reproduce that behaviour for troubleshooting purposes?
Nope. absolutely not. Sometimes it happens, sometimes I can open the dialog 50 times in a row without an error.
Thats whats making me really crazy ๐
And the brute force control at the end is not helping with it. Seems like somehow, just half of the function is executed.
I know, this should not be possible, it's just how it feels to me. And yeah, tried that on dedicated, localserver and in singleplayer. Always the same. Sometimes works like a charm, and then suddenly the one time this fails.
So it can fail in singleplayer too?
Yeah, sometimes. ๐ฌ ๐
That's good, it makes troubleshooting easier ๐
At least when testing in Eden editor
I have the feeling it could be something about the publicVariable command. I had that now on several occasions on dedicated servers, that the publicVariable was not executed porperly, meaning the variable was not promoted to the server.
I am wondering if this would be more reliable when using missionnameSpace getVariable / setVariable.
Could be; I never use publicVariable (but the Wiki claims that it is reliable).
Technically, your code is also prone to race conditions as soon as there are at least two players using your VLS Terminal, but I don't think that's a major issue right now (especially considering that you can reproduce the problem in singleplayer).
Thats why I am trying to block the Terminal when one has it opened.
There are a few other things in your code that are known to sometimes cause problems:
1๏ธโฃ You use lbAdd [idc, text]. IDC-based syntaxes are unreliable, it is better to use control lbAdd text instead. Same for lbSetCurSel, etc.
2๏ธโฃ You use onMapSingleClick. There could always be a mod or mission script that overwrites your onMapSingleClick code. It is better to use a MapSingleClick Mission EH.
3๏ธโฃ I don't understand what the if (findDisplay 99005 == displayNull) exitWith { ... } block in vlsDialog_fnc_vlsCreateDialog is for. Have you ever gotten that Error when calling Terminal hint?
4๏ธโฃ I'm pretty sure that you can combine your two onKeyDown UI EHs into one:
_display displayAddEventHandler ["KeyDown", {
private _isEscKey = (_this # 1) == 1;
if (_isEscKey) then {
call vlsDialog_fnc_vlsCloseDialog;
};
_isEscKey
}];
I suggest fixing these potential issues. If you can still reproduce the bug after fixing these things, put a bunch of systemChat / diag_log statements into the code so that you can see how much of the code is executed and what values the important variables have.
To 1: Okay, didn't know that this i unreliable. Will change that
To 2: Didn't know that either. onMapSingleClick always seemed easiert to manage for me than an EH, but will change that too.
To 3: This was my brute force Idea to catch this weird error that we are talking about, but yeah, does not work for some reason.
To 4: Tried that at first. Didn't work then, but I changed also the closeDialog function, so yeah, maybe this works now. Will try.
Thanks so much for the suggestions. I know, its a frustratingly obscure problem so thanks for sticking with me.
how do I create a display on a r2t
You don't
Do you mean ui2tex
na just like a picture in picture thing
say I have a camera somewhere and that renders onto a screen
That is r2t display, not display on r2t?
I want to put something ontop of a PiP screen
Do you know how to make GUI, r2t setup etc
Then it is easy. Put controls over r2t control
oh alright, thank you
Is there a function/script to add an item to a command menu (eg. RscGroupRootMenu or RscMenuMove) dynamically?
Nvm, can do what I want with https://community.bistudio.com/wiki/BIS_fnc_createMenu
Not sure where to post but I'm trying to make a mod that brings up my tablet i have made. I have the dialog file made and the picture for it. but im having a problem with the game running/bring up the mod. Not sure what im doing wrong.
Got the GitHub link?
You might need to learn how to use it first. But it's very important to know in the programming world. That link leads to nothing.
Does anyone know the Display ID and Ctrl ID of the commanding menu? The one you get when selecting units.
if you havent found it yet look at the config browser, you can find the ID from there. IIRC the class is something like RscCommandingMenu
Good day, I need to make a text with a scrollbar that will keep scrolling down as new info added.
I'm closing on plan inolving CT_LISTBOX and ctrlSetScrollValues, but is there a better alternative?
have you checked this: https://community.bistudio.com/wiki/ctrlSetAutoScrollSpeed
I'm not sure how it is applicable in my case ๐ค Could you elaborate?
isnt it auto scroll you want?
https://community.bistudio.com/wiki/ctrlSetScrollValues states it supports CT_CONTROLS_GROUP as well. So group + CT_STATIC (or whatever) for text + https://community.bistudio.com/wiki/BIS_fnc_ctrlTextHeight + ctrlSetScrollValues 1 on group may end up a bit more text-like than listbox 
That's a... interesting approach, I'll give it a try, thank you. ||Nice to see you btw||
Right, I got what you mean now. Thanks
Is there a way I can execute a script in the main menu to randomize a custom background image control like this? The randomization doesn't execute/work, but I am having a hard time understanding how GUI works in general. This is my class inside of RscDisplayMain->controlsBackground which currently can display a static background image regardless of -skipintro: ```
class my_test_Background: RscPicture {
idc=202412;
onLoad="[_this] call '\testbg\bgrandom.sqf'";
text="\testbg\images\menu_1.jpg";
x="safeZoneX";
y="safeZoneY";
w="safeZoneW";
h="safeZoneH";
};
Where bgrandom.sqf is just this to see if it works:
params ["_display"];
ctrlSetText [
_display,
(selectRandom [
"\testbg\images\menu_1.jpg",
"\testbg\images\menu_2.jpg",
"\testbg\images\menu_3.jpg",
"\testbg\images\menu_4.jpg"
])];
That's not the right syntax for ctrlSetText if you're using an actual control
Oh good catch, thank you. I changed it to _display ctrlSetText _randomPick where _randompick is just the same selectrandom for images but no change. I'm wondering if setting the text in the actual class is somehow overriding it maybe? Still trying some different combos.
That's not the issue
You also need to commit the changes with ctrlCommit if you're not already
I was not committing it, another good catch (thank you) but still no change, here's the contents of bgrandom.sqf now:
_randompick = selectRandom [
"\testbg\images\menu_1.jpg",
"\testbg\images\menu_2.jpg",
"\testbg\images\menu_3.jpg",
"\testbg\images\menu_4.jpg"
];
_display ctrlSetText _randomPick;
_display CtrlCommit 0;```
Your onLoad doesn't call your script by the way
call takes a code block, you're currently giving it a string
Use https://community.bistudio.com/wiki/compileScript, or better yet, make it a function and just call that instead
You'll also need to pull the function from uiNamespace iirc
So something like:
onLoad = "call (uiNamespace getVariable 'TAG_fnc_mainMenuOnLoad')";
Sorry for the delay in reply here. I did a lot of testing and moving some thingies around, then defined testbg_fnc_bgrandom, which I changed to select the custom control idc at the bottom:
_randompick = selectRandom [
"\testbg\images\menu_1.jpg",
"\testbg\images\menu_2.jpg",
"\testbg\images\menu_3.jpg",
"\testbg\images\menu_4.jpg"
];
((allcontrols findDisplay 0) select 0) ctrlSetText _randomPick;
((allcontrols findDisplay 0) select 0) CtrlCommit 0;
If I open the editor and call the function, then return to the menu, I now have a randomly selected bg! However, it still isn't firing off when the game loads or if I return to the menu without manually calling the fnc in the editor debug console.
The background image class in rscdisplaymain -> controlsbackground is now:
class my_test_Background: RscPicture {
idc=57500;
onLoad = "call (uiNamespace getVariable 'testbg_fnc_bgrandom')";
x="safeZoneX";
y="safeZoneY";
w="safeZoneW";
h="safeZoneH";
};
Am I still calling the function incorrectly there? Is this something that can happen in controlsBackground classes anyway?
Am I still calling the function incorrectly there?
That's correct there
Is this something that can happen in controlsBackground classes anyway?
Not sure, I don't touch GUI often enough to know about potential cases like that
Understood. I can just keep trying things from here- thank you very much for your help! It's so close to working.
You could do a systemChat / diag_log to test if your function is being called when opening the main menu for the first time
systemChat should show on the main menu iirc, but diag_log will definitely work
The systemchat does show when I add it to the fnc and relaunch
You could try wrapping it in a CBA_fnc_execNextFrame, it might be running too soon after the display is created?
I tried CBA execnextframe and execnextNframes but both didn't do anything at all, not even the systemChat part of the function. It seems like no matter where the control my_test_background goes it can't be changed, but once you load up in the editor and run the function it does do what it's supposed to do and changes the bg when you go back
Don't think you can use CBA frame handlers in main menu as they are dependent on CBA_missionTime
Didn't realize next Frame used it
How come my RscObject isn't showing up in my dialog?
{
idc = 1600;
x = 0.5;
y = 0.5;
model = "MAA\data\HE 441.p3d";
scale = 0.35;
//direction = "";
};```
been scouring the forums for like an hour trying to figure this out
Oh shoot does it need to go in class objects instead of class controls?
https://community.bistudio.com/wiki/CT_OBJECT
There is an example at the end, might be useful.
Thanks, somehow I never scrolled down that far...
What do I use to edit the direction of the RscObject in game? ctrlSetModelDirAndUp doesn't seem to be working...
{
class RscObject_1600: RscObject
{
access = 0;
shadow = 0;
idc = 1600;
type = 80;
model = "MAA\data\HE 441.p3d";
x = 0.5;
xBack = 0.5;
y = 0.12;
yBack = 0.12;
z = 0.22;
zBack = 0.22;
inBack = 0;
enableZoom = 0;
direction[] = { 0, 0, 1 };
up[] = { 0, 1, 0 };
zoomDuration = 1;
scale = 0.7;
waitForLoad = 0;
};
};```
This is the code that I'm using to try to change the direction, via a onSliderPosChanged eventHandler
_yaw = 0; _pitch = 0; _roll = _value;
RscObject_1600 ctrlSetModelDirAndUp [
[sin _yaw * cos _pitch, cos _yaw * cos _pitch, sin _pitch],
[[sin _roll, -sin _pitch, cos _roll * cos _pitch], -_yaw] call BIS_fnc_rotateVector2D
];```
maybe ctrlCommit?
Make it into an animation?
No just update it's position and do
ctrl ctrlCommit 0
What's RscObject_1600? The class name? If so, then it won't work.
yeah it is. What do I put instead? I tried putting just the idc and it didn't like it
You should put your control.
Oh, sorry. RscObject is the class name and RscObject_1600 should be the actual object
Is it because it needs to be put in class Controls? I tried that and the model didn't show up
As I wrote, you should pass the control to ctrlSetModelDirAndUp, not the class name:
((ctrlParent _ctrl) displayCtrl 1600) ctrlSetModelDirAndUp [...];
Hello, is anyone aware how the buttons in virtual arsenal are created and updated?
onEachFrame? It's like drawicon3d but interactable and also like it's attached to certain position?
How would one do that?
Using drawIcon3D obviously can't make it interactive, I've tried doing drawIcon3D on an object and then creating empty display (in order to show cursor) and then trying to get that same position and create invisible button but I'm not getting it to work
It's regular display created on mission display:
#include "\a3\ui_f\hpp\defineResincl.inc"
(findDisplay IDD_MISSION) createDisplay "MyArsenalDisplay";
I'm not sure you understood what I meant.
You know the 'icons' attached to the player? Like the one for rifle, headgear, vest... how are they created attached and made interactive?
Are they just ordinary RscButton getting the 3d position from selection of player converted to 2d coords and then ctrlSetPosition on that position while the wanted location is updated every frame?
If you rotate the camera the buttons follow.
That's regular controls whose position is changed in Draw3D event handler.
I'm confused how to use Draw3D to create RscButton
You use the event handler to update their position each frame that's all.
They are created during Arsenal display creation, in Draw3D only their positions are changed.
Understood, how to properly get the 3D position of object?
e.g I have a infostand and this "modelToWorldVisual [0,0,0.5]" which is the position I want, kinda in the middle of the white part of it, how can I keep it facing player? What do I need to use? worldToScreen ASLtoAGL getPosASL cursorObject?
_kk = worldToScreen ASLtoAGL getPosASL cursorObject,
_sX = _kk select 0;
_sY = _kk select 1;
right and then _ctrl ctrlSetPosition [_sX, _sY]; ?
that's not working for me
Play with commands, I can't write working code in my head.
yup figured it out thanks
Keep in mind that worldToScreen can return empty array if entity is not even closely visible
Righto, I've hit a wall with a custom main menu I have been working on.
Briefly, I've deleted a3's vanilla main menu ( delete RscDisplayMain;), copied RscDisplayMain and edited it, removing parts of the menu and adding custom UI.
I have a controls group that I can toggle on/off via a button to customise the look of the main menu. The preference is saved to profileNamespace and the controls group is shown/hidden with ctrlShow.
The only way I have been able to have the controls group shown/hidden take effect is upon restart or when clicking the OK button in the profile manager. Both of which initDisplay is run.
Is there a way I can get around this and "reInit" the display from my own script?
Good day. I must be missing something. How do you define UI that will look relatively the same in all resolutions and aspect ratios?
I was using (straight from gui editor's 'Grid Macros')
#define UI_GRID_X (0.5)
#define UI_GRID_Y (0.5)
#define UI_GRID_W (2.5 * pixelW * pixelGrid)
#define UI_GRID_H (2.5 * pixelH * pixelGrid)
But still UI get completely different in scale based on player screen resolution ๐ค
The GUI Editor gives broken coordinates. You can use it for basic layout but the actually x,y,w and h values should be tweaked afterwards. See https://community.bistudio.com/wiki/Arma_3:_GUI_Coordinates
Thank you, R3vo. Unfortunately, I looked through that page and did not understand what exactly should I change in order to achieve unified view in all resolutions 
If you could give a hint, please?
Basically, you want your x and y values be anchored to either GUI_GRID_CENTER_X or GUI_GRID_CENTER_Y. Then you move them by adding or substracting GUI_GRID_CENTER_W and GUI_GRID_CENTER_H for Y. That means your are moving your controls in grids.
//--- Okay, will use entire available space:
x = GUI_GRID_CENTER_X + 0 * GUI_GRID_CENTER_W;
y = GUI_GRID_CENTER_Y + 0 * GUI_GRID_CENTER_H;
w = 40 * GUI_GRID_CENTER_W;
h = 25 * GUI_GRID_CENTER_H;
The default Arma 3 grid has 40 grids in width and 25 grids in height. That guarantees that even on the largest UI size the UI is displayed fully.
w = 40 * GUI_GRID_W;
h = 25 * GUI_GRID_H;
?
It's a complex topic so don't get discouraged if you don't get it immediately
Also, for new dialogs I would recommend using pixel grid.
Thank you, I'll try
I have a controls group that I can toggle on/off via a button to customise the look of the main menu. The preference is saved to profileNamespace and the controls group is shown/hidden with ctrlShow.
The only way I have been able to have the controls group shown/hidden take effect is upon restart or when clicking the OK button in the profile manager.
So when the button is clicked you run some code that should hide the controls group but it doesn't (always) work? Can you post the code?
Both of which initDisplay is run.
What is initDisplay?
Whoops, initDisplay (BIS_fnc_initDisplay) was not what I was trying to remember. I blame tiredness. ๐
What I meant to refer to was this comment in RscDisplayMain.sqf:
//--- Main menu display is loaded at start of the game and when returning from the profile menu
I'm using CBA and it's mod structure.
So in CfgEventHandlers.hpp I have this:
class Extended_DisplayLoad_EventHandlers {
class RscDisplayMain {
GVAR(loadMainMenu) = QUOTE(_this call COMPILE_SCRIPT(init_loadMainMenu));
};
};
Snippet from init_loadMainMenu.sqf:
// _getMenu is the variable saved in profileNamespace for the layout preference.
// Using switch as to choose from multiple main menu layouts.
switch (_getMenu) do
{
case 0:
{
// _enhancedMainMenu is the idc of the controls group.
_enhancedMainMenu ctrlShow true;
// _emm_button is the button with this EH.
_emm_button ctrlAddEventHandler ["ButtonClick", {
profileNamespace setVariable [QGVAR(mainMenuSelect), 1];
saveProfileNamespace;
_enhancedMainMenu ctrlShow false;
}];
};
case 1:
{
_enhancedMainMenu ctrlShow false;
_emm_button ctrlAddEventHandler ["ButtonClick", {
profileNamespace setVariable [QGVAR(mainMenuSelect), 0];
saveProfileNamespace;
_enhancedMainMenu ctrlShow true;
}];
};
};
The controls group itself is in a .hpp file included in RscDisplayMain.hpp.
Additionally, I can click the button, and it does nothing until the game is restarted, or I go into the profile manger and click OK.
Something's changed in the editor attributes?
Before (last year, a couple months ago),
CheckBox onLoad ->
Get checkbox cbchecked -> enable x controls from Ctrl grp, disable x controls from Ctrl grp.
Works onCbCheckedChanged event,
But not on onLoad event.
Tested with and without spawn (do I need add some wait ?)
Or do I need to do something else?
@tranquil iron just how did you managed the Blazer integration?!
Awesome work!
#dev_rc_branch message has link to the Github.
With some readme explaining the hacks I had to do
The EH code is not in the same scope as the _enhancedMainMenu variable, so _enhancedMainMenu is always undefined in the EH. Because of this, the ctrlShow statements in the EHs always fail and you see no ctrlShow effect when clicking the button.
Bonus problem: Let's say QGVAR(mainMenuSelect) was 0 when init_loadMainMenu.sqf ran. Now, the user clicks the button and QGVAR(mainMenuSelect) is set to 1. Next, the user clicks the button again to go back to the other layout - but nothing happens because the onButtonClick EH always runs the same code, even if QGVAR(mainMenuSelect) changes after the EH was added.
Well figured out.
By re-do all.
Issue, don't know.
But it seems onload return without spawn false even when the checkbox is selected,
With spawn + delay x , it returns true.
move
Could someone help me with getting this to work properly for both 16:9 and 21:9 ratio monitors, right now it works with 21:9, but the width of the RscText isn't wide enough when on 16:9 screen:
class OSDialog {
idd = 13371338;
movingEnable = 1;
enableSimulation = 1;
class controls {
class Background: RscPictureKeepAspect {
idc = -1;
x = safeZoneX - (safeZoneW * 0.675);
y = safeZoneY - (safeZoneH * 0.675);
w = safeZoneW * 2.35;
h = safeZoneH * 2.35;
text = "\SOG_OS\data\SPEARNET_FX_Monitor01_CA.paa";
};
class OS: RscText {
type = 106;
idc = 1338;
x = (safezoneX + (safezoneW - ((safezoneW/safezoneH) min 1.5))/2);
y = safezoneY + (safezoneH * 0.0825);
w = ((safezoneW/safezoneH) min 1.5);
h = safezoneH * 0.825;
};
};
};
Can you show me how it looks in 16:9 and 21:9?
First Image is 16:9, second image is 21:9:
So the issue here is usage of safeZoneX/W, which is not an absolute something but related to screen ratio etc. I would use Y/H to calculate the absoulte square, and convet to X/H. Multiply and/or divide with pixelW and pixelH could be a solution
Thanks for the info, I was able to get it to work using the pixel grid
How to resize RscControlsGroupNoScrollbars onLoad
Because if I want to ctrlShow false for 2 ctrls and set h size 2 Ctrls smaller.
https://community.bistudio.com/wiki/ctrlSetPosition + related commands?
Doesn't work.
It does something not expected.
It just goes messy with that.
But I assume you have a markup of your dialog, if so what is the problem with setting the right size in the markup?
Provide your code, screenshots, etc.
Depending on the selection from the combo box I enable those 2 Ctrls
So you need to change the size in onLBSelChanged EH of the combo control, not onLoad EH.
i have that but same result
Yeah, i will when i get same result than before.
I leaved and just disabled / changed colors etc.
But dont like this solution.
I will get back to you when i get some screen and code for you
doest matter do i use.
It doenst make scroll grp control heigh correclty.
Yes , it does inside it , but not area of it.
Don't know how to explain.
private _pos = ctrlPosition _grpCtrl;
_pos;
//_pos before changin H -> [0,0.02,0.78,0.308]
_grpCtrl ctrlSetPosition [0,0.02,0.78,0.396];
_grpCtrl ctrlCommit 1;
_grpCtrl ctrlSetPositionH 0.396;
_grpCtrl ctrlCommit 1;
Well figured out , but not easy solution.
I need setup my entrire rcs again.
As I understand it you have a structure like this ...
ControlsGroup G {
Control A {}
Control B {}
Control C {}
Control D {}
}
```... and you want to be able to reduce the height of `G` when you hide `C` and `D` without making `G` scrollable.
I'm pretty sure that `C` and `D` still take up space in `G` and force the controls group to be large enough to accommodate their (`x` and `y`) coordinates, even if the controls are invisible. So I think what you have to do is this:
```sqf
private _hG = (ctrlPosition G) # 3;
private _hC = (ctrlPosition C) # 3;
private _hD = (ctrlPosition D) # 3;
G ctrlSetPositionH (_hG - _hC - _hD);
G ctrlCommit 0;
{
_x ctrlSetPosition [0, 0, 0, 0];
_x ctrlCommit 0;
} forEach [C, D];
```Another option would be deleting and recreating `C` and `D` as needed (i.e. `ctrlDelete` and `ctrlCreate`), then you don't have to deal with the sizes and positions of controls that are disabled and invisible anyways.
Yes.
But that is created with Zeus attributen onload,
And yes.a
The second solution is better, that is what I took to use.
But still title, backround, content and ok/ cancel button need re-set.
Didn't realize where my issue was.
So structure is
class Controls: Controls {
class Background: Background {};
class Title: Title {};
class Content: Content {
class Controls {
class GVAR(scroll): RscControlsGroupNoScrollbars {
.....
So I need do my own or just do like it done in
"\a3\ui_f_curator\ui\displays\RscDisplayAttributes.sqf"
Hello. Is there some way of highlighting specific rows in a CT_LISTNBOX even when the control is disabled? I want to lock the CT_LISTNBOX and navigate through it via separate buttons.
Already tried that one, I'm afraid.
No joy.
So do you mean you don't want users to use mouse, but only keyboards?
No, I want the user to use the buttons provided on the UI element.
So entirely disabled input but only scripted ones
Basically I want to scroll through the lower part of this screen using the four directional button in the lower part.
Yes, no input on the ListNBox itself, only via script.
Not what I am looking for. I have implemented scrolling through the list already, it's the highlighting of whatever is selected that I am after.
So when user press Down Arrow, your screen should scroll "1" scroll part down in window?
Like user presses normal down arrow from scroll window down arrow
Yes, that is what I have achieved already. Pressing down arrow selects the next row in the list, successfully scrolling through the entire list, but it does not highlight whatever is selected, meaning it's near impossible to tell what is actually selected.
have you defined colorSelectBackground colorSelect etc?
Let me double check to be sure but I believe I already tried that as well.
Tried, doesn't work.
Might have to just overlay another element on top of an enabled ListNBox... Didn't work.
have you tried clicking the row? sounds like theres something funny going on....
Yep, I have, multiple times.
and no selection colors?
Nope, because it's a disabled control.
Just did, works perfectly fine when enabled, selection colors show up and all, but not when it is disabled.
Precisely.
ok what if you override the click event instead and leave the control enabled?
dont know if thats possible though
Hadn't considered that actually, but I doubt it's possible.
:/
I'll have to have a mighty think about this some other time, approach it with a new perspective.
Thank you anyways fellas
what if you use https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onLBListSelChanged and then just override the selection?
Does this support LNB though?
i thought so
oh its onLBSelChanged for LNB
hope you dont endup in inifite loop though if you reselect the item via script command
Just create your own highlight with a frame build from some CT_STATIC controls.
You can get the position in the mouseMoving event.
Yeah, I figure that'll be the best solution at this point.
_w = safeZoneW * 0.5;
_h = safeZoneH * 0.5;
_x = (safeZoneX + safeZoneW) - _w;
_y = ((safeZoneH - _h) / 2 + safeZoneY);
Need help making this ctrl box centered vertically and stick to the left side of the screen.
_x = safeZoneX;
_y = 0.5 - _h/2;```
Is there anyway to center a structured text vertically? at the moment its only centered horizontally.
yeah but its broken for RscStructuredText
i wonder if theres another way to vertically align
i'd assume vertically aligning the entire control could do that 
Hey i am trying to add a custom video on main menu using this class videoOverlay : RscVideo { idc = -1; x = "safezoneX + (safezoneW / 2) - (4 * pixelW * pixelGrid * 2)"; // Center horizontally y = "safezoneY + (safezoneH / 2) - (4 * pixelH * pixelGrid * 2)"; // Center vertically w = "16 * (pixelW * pixelGrid * 2)"; h = "16 * (pixelH * pixelGrid * 2)"; autoplay = 1; loops = 1; video = "gac\video\intro.ogv"; text = "gac\video\intro.ogv"; };
but i am unable to see it, while in pbo there is inside the ogv file
why isnt a thing anymore to play a video on main menu? only static image
Do you have the static background launch parameter on?
have you tried with existing videos?
yes
i would like to get an example config although just to be sure i am doing this correctly
use config browser to find the GUIs
Managed to play my video but in the spotlight so i guess i have to work also with sqf to make it work correctly
Oh ok i am totally totally dumb, my mistake was on Addon builder, i forgot to add some extensions...
Anyone knows which class refers to the grey image when static background is selected?
Hey guys, is there any tool out there besides the vanilla GUI editor that is easy to use for creating more complex GUIs? I'm trying to make essentially a tablet that has "tabs" which will display certain control groups. I know how to do what I want i just want to know if there is a tool out there that makes creating the GUI configs easier so i don't have to constantly reload my mission every time i make a correction to the GUI
No Tool for that.
You don't have to reload your mission. Just save it and create the UI in eden editor
how would you go about creating multiple overlapping control groups then?
also the GUI Editor doesn't seem to have all available types/styles. Ex: toolboxes
it doesnt but you can edit the type field and do something like: BuyGunner : RscImgButton for any class you want and it will become (When exported) class BuyGunner : RscImgButton
So i have created a CT_TOOLBOX control and can not get any events to fire on it. I have done both class definition of the event onLBSelChanged and tried applying the event via code ctrlAddEventHandler and neither seem to be working. I have also tried the alternative onLBListSelChanged w/o success
does fire on my machine
@crude berrymy hero lol. Wiki says that they take LB events which makes no sense seeing that lol
Hey, Im looking into getting the camera to change to the selected unit but it seems to choose one and then never change. Any hints?
_cam = missionNamespace getVariable "_cam";
_index = lbCurSel 1500; //reference to RscListBox containing units
_unit = playerListArray select _index;
if (isNil "_cam") then {
_cam = "camera" camCreate [0, 0, 0];
} else {
camDestroy _cam;
_cam = "camera" camCreate [0, 0, 0];
};
_unit = playerListArray select _index;
_eyeDir = eyeDirection _unit;
_cam setVectorDir _eyeDir;
_cam cameraEffect ["INTERNAL", "BACK", 'soldierCam1'];
_cam camSetFov 0.7;
_cam attachTo [_unit, [0.12, 0, 0.15], "Head", true];
missionNamespace setVariable ["_cam", _cam];
and the RscPicture:
class RscPicture_1201: RscPicture
{
idc = 1220;
text = "#(argb,1024,1024,1)r2t(soldierCam1,1)";
x = 0.52686 * safezoneW + safezoneX;
y = 0.5 * safezoneH + safezoneY;
w = 0.0805814 * safezoneW;
h = 0.132 * safezoneH;
};
What to choose and what never changes
hi, i'd like to create a new GPS item for infantry that is capable of both showing the GPS and also the sensor panel that's usually available to vehicles. the idea is letting infantry access their side's datalink with this item, just so they can see what's on the datalink, but they can't report anything back like vehicles. how possible is this and would anyone be willing to point me in the right direction?
Doesn't sound easy, probably gonna have to emulate it instead of using premade engine handling for the sensor panels
Is there a way to make a control inherit the angle (ctrlsetangle) of its mommy control? When I ctrlsetAngle on the mommy, the baby control doesn't get its angle set.
(What I want is to have a mommy control i rotate constantly with the baby controls attached to her)
If that doesn't work out of the box then you likely will have to rotate the child separately
yeah
slightly complicates things (and makes me have no reason to have a mommy control now)
iirc the setangle stuff is limited to picture/text becasue its actually spinning the graphic the control itself remains static
you can see this if you make your graphic not have big enoughj margins and it'll cut the corners off
Ah, no way to rotate the control itself, then?
yeah
i shall Set The Angle Elsewise then
no
๐ฆ no mommy rotating her kittens
I am trying to understand RscInGameUI a bit more, fopr the x/w position of children controls are they relative to the parents position? Lets say I have something like this
class testrsc
{
class Controls
{
class testControl1: RscControlsGroup
{
class Controls
{
class testControl2: RscText
{
};
};
};
};
};
whatever x/y values I pick for testControl2 are they relative to the top left hand corner of where textControl1 is? Not sure wat the best way to convey my question ๐
for groups - yes for sure, the control's x/y are relative to containing group top left corner. That's, like, the entire point of groups :3
cool cool
For RscInGameUI that are for optics like on scopes when is the onUnload triggered? when I stop aiming down the sight or when I take the scope off the gun?
hi.
For a fancy timeskip i like to use the normal watch display (key: O) and to enlarge it to be visible on the whole screen - inspired by the SOG PF RON Scenes.
Im having a hard time figuring out how to find the right display and whatelse, since i have 0 experience with working with gui.
Just find the control by its idc
how would i find the right control/idc?
you need to check the config to find where it's located.
I thought its in RscDisplayBriefing but I couldn't find it there
I found RscWatch which has the right p3d at least
good
i also noticed that closing display 12 makes the O key Wristwatch not work anymore
but beyond that, im kinda clueless
You can get the watch likes this
{
if (ctrlClassName _x == "RscWatch") exitWith {//found it};
} forEach (allControls findDisplay 46);
ignore last, found an error
_found = false;
{
_display = _x;
{
diag_log format ["Display: %3, IDC: %1, className: %2", ctrlIDC _x, ctrlClassName _x, _display];
if (ctrlClassName _x == "RscWatch") exitWith { diag_log "FOUND IT!"; _found = true; };
} forEach (allControls _x);
} forEach allDisplays;
diag_log str _found;
returns false
but i found those
23:57:37 "Display: Display #49, IDC: 11886, className: WatchBackground"
23:57:37 "Display: Display #49, IDC: 11893, className: WatchText"
23:57:37 "Display: Display #49, IDC: 12285, className: WatchInput1"
23:57:37 "Display: Display #49, IDC: 12286, className: WatchOutput1"
23:57:37 "Display: Display #49, IDC: 12287, className: WatchInput2"
23:57:37 "Display: Display #49, IDC: 12288, className: WatchOutput2"
23:57:37 "Display: Display #49, IDC: 12289, className: WatchInput3"
23:57:37 "Display: Display #49, IDC: 12290, className: WatchOutput3"
23:57:37 "Display: Display #49, IDC: 12291, className: WatchInput4"
23:57:37 "Display: Display #49, IDC: 12293, className: WatchOutput4"

thats the debug console
oh, the watch monitor
the watch only exists when the map screen is open
So maybe attach it to an load event there or "openMap" MEH
I can take another look at it tomorrow. Ping me on ACE discord if you want tomorrow.
yes please
Hello :D
Quick question, is it possible to display custom UI during the briefing screen in multiplayer? [The screen before loading into the mission].
I said yes because it's a yes. Global Mobilization did it in their mission too
I tried with a little attempt earlier and it failed so I thought to check again ๐
GUI is pain ;-;
GUI is love
Baby don't hurt me... anyways
See? A dude with GUI knowledge is there
I just can't touch PC for more hours
Always has been
But yea, I've always hated the visual and design aspect of writing code, seems like I end up having to do it almost no matter what xD
Ah welp, good time to learn I guess
Basically (and IIRC) init.sqf runs when the mission briefing has started. Which means you can do whatever with it
I tried running it from initPlayerLocal.sqf since that also runs during briefing screen
My mouse turned glitchy [disapears and appears] when the code to call it was executed
What you've done?
Uh
So I tried building the UI with ADC [Arma Dialog Creator] then exported it. It showed in the editor and in-game when I loaded in, but when I tried running it during briefing screen, it didn't.
I found about ADC while looking for tutorials on youtube which made it seem like maybe an easier way of doing things.
It seems not so wrong, then how do you run in briefing?
In initPlayerLocal.sqf I used createDialog "MyDialogPlan";
Try findDisplay 12 createDisplay "MyDialogPlan"
Will do, trying now
Nothing happens
Even when executed after being loaded into the mission
You could also try to execute it preInit with cba_waitUntilAndExecute
if (isMultiplayer) then {
// Wait for client to be in the briefing. or past it.
waitUntil {getClientStateNumber >= 8};
};
this is what we do to show voting UI in briefing
Can do, but would don't think that would fix the issue I am currently at.
That specifically being that with findDisplay 12 createDisplay "MyDialogPlan" nothing shows even when loaded in and with createDialog "MyDialogPlan"; it glitches, I can try none th less though.
How do you test it?
if (isMultiplayer) then {
// Wait for client to be in the briefing. or past it.
waitUntil {getClientStateNumber >= 8};
systemChat "ACTIVE";
findDisplay 12 createDisplay "MyDialogPlan";
};
I ran the following in initPlayerLocal.sqf
And SP or local MP or Dedicated? (I know it is obvious question but try to clarify)
I also ran findDisplay 12 createDisplay "MyDialogPlan" in the debug console once loaded in and it did nothing, instead it returned:
Display #1234
Local MP
This actually does mean the display itself is running
findDisplay 12 part means create it on the map display
So you may see nothing not in the map
Could it be that the briefing screen is different than the map...?
Affirm, I can see the result
Try 70 instead of 12
Doing
From a quick check on the wiki this might be it, here is hopping
Uhhhh interesting
So it shows now... but it hides the map screen behind it?
๐ค
https://community.bistudio.com/wiki/createDialog
What about createDialog's alt syntax?
Attempting
Uhhhh nothing happens at all, instead I got an error
findDisplay 70 createDisplay ["MyDialogPlan", true];
Oh
Wrong command
Potato
IT'S ALIVE!
rawr
I'd huge you right now if I could
Now time to figure out why my text bar at the top is black instead of blue and how to make this look half presentable and nice looking
Prob won't get too far with ADC but still better than nothing
So this is what I have right now
How would I go about adding a border similar to the one in this picture through the config?
its a CT_FRAME control
Got a link where I can find info on that?
anyone good at doing safezone stuff using ui on texture? Reading up on it, it would feel like safeZoneW and safeZoneH wouldn't work since thats my monitor and not the display its being rendered on. Trying to center a piece of text of fixed width with monospace font on the middle of the display
Am I right to understand you are trying Ui2Tex?
correct. Using the big single screen rugged monitors (Land_TripodScreen_01_large_black_F)
Seems like the safezones actually apply after some testing as you set the render resolution in the procedural texture call
IIRC safeZone is not really a thing you want to use there. You can really use x, y, w, h = 0, 0, 1, 1 to make 1:1 ratio texture
Yeah I figured it out. Switching to structured text and keeping the 1:1 ratio.
Haven't worked much with dialogs before because dialogs are scary so just wrapping my head around everything now
I haven't really recall how it really works, but Cougar from RF CDLC's screen is one example I made
There is no safe zone, 0,0 and 1,1 are top left and bottom right corner of the texture
If object displays square texture as rectangle by stretching it, then you'll need to figure out stretch ratio and account for it
Many objects only display part of the texture to keep texture data displaying 1:1 (example map board)
bottom and top bands of the texture are simply not visible
Its a bit more complicated if texture is not 1:1, you'll need to use uiEx to adjust the viewport
Is there any way to set positions relative to the parent block, without taking into account safezone?
_display = findDisplay 46 createDisplay "RscDisplayEmpty";
private _ctrlGroup = _display ctrlCreate ["RscControlsGroup", 8000];
_ctrlGroup ctrlSetPosition [safeZoneX, safezoneY, safeZoneW, safezoneH];
_ctrlGroup ctrlCommit 0;
private _one = _display ctrlCreate ["IGUIBack", -1, _ctrlGroup];
_one ctrlSetPosition [0, 0, 1, 0.1];
_one ctrlSetBackgroundColor [0,1,0,1];
_one ctrlCommit 0;
private _two = _display ctrlCreate ["IGUIBack", -1, _ctrlGroup];
_two ctrlSetPosition [0, 0.1, 1 * safeZoneW, 0.1 * safeZoneH];
_two ctrlSetBackgroundColor [1,0,0,1];
_two ctrlCommit 0;
Inside groups, XY are relative to group, WH are relative to viewport (screen)
private _ctrlGroup = _display ctrlCreate ["RscControlsGroup", 8000];
_ctrlGroup ctrlSetPosition [safeZoneX, safezoneY, safeZoneW, safezoneH];
_ctrlGroup ctrlCommit 0;
ctrlPosition _ctrlGroup params ["", "", "_group_w", "_group_h"];
private _one = _display ctrlCreate ["IGUIBack", -1, _ctrlGroup];
_one ctrlSetPosition [0, 0, _group_w, 0.1];
_one ctrlSetBackgroundColor [0,1,0,1];
_one ctrlCommit 0;
private _two = _display ctrlCreate ["IGUIBack", -1, _ctrlGroup];
_two ctrlSetPosition [0, 0.1, 1 * _group_w, 0.1 * _group_h];
_two ctrlSetBackgroundColor [1,0,0,1];
_two ctrlCommit 0;
I guess you wanted that
is there a way to create a dialog, that wont close when pressing 'esc' rather, the main menu of arma 3 will overlap the dialog, or is it not possible?
sounds like you need https://community.bistudio.com/wiki/cutRsc
how would it work? my dialog is in a .hpp file.
you need to register it as RscTitles
I am a bit lost in the wiki, does it say anywhere how I can open it using cutRsc?
It shows createDisplay, and it works but it still has the same issue as createDialog.
("MainMenu" call BIS_fnc_rscLayer) cutRsc ["MainMenu", "PLAIN"];
findDisplay 46 createDisplay "MainMenu";
I did something like this, but I am bit lost here, it still has the same issue.
see HUDs in the wiki, there's example config button
so I have to copy and paste my entire .hpp file inside RscTitles class?
yes or put there #include if you prefer that
{
titles[]={MyDlgClassNameHere};
#include "myDlg.hpp"
};```
ok, works now, but another thing, my dialog includes buttons, lists, etc.
its like a main menu for my scenario, however the display pops up while the player still is able to run, shoot, etc.
oh yeah you cant click rsc buttons
oh so its best to just use createDialog then?
or https://community.bistudio.com/wiki/createDisplay if that works for you
private _display = findDisplay (uiNamespace getVariable "mainmenu");
_display createDisplay "mainmenu";
trying so far, this doesn't seem to work.
class RscTitles
{
class MainMenu
{
idd = 3100;
fadein = 0;
fadeout = 0;
duration = 1e+011;
onLoad = "uinamespace setVariable ['MainMenu',_this select 0]";
onUnLoad = "uinamespace setVariable ['MainMenu', nil]";
class Controls
{
this is whats inside my hpp file
if you use createDisplay then you should define the dialog like you did with createDialog
rscTitles are only for cutRsc stuff
ah well, it works now, just same issue as before. so i guess theres no workaround with this?
dunno, if you want to move with player i dont think you can click dialogs, in arma. i could be wrong though
Prefix your classes and variables
client_func_lobby_onKeyDown = {
params ["_display", "_code", "_shift", "_ctrlKey", "_alt"];
switch(true) do {
case(_code == DIK_ESCAPE): {
//_display createDisplay "RscDisplayInterrupt";
findDisplay 46 createDisplay "RscDisplayInterrupt";
true;
};
default {false};
};
};
```How I have it
How it looks in game
class MainMenu
{
idd = 3100;
onKeyDown = "_this call client_func_lobby_onKeyDown";
class Controls
{
I did this, but it doesn't work.
If you copied the code directly you'll need to include DIK_ESCAPE defines
i do have it defined
You're doing something wrong then, it works for me
Add hints\systemChats to see what's going on
in initSever.sqf
client_func_lobby_onKeyDown = {
params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"];
switch(true) do {
case(_code == DIK_ESCAPE): {
//_display createDisplay "RscDisplayInterrupt";
findDisplay 46 createDisplay _displayOrControl;
true;
};
default {false};
};
};
class MainMenu
{
idd = 3100;
onLoad = "(_this select 0) displayAddEventHandler ['KeyDown', { _this call client_func_lobby_onKeyDown;}];";
in the .hpp
You need DIK defines in that file
Also why server? UI is client side
just testing
Add debug chats to see what gets reached
do i add defines in the .hpp file? because mine is in description.ext
You need to include it in every script
oh
the defines with DIK keys
it works, but it overrides the ESC key so its stuck on the dialog.
func_keyDown = {
params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"];
switch(true) do {
case(_key == 1): {
//_display createDisplay "RscDisplayInterrupt";
findDisplay 46 createDisplay "MainMenu";
true;
};
default {false};
};
};
the fix was just putting 1 on the _key
Isn't this exactly what you wanted, open the main menu instead of closing your display?
yeah, but i thought the escape menu would still open while keeping the dialog opened in the background ๐คฃ
i thought i would achieve this
Well this is exactly how I did it
My display is simply createDialog "Dialog_Lobby";
Nothing fancy
Short question. When you have a tree view that has selectable items. How do you expect them to be selected and deselected? Double Click? Single click? Something else?
Is this a generic UI/UX question?
Kinda. I mean I know the answer already, you would expect the checkbox to be clickable but that's super annoying to do
So it's just an Arma question really.
If the checkbox are multiply enable-able, I'd take double click
single item to be selected. Just single click.
Multiple, ctrl+single click
Select AND confirm and close dialog, double click.
oh noo, how I have to implement multi select. Haven't done that in a while 
LB_MULTI style?
Hoping someone can help me here - I'm working on a custom Main Menu interface for my unit which I've nearly got working completely, I have two small issues that I need help with:
- When I click the left tile, it opens our TS as I would expect however it also opens up the 'Quick Play' menu, is there a way to stop this from happening?
- The middle tile in the screenshot isn't being deleted as the EF DLC is loaded after this PBO, how do I ensure this PBO is only loaded once EF is fully loaded? EF DLC isn't a required DLC but may be ran from time to time
The middle tile in the screenshot isn't being deleted as the EF DLC is loaded after this PBO, how do I ensure this PBO is only loaded once EF is fully loaded? EF DLC isn't a required DLC but may be ran from time to time
Make a pbo that deletes the middle tile when EF is loaded. There is a cfgPatches entry that makes it skip that pbo if required addons isnt loaded (EF)
Within the UI PBO I've done this but just doesn't apply because when someone boots with EF it's loads after
So I've done something similar but I can't put "EF_UI" into required Addons as it's an optional DLC for the guys but if they do run it I want to delete the mission
You can make a separate config, require EF, skipWhenMissingDependencies=1
Interesting, I'll give that a try - could I put that within this config?
Any idea on the 1st issue Deadmen?
https://discordapp.com/channels/105462288051380224/616327617725071373/1357748928233345165
You can make another config.cpp inside a different folder.
Hi, I'm making radio for tfar and don't know how to count gui units. Without any safezones i just divided pixels between button location and screen border by resolution for example: 280 : 1920 and got my X value, but I want it to be compatible with different resolutions and use safezones. So how do I count this number or gui unit that I can place instead of N?
x = "safezoneX + (((safezoneW / safezoneH) min 1.2) / 40) * N";
How to repeat the action of the button with a change in the number of maxSatelliteAlpha to CT_MAP_MAIN In the same way as it is done here
class ctrlMapMain_1: RscMapControl
{
idc=1001;
x = GroupX;
y = GroupY + TitleWindowH;
w = GroupW;
h = GroupH - TitleWindowH;
maxSatelliteAlpha = 1.0; // <<<<-how to change using commands???
};
mapOrientation = 1;
/*
Allow follow direction from player (in root class)
class my_best_map:RscMapControl
{
mapOrientation = 1;
idc=n
x = n;
y = n;
w = n;
h = n;
};
https://community.bistudio.com/wiki/CT_MAP_MAIN
mapOrientation is not Found in biki
//Tag words for Search Rotate Map Direction CT_MAP_MAIN Angle
bonus
showTacticalPing = 1;// 0 - no show on CT_MAP_MAIN. 1-show on CT_MAP_MAIN
Does anyone know how to pass more than one variable to a function via ctrlAddEventHandler? Currently I have sqf _ctrlButtonOK ctrlAddEventHandler ["ButtonClick", "[_ctrlButtonOK, _unit] call _fnc_onConfirm"]; but it doesn't seem to want to pass the _unit param.
I feel like I am missing something painfully obvious here.
EH code is a separate script, it can't see private variables of wherever you're adding it from 
you can use the control as a target for https://community.bistudio.com/wiki/setVariable (i.e. _ctrlButtonOK setVariable ["MUH_unit", _unit];). And from within the EH the control itself is available as the first passed parameter https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onButtonClick 
Guys I keep getting this and itโs really annoying what am I supposed to do
Fix your script
I donโt have any scripts
I donโt even know how to script on arma
Then remove your Mods that is somehow broken. Or don't play the mission that causes this issue
There is nothing we can do without knowing the exact situation or the code. If you don't know, there is absolutely nothing we can do
I donโt know which mod is causing is this
Ok got it
Then unload Mods that you don't know what they do
Open your rpt. If you are lucky there is more information for example like a TAG that points to a mod.
!rpt
Arma generates a .rpt log file each time it's run, which contains a lot of information like the loaded mods, or any errors that appear, this log file can be very useful for troubleshooting problems.
To get to your RPT files press Windows+R and enter %localappdata%/Arma 3
Additionally see the wiki page for more info: https://community.bistudio.com/wiki/Crash_Files
To share an rpt log here, please use a website like https://pastebin.com/ (Set expiry time to 1 week or less) to upload the full log, that way the people helping you can take a look at it and try to figure out the problem you're having together with you.
Note: RPT logs can hold personal information relevant to your system, the game or others.
Oh ok thanks a lot
Looking for any information on where the command bar or commanding menu displays are defined, or how to get any sort of handle on their display elements.
@opaque crag Somebody had a similar question a while ago: #arma3_gui message
I've got a simple gui set up just to learn about listNbox, but I'm failing to make the listNBox appear on my screen when I call it, I've already got the base class (tested with import and manually placing each element of the base class), is there anything in special I have to do besides getting the base class?
Are you using lnbAddColumn and lnbAddRow to populate it?
my intend is to use those, but not even the empty "frame" appears, is that normal for listNbox?
I don't know, but it could be. Did you set a colorBackground?
Are you using macros for coordinates and are you sure those are defined?
this is all that I've got, at least with lnbAddColumn and lnbAddRow I could select something, but the thing is still invisible
RscListNBox is already defined
and even I've got it directly from configs, each element
Looks correct. Can't check tonight as it's super late already.
np, I'll keep trying
So what data did you add exactly, and is that screenshot for selected or not selected?
https://community.bistudio.com/wiki/CT_LISTNBOX#BIS_fnc_initListNBoxSorting_Example
Have you seen the example with BIS_fnc_initListNBoxSorting? It has config and code (though it extends ctrlListNBox, not RscListNBox). Could be a useful reference, even if BIS_fnc_initListNBoxSorting is not the same as using pure CT_LISTNBOX.
The background color of RscListbox_1500 is the same as its text color.
first I want to learn how to add stuff in this kind of listbox with random data, in the future I want to use it in a GUI that I'm working on, the idea is to do something like this:
Index/pylon | Magazines | Ammo count
I know how normal lb works, In this example I've tested with RscListBox and it works (the frame appears).
I've seen that example, but didn't tried since it should work normally with just the base class of it
Still have trouble with it?
I can make the data show up in the gui, but the "frame" is invisible
- Nothing selected
- Selected
- Unselect
Yeah, like a normal listbox, if this lnb doesn't have one, I make my own like you've said
Normal RscListBox
I have a recollection that one of those was bugged and didn't render a background.
But I replaced both RscListNBox uses we had with custom controlsGroup stuff due to other limitations, so the comment went missing :P
How to open one display on top of another, like i have created dislay with menu, and them want to create anther menu display within it, like its part of it?
Short answer: You can't really have multiple displays open at once.
Longer answer:
1๏ธโฃ #arma3_gui message
2๏ธโฃ #arma3_gui message
Recommended solution: Use a single display that contains multiple controls groups.
followed that example
well it seems like some commands for it are bugged too. I can't get _valueAmmoCount. It always returns "0". Am I doing something wrong with this code? My brain tells this is correct.
_magazineColumn = lnbAddColumn [1500, 0];
//uiNamespace setVariable ["PIG_magazineColumnNumber", _magazineColumn];
_ammoCountColumn = lnbAddColumn [1500, 0.8];
//uiNamespace setVariable ["PIG_ammoCountColumnNumber", _ammoCountColumn];
lnbSetColumnsPos [1500, [0, 0.8]];
{
_mag = (_x # 0);
_amount = (_x # 2);
if (_amount == 0) then { continue };
_name = getText(configFile >> "CfgMagazines" >> _mag >> "displayName");
_description = getText(configFile >> "CfgMagazines" >> _mag >> "descriptionShort");
if (_name isEqualTo "") then {_name = _mag};
_rowIndex = lnbAddRow [1500, [_name, str _amount]];
lnbSetTooltip [1500, [_rowIndex, _magazineColumn], _description]; // Not working
lnbSetData [1500, [_rowIndex, _magazineColumn], _mag];
lnbSetValue [1500, [_rowIndex, _ammoCountColumn], _amount];
}forEach (magazinesAllTurrets _plane);
(displayCtrl 1500) ctrlAddEventHandler ["LBSelChanged", {
params ["_control", "_lbCurSel", "_lbSelection"];
_dataMagazine = _control lnbData [_lbCurSel, 1]; // Magazine column
_valueAmmoCount = _control lnbValue [_lbCurSel, 2]; // Ammo count
systemChat format["%1, %2", _dataMagazine, _valueAmmoCount];
}];
Don't use the IDC variants. use to the control ones
same effect...
- but I can get the value if I remove
lnbSetColumnsPos, but then the columns get all together - with
lnbSetColumnsPos
Seems like is something that I don't understand ๐
well for tooltips, I didn't read that, let me check it
_valueAmmoCount = _control lnbValue [_lbCurSel, 2]; // Ammo count
The column indices are wrong
They start at 0
//uiNamespace setVariable ["PIG_ammoCountColumnNumber", _ammoCountColumn];
What you did here is actually good, just don't save it in UI namespace but on the control itself
then you can always access it from within the events
oh, never thought saving on the control
Yeah, I used the variable there and now it's working, also, the tooltip is woking
I've putted 1 in there because I debug that index for first column and I got "1", and after a "2" for ammo count... weird
I think it's actually still wrong. Can you post the working code?
When you create a CT_LISTNBOX, it already has one column by default (this is not documented on the Wiki, I only know this because I wrote it down in a code comment years ago ๐). That initial column has index 0. So when you run _lnb lnbAddColumn 0.5 you add a second column (with index 1). You now have two columns, even though you used lnbAddColumn only once. The first column starts at x = 0 and ends where the second column starts, which is at x = 0.5 in this example. In your case there are three columns (because you run lnbAddColumn twice).
That explains why you got _magazineColumn = 1 and _ammoCountColumn = 2 when you were debugging. It doesn't yet explain why you couldn't get _valueAmmoCount.
Because you did get _valueAmmoCount when you removed lnbSetColumnsPos I believe that lnbSetColumnsPos actually removes the three columns that exist after the two lnbAddColumn statements and replaces them with two columns.
The lnbSetData, lnbSetValue, lnbData and lnbValue then use indices that are off by one because lnbSetColumnsPos has "moved" the magazine column from index 1 to index 0 and the ammo count from 2 to 1.
Step by step:
_magazineColumn = lnbAddColumn [1500, 0]; //Return value: 1. Columns: [0, 1]
_ammoCountColumn = lnbAddColumn [1500, 0.8]; //Return value: 2. Columns: [0, 1, 2]
lnbSetColumnsPos [1500, [0, 0.8]]; //Columns: [0, 1]
{
//...
_rowIndex = lnbAddRow [1500, [_name, str _amount]]; //Uses columns 0 and 1.
//...
lnbSetData [1500, [_rowIndex, _magazineColumn], _mag]; //Uses column 1 (instead of column 0, where the magazine name is actually displayed).
lnbSetValue [1500, [_rowIndex, _ammoCountColumn], _amount]; //Uses column 2 (which doesn't exist) โ Fails silently?
} forEach (magazinesAllTurrets _plane);
(displayCtrl 1500) ctrlAddEventHandler ["LBSelChanged", {
params ["_control", "_lbCurSel", "_lbSelection"];
_dataMagazine = _control lnbData [_lbCurSel, 1]; //Uses column 1.
_valueAmmoCount = _control lnbValue [_lbCurSel, 2]; //Uses column 2 (which doesn't exist) โ Returns default value 0.
systemChat format ["%1, %2", _dataMagazine, _valueAmmoCount]; //Output: "<magazine name>, 0"
}];
_control = (displayCtrl 1500);
_magazineColumn = _control lnbAddColumn 0;
_control setVariable ["PIG_magazineColumnNumber", _magazineColumn];
_ammoCountColumn = _control lnbAddColumn 0.8;
_control setVariable ["PIG_ammoCountColumnNumber", _ammoCountColumn];
{
_mag = (_x # 0);
_amount = (_x # 2);
_name = getText(configFile >> "CfgMagazines" >> _mag >> "displayName");
_description = getText(configFile >> "CfgMagazines" >> _mag >> "descriptionShort");
if (_name isEqualTo "") then {_name = _mag};
_rowIndex = _control lnbAddRow [_name, str _amount];
if (_amount == 0) then {
_control lnbSetColor [[_rowIndex, _magazineColumn], [1,0,0,1]];
_control lnbSetColor [[_rowIndex, _ammoCountColumn], [1,0,0,1]]
};
_control lnbSetTooltip [[_rowIndex, _magazineColumn], _description];
_control lnbSetData [[_rowIndex, _magazineColumn], _mag];
_control lnbSetValue [[_rowIndex, _ammoCountColumn], _amount];
}forEach (magazinesAllTurrets _plane);
_control ctrlAddEventHandler ["LBSelChanged", {
params ["_control", "_lbCurSel", "_lbSelection"];
_dataMagazine = _control lnbData [_lbCurSel, _control getVariable "PIG_magazineColumnNumber"]; // Magazine column
_valueAmmoCount = _control lnbValue [_lbCurSel, _control getVariable "PIG_ammoCountColumnNumber"]; // Ammo count
systemChat format["%1, %2", _dataMagazine, _valueAmmoCount];
//copyToClipboard _dataMagazine;
}];
Yea, that code should still be creating three columns, but the indices work out because there is no lnbSetColumnsPos.
I'm confused as to why _control lnbAddRow [_name, str _amount] works though. The first column should have width 0, so the magazine name should be invisible in the dialog ๐ค
Does systemChat str [_magazineColumn, _ammoCountColumn] give you [1, 2]?
[0, 1]
about the gatling gun... weird that a vanilla magazine doesn't have displayName in configs, is there a way to get the name of it in another place? In the game it's called "Minigun 30 mm"
Can fall back on displayNameShort
empty string 
Wait that's for stuff like "HE" in the top right meny, not sure if there is a good fallback
I guess check where "Minigun 30 mm" is defined, gotta be in the config somewhere
I believe in you haha but no luck so far
I don't know about "width" in that case. But afaik, 0 to 1 is the position in the control, 0 to the left, 1 to the right.
I've checked with this command systemChat str (lnbSize 1500) and it returned
[13, 2]
Yes... No have displayname in config.
only in Inherited
so no
does someone know if I can create the webbrowser ui via script ?
disableSerialization;
private _display = (findDisplay 46) createDisplay "RscDisplayEmpty";
private _browser = _display ctrlCreate ["RscWebBrowser", 9999];
_browser ctrlSetPosition [safeZoneX + 0.2, safeZoneY + 0.2, safeZoneW * 0.6, safeZoneH * 0.6];
_browser ctrlCommit 0;
_browser ctrlSetURL "file://ui/upgrade_module.html";```
dosent seem to work
-
WebBrowser is a 2.20 feature, which isn't released yet.
You can test in on profiling branch, but then everyone needs to be on it. -
RscWebBrowser by default doesn't exist, you need to create that class by yourself in your own config. And if you do that, you should TAG your class to not conflict with others
By no crossposting I meant you should leave your message here and not move it
The A3API does that. Request and async response.
https://github.com/dedmen/ArmaWebBrowserTests/blob/master/JavascriptWebpack/src/A3API.ts#L2
Every request starts a promise, and keeps a pending request.
When the response comes back, its resolved.
You can re-use the A3API system for it.
JS: ```js
static RequestThing(key: string, stuff: string): Promise<string> {
return new Promise((resolve, reject) => {
if (A3API._push(HungryThing:${btoa(key)}, { resolve, reject })) // Only if new request, and not already queued
A3API.SendAlert(HungryThingRequest;${stuff}); // Probably base64 encode it too?
});
};
And reply from game with ExecuteJS: `format ["window.A3API._response(atob(%1), %2)", key, value]`
@rose wadi
I should put that onto the wiki page (this is a note for me to remember that someday or tomorrow)
Thank you, it works like that
if (_messageType == "RequestChatHistory") then {
_targetType = _messageComponents select 1; // "player" oder "group"
_targetId = _messageComponents select 2; // UID oder Groupname
if (isNil "a3s_chatHistory_player") then { a3s_chatHistory_player = createHashMap; };
if (isNil "a3s_chatHistory_group") then { a3s_chatHistory_group = createHashMap; };
_source = if (_targetType == "player") then { a3s_chatHistory_player } else { a3s_chatHistory_group };
_log = _source getOrDefault [_targetId, []];
_json = str _log;
private _key = format ["chat:player:%1", _targetId];
private _response = str _log;
private _cmd = format [
"window.A3API._response('%1', `%2`);",
_key,
_response
];
_ctrl ctrlWebBrowserAction ["ExecJS", _cmd];
};```
function openChatWithPlayer(name, uid) {
if (!chatStore.player.has(uid) && typeof A3API !== "undefined") {
A3API.RequestChatHistory("player", uid, name);
} else {
showChatWindow("player", uid, name);
}
}
A3API.RequestChatHistory = function (type, id, displayName) {
const key = `chat:${type}:${id}`;
return new Promise((resolve, reject) => {
if (A3API._push(key, { resolve, reject })) {
A3API.SendAlert(`RequestChatHistory:${type}:${id}`);
}
setTimeout(() => reject("Timeout"), 2000);
}).then((rawJson) => {
const historyArray = JSON.parse(rawJson);
if (!chatStore[type].has(id)) {
const decodedHistory = historyArray.map(([who, msg]) => {
const decodedMsg = fromBase64(msg);
return { who, msg: decodedMsg };
});
chatStore[type].set(id, decodedHistory);
}
showChatWindow(type, id, displayName);
}).catch((err) => {
console.warn("Chat history unavailable or timeout:", err);
// still open a blank chat window
if (!chatStore[type].has(id)) {
chatStore[type].set(id, []);
}
showChatWindow(type, id, displayName);
});
};```
For my chat app, I just implemented a json messaging stuff.
App sends json blob to game.
https://github.com/dedmen/ACE3/blob/MessagingApp/addons/tacphone/apps/messaging/functions/fnc_handleAppMessage.sqf
Game sends json blob back to app
https://github.com/dedmen/ACE3/blob/MessagingApp/dev/lit-element-starter-js-main/dev/main.js#L209
That way you can't really await a result, but I haven't needed that yet
Yea I did the same before but wanted to learn smth new, but will probably go back to the old system
Im also saving it in profilenamespace, so the server dosent know the chat but for an group chat the server side is definitely needed if the player should receive offline messages
yeah I also have a full server-side state and JIP handling in my thing, most of it is in postInit probably
that looks very nice Hungry. Does this look like something people can do 100% of their UI in?
You mean if people can easily learn it?
Yea I think, it took me like 4 days to learn Javascript and the HTML part is easy.
But for most people they don't know where to start, someone should make an Arma tutorial to showcase everything
I have some samples on my github. But its not really a tutorial if you don't already know Arma UI and Javascript
I'd love to have some guide on the wiki page for it, but I cannot edit the wiki page ๐
I just meant is it easier to work with than the current workflow of A3 UI to the point where it might be beneficial to do it all in JS
Yea for sure, it only took me like 5 hours to get everything done and I'm not an expert in Js. The only thing is that it was laggy sometimes and stuttering but I think it's because it's not running in sandboxmode. I will chdck thst when I'm home, if everything runs smooth then it's the best if you do your ui with HTML, more possibilities and looks way better
The only way to communicate between game and browser is sandbox mode, so it must be in it
Advantage: you can develop the GUI outside of Arma with that. it can look much more beautiful too.
Disadvantage: it relies on Steam browser to work and changes to Steam might affect your GUI in the future (or make it not work at all)
Does it need Java installed on the client?
I'm trying to port arma 3 font file into Arma 2, apparently it doesn't fit๐
Arma is generally backwards compatible. But also generally not forwards compatible.
Arma 3 had quite a few changes to font processing and rendering so I wouldn't expect that to be possible
It gave me a exception saying the font is too new lol
How would I go around making a base building system for public zeus? Lets say I place down the comp onto a prop, if a player comes up and interacts with it they can select some options like sandbags and shit. After selecting the prop, it shows up infront of em. They can place it down with left click.
does new Web gui able to build from React?
This is a pretty loaded question. Do you know how to script? Do you know multiplayer locality in regards to Zeus placed entities?
i know basic scripting, I know about locality
all I want is that players can grab a prop out of a box and place it down with left click.
is there a way to make a pack of images and select out of it? sort of like reforger's .edds files?
because this is pain lol (3*5*21 icons)
I don't think so. drawIcon just takes a file path.
yeah cause I'm making animated icons. it gets ridiculous with the huge hash of links I'm making haha
Yeah that's going to suck.
use browser API 
i haven't event looked into this yet since its new. got a quick guide on getting it set up (everything but the actual JS)?
idk maybe Dedmen has one on the arma3 repository on github
Hey guys, any idea how to disable gps minimap (ctrl+m, with ace3) please ?
This is not working: https://community.bistudio.com/wiki/showGPS
But I don't know how to use it, sadly: https://community.bistudio.com/wiki/openGPS
Thanks in advance ! r
Can I do this ?
nul = [this] spawn { while {true} do { if (visibleGPS) then { openGPS false; }; sleep 0.1; // Adjust sleep time as necessary }; };
I hope it wont lag server with 50 plp ๐
I would just openGPS false every frame
How to do that please ?
Maybe addkeybind for ctr+m with openGPS false command..
#include "\a3\editor_f\Data\Scripts\dikCodes.h" [["Ares Control","Control"],"incrementShadowHotkeyAdd","Menu",{openGPS false;},"",[DIK_M,[false,true,false]],true] call CBA_fnc_addKeybind;
Solved, thanks anyway Pol โค๏ธ
How exactly please ?
There's more of these minuhuds under "[" and "]", so I had to block them too:
[["Ares Control","Control"],"incrementShadowHotkeyAdd","1",{openGPS false;},"",[DIK_M,[false,true,false]],true] call CBA_fnc_addKeybind; [["Ares Control","Control"],"incrementShadowHotkeyAdd2","2",{openGPS false;},"",[DIK_RBRACKET,[false,false,false]],true] call CBA_fnc_addKeybind; [["Ares Control","Control"],"incrementShadowHotkeyAdd3","3",{openGPS false;},"",[DIK_LBRACKET,[false,false,false]],true] call CBA_fnc_addKeybind;
There is no way for eventhandler right now I guess, but If You have some good idea, please share.
addMissionEventHandler ["Draw3D",{openGPS false}]```
How did You .. . what ? ๐
Well this is some magic here.. thank You so much Polpox โค๏ธ
Is it the same as using eachFrame meh?
Draw3D
Will stop executing when UI loses focus
unlike EachFrame.
oh that's why, thanks
Not sure if this is the best channel to ask, but does anyone have suggestions for role icons built into the game? I'm looking to add them to my friendly 3D icons, but I've only found three icons for medics, engineers, and explosive specialists (last is not depicted here):
Take a look at CfgVehicleIcons, it's a root class
That's actually where I got the three icons from, although I did replace pictureRepair_ca.paa with the equivalent action icon since that was higher resolution
There's other ones in there too, like for at/aa units
like iconManAT_ca.paa you mean? those ones i find a bit awkward as 3D icons, since they're already used for the map content (circles with arrow indicating direction)
Right I forgot those had the arrows on 'em
a native icon set that matches with CfgRoles (Assistant, CombatLifeSaver, Grenadier, etc.) and has a simple, single-shape design like above would be nice, but i don't mind leaving it with the trait icons as-is
Does calling a function on MEH "eachFrame" to update some controls in a GUI is a bad practice?
not imo but the code should be short as possible
it calls this
ok well running your own tests should tell if it "works". i cant recall using EF my self on GUI loops but only to init GUIs fast
it works fine, very smooth, I'm just thinking if this is a bad practice or not
I personally prefer while loop with small sleep because EF seems to run too often
and in theory atleast could lower your FPS
Only run it as often as you need to, e.g. if you need to run it often but not necessarily each frame, you can just use like every 0.1 seconds
CBA PFHs also make it very easy to change it quickly
it's basically to track down the plane as you can see here, eachFrame keeps it smoothly, so it updates the marker. But yeah, I don't need to update the fuel/health bar on each frame
does this only run when the UI is open?
yes
Then who cares
and only if you select the airplane that is flying
for that I'd sacrifice some FPS with EF for smoothness ๐
i usually put some time checks in EFs to not run the code in everyframe but like 0.1 seconds or something
suspending ef?
nah just time check
can you give me an example?
like ```sqf
lastTime = -1;
addMissionEventHandler ["EachFrame",
{
if((time - lastTime) < 0.1) exitWith {};
lastTime = time;
}];
ohh
optimization
between the first { } is the EF?
updated code ^
got it
lastTime = -1;
PIG_CAS_mehIndex_eachFrame = addMissionEventHandler ["EachFrame", {
_plane = (_thisArgs # 0);
if (!(isNull _plane) || (alive _plane) || ((findDisplay 363) getVariable ["PIG_CAS_dialogOpen", false])) then {
"PIG_CAS_marker_SelectedPlane" setMarkerPosLocal (getPos _plane);
"PIG_CAS_marker_SelectedPlane" setMarkerDirLocal (getDir _plane);
if((time - lastTime) < 0.1) exitWith {};
lastTime = time;
[_plane] call PIG_fnc_updateHealthFuel;
} else {
removeMissionEventHandler ["EachFrame", _thisEventHandler];
deleteMarkerLocal "PIG_CAS_marker_SelectedPlane";
};
}, [_plane]];
so this only runs if the UI is open? You could also use a mouseMove and mouseHold event handler.
No need to mess with global vars and stuff.
that's a good idea, but only for updating the controls, in that case I prefer just to use while loop, I want to preserve that plane marker smoothness
that will still be smooth as it's executed on each frame
it's silly, but got me worried if doesn't this "accumulates" calls or something
EHs only quit when all code is done, but you shouldnt use spawn there
same happens in EF EH? inside the code
yes
so I'm gonna go with this ๐
would you be willing to share the set up steps with me and share your workflow? I'd like to impliment JS instead of using the typical arma UI elements.
When I got time I can make an tutorial yea
Is there a way to precache image textures in preinit? notice how on the first load of the image cycle, they flicker, but on all subsequent, they are smooth (looking at map icons, not the hud):
Try to load them off screen first.
Isn't there also a preload textures command?
Not sure if it applies to that, I just remember seeing one
Nevermind I think I'm just thinking of preloadObject
so, dumping the textures for the single frame of the ctrl event handler does not fix it. i'm going to try to increase the frames of the dump and see if that works
is that ui2texture?
It only gets initialized if its actually visible on screen. And that would be two frames.
One to notice its visible, second to init
its a "Draw" event texture on the map right now I just have 2 draw events, one to mass dump that deletes itself that frame, the the second one for the main event.
if (!(GVAR(Game) getVariable QGVAR(silomapmarkerinit))) then {
// preload the images off screen first - mass dump
(findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw", {
params ["_ctrl"];
{
private _iconData = _x getVariable QGVAR(icons);
{
for "_i" from 1 to 5 do {
for "_j" from 1 to 21 do {
private _icon = "";
if (_x == sideUnknown) then {
_icon = ((_iconData get _x) get _i);
} else {
_icon = ((_iconData get _x) get _i) get _j;
};
_ctrl drawIcon [
_icon,
[1,1,1,1],
[-1000, -1000],
32,32,0
];
};
};
} forEach [west, east, sideUnknown];
} forEach (GVAR(Game) getVariable QGVAR(silos));
_ctrl ctrlRemoveEventHandler [_thisEvent, _thisEventHandler];
}];
GVAR(Game) setVariable [QGVAR(silomapmarkerinit), true];
};
(findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw", {
params ["_ctrl"];
{
private _countdownTime = _x getVariable QGVAR(countdown_time);
private _currentCountdown = _x getVariable QGVAR(countdown);
private _side = _x getVariable QGVAR(side);
private _siloNumber = _x getVariable QGVAR(silo_number);
private _iconData = _x getVariable QGVAR(icons);
// Get the proper icon
private _frameIndex = 0;
private _siloIcon = _iconData get sideUnknown get _siloNumber;
if (_side in [west, east]) then {
_frameIndex = round (((_countdownTime - _currentCountdown) / (_countdownTime / 21)) max 1 min 21);
_siloIcon = _iconData get _side get _siloNumber get _frameIndex;
};
if (isNil "_siloIcon") exitWith {};
_ctrl drawIcon [
_siloIcon,
[1,1,1,1],
getPosATL _x,
32,
32,
0
];
} forEach (GVAR(Game) getVariable [QGVAR(silos), []]);
}];
so I'll try to wait to delete the init "draw" event for a couple of frames like you state and see if it works
waiting a few frames didn't work so i went overboard and did 50 frames and it worked I take that back, must have been a fluke because 100 frames doesn't fix it either
Not entirely sure what I'm looking at here. Are you re-running the precache each time the icon changes?
Or are you saying that the precache doesn't do anything at all?
no. as per R3VO's idea, I was going to load all of the images (every single one) onto the map for x amount of frames, then delete them which would have precached them, but it doens't look like it does anything. so there's got to be something more to it.
I rewrote that second post to have a frame counter and deletion after x amount of frames, just didn't post it
So the latter? Regardless of whether you add the precache handler, there's some sort of flicker on new icons?
yeah, only for the first load of them as you see in that video above
For what it's worth I added a map icon precache recently for a different reason, but for that I load them into a (barely visible) dialog rather than a draw handler.
Maybe the draw handler is somewhat optimized and drawing them (way) offscreen doesn't actually load the icon.
Although it's definitely not clipped to the visible map for map controls.
Personally I just have a structured text on the UI and cram all important graphics there
hidden off screen of course
Map icons not showing immediately seems super odd for Arma. I thought the usual rule is that if data is required it'll block until it's loaded.
Mh yeah there must be a problem with the loading.
I did a test with 20k icons, and you could see them all slowly scan in at like one or two per frame.
It should load them async and get dozens per frame in big blocks ๐ค
If I want to request textures for the web ui from the missionfile , do I have to do it via getMissionPath and A3API.RequestTexture ?
I think it does the mission path lookup by itself already
I think you just don't prefix it with a \ and then it's mission file path?
uiNamespace vars or grabbing controls/displays via IDC/idd? Which do you like to do?
Idd/c for internal, var for api
Like if it's intended for mods to interact with
I still always throw idd / idc macros in a separate hpp just for them though
I try to use the GUI Editor through the Debug Console but the button is greyed out. How do I get to it?
first off, use both advanced developer tools + 7erra editing extensions. You will have to put a new grid in because the vanilla GUI editor's grid is messed up
also, you have to be in preview to get it to start up
Static displays = namespace, dynamic displays = namespace
Static controls = IDC, dynamic controls = namespace
Static controls inside dynamic groups = IDC too (controlsGroupCtrl)
Why? Mostly old habits of using IDCs probably.
I also like seeing uppercase defines in my scripts probably.
I've been using localNamespace, because it doesn't persist after mission end
Would anyone mind peeking at this code and telling me if I'm doing this wrong? I am putting a ui-to-texture on a screen that is supposed to move to the center coordinates of the map and zoom out. Nothing happens though, but no errors either. Profiling branch.
private _disp = findDisplay "church_map";
private _map = _disp ctrlCreate ["RscMapControl",57501];
private _worldCenter = [(worldSize/2),(worldSize/2)];
_map ctrlMapAnimAdd [5, 0.1,_worldCenter];
ctrlMapAnimCommit _map;
displayUpdate _disp;
systemchat format ["%1 %2 to coords: %3",_disp,_map,_worldCenter]```
well one thing i noticed is that you are creating RscMapControl but you are not setting its size or position
displayUpdate needs to be called every frame you update the display. Not just once
Thanks both of you! I realized maybe I am just coming at this from the wrong approach. If I create this control in display 46, it's doing what I want it to do. I'm just not sure how (or if!) I can put this on a texture with ui to texture:
waitUntil {
uiSleep 0.1;
!isNull findDisplay 46
};
private _disp = findDisplay 46;
private _map = _disp ctrlCreate ["RscMapControl",57501];
_map ctrlSetPosition [0,0,1,1];
_map ctrlMapSetPosition [0,0,1,1];
_map ctrlCommit 0;
_map ctrlMapAnimAdd [1, 1,_worldCenter];
ctrlMapAnimCommit _map;
/*
onEachFrame {
displayUpdate _disp;
hint "Display Updated";
};
*/
systemchat format ["%1 %2 to coords: %3",_disp,_map,_worldCenter];```
Not really sure what I'm looking at here. Your code has no render-to-texture stuff in it but there's a map texture on the board?
The billboard has the UI texture set in 3den, #(rgb,4096,2048,1)ui('RscMap','church_map') but that doesn't seem to be able to achieve what I'm going for, I'm messing with uiEx right now to see if maybe there's more advanced ways to do this
So what code are you actually asking someone to check?
The point about displayUpdate is that ctrlMapAnimCommit takes time, so if you just call it once, it'll set the texture to the initial state.
I didn't notice that at first. I'm pretty sure even with a onEachFrame, that won't work.
Because the findDisplay will return null.
The display, is created when the texture is first shown on screen.
That is at least one frame after the setObjectTexture.
If your script is really like that, findDisplay will run in the same frame, and not find anything
But your logging at the end, would have shown you that you have a null display there
I need help, I am trying to get rid of this mini-map because when I place my mod into the GPS slot. It keeps bringing up the mini-map. This is what i have:
plus, I am not sure if I am doing this right.
You need to execute the script
And the script entirely removes the GPS screen
Not depends on your item
how do you execute the script, from the mission or with in the mod? @distant axle
You really should to learn very basics even before tackle complicated idea
Hello everyone, can you tell me if it is possible to implement a table with filling elements in Arma 3?
I made a table in Photoshop, but I don't understand, do I need to write my own class and background for each square and fill in the value, or can I just create a table class?
There is no table class, you'll need to create template row as controls group and then spawn and position it yourself with ctrlCreate and ctrlSetPosition
There is Controls Table but from my experience it sucks
https://community.bistudio.com/wiki/ctrlCreate is the best thing ever
There is also a way to render browser into controls but that's only in dev build yet
So I can just write a script that loops through the array of all the elements and creates all the columns and rows for me, adding values for the gap between the squares?
Yes
Create your rows into controls group so engine handles scrollbars and cropping if your contents overflow your table size
And if I have more elements than the size of the window, but I don't use a ListBox, can I remove the scroll bars in the photo and just scroll with a wheel?
Engine will handle scrollbars automatically if you have your controls inside a controls group
There is also ListNBox but its limited in its style possibilities, to achieve your mock up you'll need your own controls for each cell
@hoary estuary have you started messing around with the js controls yet?
Nope, so far I can do everything I want with native controls
Is there a way to get the width of an object control on the screen?
I have two object controls that I need to precisely place next to each other but as I cannot directly get the width of the objects that's kinda tricky
get bounding box of the 3D object? but then there is the z and scale and what not to consider
Interesting idea but we settled for the eyeball it approach
what is a UI system I can use that will not change in anyway and size depending on the aspect ratio and resolution of the monitor screen?
pixelW, pixelH if you need pixel perfect
If you want pefect square multiply by aspect ratio
w = 0.1 * pixelW / pixelH;
h = 0.1;
``` 0.1 square on the screen
same thing
so if n = (getResolution select 3) / (getResolution select 2)
so if I do pixelH * n * 5.
it will always "appear" the same regardless of a monitor settings because it adjusts itself based on the resolution?