Arma Reforger – How to create HUD/UI/GUI Addons

Arma Reforger – How to create HUD/UI/GUI Addons 1 - steamlists.com
Arma Reforger – How to create HUD/UI/GUI Addons 1 - steamlists.com

This is a simple guide on how to create GUI/UI/HUD addon’s for Arma Reforger.
 
 

Introduction

Hello there.
 
 
Are YOUwondering how you actually use the Arma Reforger Tools, in order to create HUD or UI specific stuff?
 
 
You did your layout, or even created a simple little script, but you just cannot get it to work, don’t you?
 
 
Well, look no further. Here is a simple tutorial in order to create UI/HUD/GUI specific stuff.
 
 
 

First step

First of all, you need to create a layout.
 
 
For this example, I created a Button Widget, it could be anything. Images, Text’s, Buttons, whatever suits your needs.
 
 
Arma Reforger - How to create HUD/UI/GUI Addons - First step - BA92C64
 
 
 

Second step

The second step is actually creating a script, which calls this layout in order to let it show up on start.
 
 
The script would be created within the same folder, but doesn’t really matter actually. Make yourself a structure you can get along with. The script can be called anything.
 
 
Within the script you should have this as first:
 
 

 private ButtonWidget TestButton; 

 

 
With this code you are defining your Widget. As I said, it could be anything. For example a Text Widget would be:
 
 

 private TextWidget TestButton; 

 

 
TestButton is actually the name you set the TextWidget to right now. So you can call it later in the script.
 
 
The next step is overriding the already created variable OnStartDraw.
 
 
Like this:
 
 

 
 override event void OnStartDraw(IEntity owner)
 {
 super.OnStartDraw(owner);

 if (!TestButton) TestButton = ButtonWidget.Cast(m_wRoot.FindAnyWidget("TestButton"));
 }

 
 
As you can probably tell, you are calling the named private with the !TestButton and after the = you are telling the script, what kind of Widget it is and what to search for. The last “TestButton” is the name of the Widget in the layout. In this example, it would be TestButton again. Maybe a bit confusing cause I use TestButton for literally everything. But it’s not about how to script, more like how to actually let your GUI/UI/HUD stuff show up.
 
 
The total code should look like this:
 
 

 

class Menu: SCR_InfoDisplay
{
 private ButtonWidget TestButton;

 override event void OnStartDraw(IEntity owner)
 {
 super.OnStartDraw(owner);

 if (!TestButton) TestButton = ButtonWidget.Cast(m_wRoot.FindAnyWidget("TestButton"));
 }
}

 
 
 

Last step

The last step is the most crucial one, since your stuff won’t show up if you do not do this. And that’s something that has not been noted before or even documented.
 
 
You need to go to ArmaReforge/Prefabs/Characters/core/DefaultPlayerController.et and right click/override in your Addon.
 
 
If you did this, open the created DefaultPlayerController and search on the right site for Edit Prefab. Click that.
 
 
Now you need to search for “SCR_HUDManagerComponent”. Click on it and scroll down. The last thing you should see is “SCR_ChatHud”. Right click on it and insert after. Search for your created script. If it does not show up, restart the editor because it has not loaded your script yet.
 
 
After that you need to expand your created point and add the layout you created. It should look like this now:
 
 
Arma Reforger - How to create HUD/UI/GUI Addons - Last step - B9CC7A4
 
 
And if you did this, you can actually publish your addon. It should work now like this if you did everything right:
 
 
Arma Reforger - How to create HUD/UI/GUI Addons - Last step - 9EE4ACB
 
 
 

End

Awesome, your GUI/HUD/UI modification is now showing. You can now start creating awesome stuff with this.
 
 
Thanks for reading and sorry, if there are some misspells.
 
 
Have a great day!
 
 

Written by K0sh

 
 
Hope you enjoy the Guide about Arma Reforger – How to create HUD/UI/GUI Addons, if you think we should add extra information or forget something, please let us know via comment below, and we will do our best to fix or update as soon as possible!
 
 


Be the first to comment

Leave a Reply

Your email address will not be published.


*