i am working on my first mod. yes it is another Server UI
most of the work is done. it is stackable (key event via singleton/buff) and works fine on our server.
anyway, i want that the text in the UI is editable via GUS.ini
that is what ive done so far:
Game mode only exists on the server while UIâs only exist on the client therefore trying to get the game mode from the UI itself will never work. Your best bet would be to get that info from the buff then pass it along to the Ui on creation
This is exactly what Iâve done for my widgets. Its works. I used a custom event that runs on the server that loads the information from the .ini and then passes this information into a client only custom event. If you have custom variables in your widget, you can Create Widget > Set Variable > Add To Viewport.
As for a new line, google it. Itâs weird. You have to copy and paste the code into your graph. Thatâs what I do:
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_159985"
Begin Object Class=EdGraphPin Name="EdGraphPin_200542"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_200541"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_200540"
End Object
Begin Object Name="EdGraphPin_200542"
PinName="ReturnValue"
PinToolTip="Return Value
String
The literal string"
Direction=EGPD_Output
PinType=(PinCategory="string")
End Object
Begin Object Name="EdGraphPin_200541"
PinName="Value"
PinToolTip="Value
String
value to set the string to"
PinType=(PinCategory="string")
DefaultValue="
"
End Object
Begin Object Name="EdGraphPin_200540"
PinName="self"
PinFriendlyName="Target"
PinToolTip="Target
Kismet System Library Reference"
PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetSystemLibrary')
DefaultObject=Default__KismetSystemLibrary
bHidden=True
End Object
bIsPureFunc=True
FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetSystemLibrary',MemberName="MakeLiteralString")
Pins(0)=EdGraphPin'EdGraphPin_200540'
Pins(1)=EdGraphPin'EdGraphPin_200541'
Pins(2)=EdGraphPin'EdGraphPin_200542'
NodePosX=512
NodePosY=368
NodeGuid=EEA0BFED4414853FDEB518B04A77618C
End Object
Sorry, I simply donât have the time to open up my dev kit anymore and take pictures Go to the buff that handles creating the widget. Create two custom events. Set one to server only, and one to client only. Make the client only one have an input variable (or more, depends what youâre loading). Call the serverâs custom event. In this event, load the .ini information. After this, call the client only event and connect the .ini information to the input for this event. In the client only event, create the widget. Right after creating the widget, drag out the returned object and âset (your variable name here)â. Then add this to the viewport. In the widget, click on the text box that will use the loaded information. In its settings, bind the text to a function. In the function just set text to the variable. You can copy the code I pasted and just hit ctrl+v in the graph to have a new line. You just use the append feature to combine strings of multiple lines.
Iâve found this route to be extremely effective because I was able to make it possible for people to reopen the message of the day at any point (message of the day uses TutorialUI and you can play whatever that sound is on that client). I know itâs a lot of information and there are no pictures, so just take it step by step.
Unless youâre opening each widget from the buff, youâll have to pass all of the information into the first widget that opens and keep passing it through onto the next one.
You can use multiple widgets. But when Widget 1 opens Widget 2, you have to pass through all of the information. I have this on my server. F1 brings up a general page, and then thereâs a button for the message of the day. Two widgets, all information loaded from the .ini in the initial widget and passed through to the second.
In Begin Play of your buff, you see how youâre grabbing all of the information? In the F1 where you have âset vars to widgetâ - this shouldnât be a function. You have to individually set every string in the widget with the string that you populated in the buff.
So i have to take the nodes from The Last pic and put them between The âcreate widgetâ and âadd to viewportâ node?
Gonna try this. Iam actually at work.
No. Inside of your widget, make sure you have the variable String ServerName. When you Create Widget, drag out the blue dot and search âset ServerNameâ. Thatâs how you do it. This would be a lot easier if the dev kit didnât take 20 minutes to load.
okay, i still didnt gave up. but there is 1 big problem. i need to get very long strings from GUS.ini, and that is going to fail.
thats my actual buff graph:
Hopefully all is working well. You can setup a feature for multiple lines as well, if you want. I had a lot of information in my one widget as well, and even had a mod list which required a new line every mod. I used the Split feature and just type like this in the .ini:
Hello!::::Welcome to this server. Please read the rules by pressing the rules button.
It would split â::â and I would simply append a new line in place of that split, so itâd come out like this:
Hello!
Welcome to this server. Please read the rules by pressing the rules button.