Numberz Posted March 10, 2021 Share Posted March 10, 2021 Hi, Looking for some help in trying to find a way to display some custom cvar values in one of the UI windows. I haven't been able to find any way to reference custom cvars in the Windows.xml file. However, I did (briefly) find a workaround by using the localization.txt as a source. As a very simple example, I added a line such as the following into one of the windows in Windows.XML: <label depth="10" name="cvartest" text_key="cvartest"/> And added an entry like this one into the localization.txt file: cvartest,progression,Skills,,,My Cvar: {cvar($mycustomcvar)},,,,,,,,,,,,,, The infuriating thing is that this was working and displaying my cvar value properly when I first tried it. After making some very minor changes, this has, of course, stopped working for me. Fast forward hours later and I just can't get it to work again. All I get now is the text from the localization: My Cvar: {cvar($mycustomcvar)} Any thoughts? Any help would be appreciated. TIA Link to comment Share on other sites More sharing options...
Telric Posted March 10, 2021 Share Posted March 10, 2021 Only thing i can think off would be try using a cvar without the $... The notes say the $ indicates the cvar is not networked and can only be used for local / math operations. Maybe something is getting between the UI reading what cvar is attached to the player cuz of it. Link to comment Share on other sites More sharing options...
n2n1 Posted March 10, 2021 Share Posted March 10, 2021 In fact, i can't tell you anything specific right now, but, look for an example using text="${valuecontent}" in "player_stats_entry", maybe this will give you a new way. (i used it before, but now i don't remember anything...) Link to comment Share on other sites More sharing options...
convergent Posted March 11, 2021 Share Posted March 11, 2021 Please post if you find a solution, I have resigned myself to using buffs to display cvar values! Link to comment Share on other sites More sharing options...
Numberz Posted March 11, 2021 Author Share Posted March 11, 2021 4 hours ago, Telric said: Only thing i can think off would be try using a cvar without the $... The notes say the $ indicates the cvar is not networked and can only be used for local / math operations. Maybe something is getting between the UI reading what cvar is attached to the player cuz of it. Thanks for the suggestion. Unfortunately, tried that and no dice. I'm not sure what "networked" means in this context but my cvars appear to increment and save properly both with or without the $. 4 hours ago, n2n1 said: In fact, i can't tell you anything specific right now, but, look for an example using text="${valuecontent}" in "player_stats_entry", maybe this will give you a new way. (i used it before, but now i don't remember anything...) I was thinking of this exact array this afternoon. I wonder if it might be possible to hijack one of these variables or variable arrays and use an existing controller. Will try to look into it and find out. Thanks for the suggestion. Link to comment Share on other sites More sharing options...
Numberz Posted March 12, 2021 Author Share Posted March 12, 2021 Well, after some additional trial and error, I've stumbled back onto my original solution. 😀 It turns out that the controllers for the Attributes and Perks will allow you to pull in cvars via the localization file. Haven't gone too deeply into this to see how far you can go with this but at the very least, you can add custom cvars into the localization (as part of a perk description for instance) and they will translate properly onto the screen in the Attributes and Perks windows. Example: myPerkDesc,progression,perk Int,,,"Some text here.\nMy Custom Cvar: {cvar($mycvar1)}" I had lost the solution because I had created a new window instead of staying within the Skills set of windows. Link to comment Share on other sites More sharing options...
convergent Posted March 12, 2021 Share Posted March 12, 2021 Networked cvars are available between entities, non networked are only able to be used by the entity that owns it. I think. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.