Alright bro, I made a video showing how I have it set up, the way it works for me, and the other way it doesn’t work.
Alright bro, I made a video showing how I have it set up, the way it works for me, and the other way it doesn’t work.
Can you send me the verse files on discord or something. Same name AT ASHTAG
Okay, I already sent you the request
I never got a msg on Discord ![]()
Anyways after some messing about i found a solution
So add this
UpdateWidgetVar(Player, WidgetType.Score, Value)
UpdateWidgetVar(Player:player, Type:WidgetType, Value:int):void=
if:
PlayerWidgets := PlayerWidgetMap[Player]
ValidWidget := PlayerWidgets[Type]
then:
case(Type):
WidgetType.Score =>
if(ScoreWidget := MyUI.ScoreTest_Widget[ValidWidget]):
set ScoreWidget.Count += Value
WidgetType.MapCode =>
Print("Something Is Wrong This Has No Vars So Check Your Code!!!")
return
So i kept this universal so i dnt have to have a map per widget type.
The idea is you create the widget like you did so it shows for all players ect then you call
UpdateWidgetVar(Player, WidgetType.Score, Value)
This takes player, widget_type and value - Value could be anything currently its int for testing but ill probs change this in the future as my games evolve more.
Then when it runs UpdateWidgetVar()
It checks the type in the enum and it casts to that widget type if its successful it will update the value in the widget.
As im using the widget_type it refs all widgets in the enum hence the return as my MapCode widget has no vars to change if that maps sense.
You can play about with this but for example you can track a global var Team1Elims ect update that then call this function and just set the set ScoreWidget.Count = Team1Elims for example.
Let me know how this goes for you
ps change the refs to your widgets/vars
You can msg and i will help if you get stuck but its good showing on here incase people get stuck too
I updated the code in the snippets directory to now allow and update widget data for player/s