Small UI-related questions

I’ve started poking around the lua ui files and I wasn’t able to find the answers to a couple things :

  • How user settings are persisted from the lua files, that is how the values defined by the ui called in fegameoptions are being read and written.
  • If the game allows to modify various hardcoded variables in lua files through an added in-game menu, ie how to persist and load those variables. For example, modifying the camera rotation speed set by cameraDragRotateScalar in ui/camera.lua by a user-specific value.
  • More generally if there was a documentation for all this. I’ve looked and so far the only thing that helped are the GBX examples (and mods of other users).

Thanks!

1 Like
  1. if I understood correctly your question, those “parameters” are stored in the PLAYERCFG.lua file (in the /bin/profiles/profilex folder)
  2. from what I know and tried in the past, we can’t modify the kind of variables you’re talking about. There is a way to save values (by using the lua write() function) and to reload it later with dofilepath() though (only in the profile folder since the last patch)

EDIT : the only documentation on UI I know of is here : http://hw2wiki.net/wiki.hw2.info/ScopeUI.html

  1. I was more wondering how they were written in the first place. How the UI values were being fetched to write in playercfg.lua and how they were read back.
  2. The profile folder is good enough, I’ll try that. Thanks !

Your link seems to be broken by the way, or I’m doing it wrong.

edit : force-reloading the page worked.

the read/write of game settings is hardcoded I’m afraid.

the link is working for me :confused:

Got it, I don’t care particularly for the game settings themselves but more in learning how things work. So thanks for the help :slight_smile:

I’ve made some crazy things with the UI, so don’t hesitate to ask :wink:

Look here for an example of what’s possible to do : Taste the rainbow! + UI BUG/functionality report

it makes extensive use of write/save/load data between sessions (not released yet, as I was waiting for the patch to land because of some heavy modifications on this side of things)

3 Likes

If I can follow up with an unrelated question, I’m trying to override the default shader files, mostly to modify the way the UI is rendered. For example, I’ve modified post_uiscene.frag and bypassed the whole tv glow pass to try and start getting cleaner text.

Of course, it doesn’t work. RenderDoc tells me the shaders the game loads are the default ones, no matter what I do. I’ve tried editing the manifest files but the game just won’t let me have my fun :).

Any idea of what I’m doing wrong?

edit : By the way, your work with the rainbow manager has been a huge help in understanding how things work, thanks again!

I won’t be able to help you on the shader thing, as I don’t know anything about it, sorry :confused:
Summoning @BitVenom to see if he can help you on that.

The UI will be even less a mystery for you when I release the Rainbow mod, as I’ve commented quite a lot of the code.
A UI tutorial is in the work too, I suppose it will help a lot of people on this part of the game which is a little too much in the shadows for my tastes ^^

1 Like

A release would be great and a tutorial would be awesome! Is it bitvenom working on it or is it of your own doing?

I’m still in the dark about a lot of things which you touched on with scope and how to pass things along. The whole plumbing of it all, especially where the code sets what is still confusing to me :smile:

Thanks for the summon, we’ll see if I’ll have to pay in blood for my indiscretions in the default files.

Are you using the -overrideBigFile command, or do you have your mod folder set up with it’s keeper.txt file?
Are your edited shaders in the shaders folder in your mod directory?

Also I’ll tack on another unrelated question - it’s not possible to have multi colored tactical icons is it?

No, it’s my own mod, and the tutorial will be made by me (I’ve been modifying the UI in HW2 for a loooooong time ^^)
I called BitVenom because he is one of the developper of the game, so he should be able to help you on the shader thing :wink:
Yeah, I can understand why you’re in the darkness, I was too in the beginning, don’t worry ^^

Depends of what you mean by multi-colored exactly. Could you be more precise ?

1 Like

I am using my own mod folder and my other modifications to the UI are showing up. My shaders are in my mod directory in the location replicating the extracted .big’s files, just like I did for the UI lua files. I can post screenshots if it helps.

For the tactical icons I see a few ways it could be possible but Dwarfinator is probably more qualified to offer a way.

To give some informations on the subject, buttons have several status, and each can have it’s own graphic (so different color), mainly “normal”, “pressed”, “clicked”, “desactivate”, etc…

If you want several color on the same button for the same status, it can be easily bypassed by creating several different buttons for each color and make them visible/invisible depending of what you need with a little bit of coding.

To sum up @Sastrei (and depending of what you really need), it’s possible ^^

1 Like

Another couple of questions if I can :slight_smile:

  • I’m guessing that the whole ati.lua section covers the tactical interface you get when pressing space. Am I wrong? Since…
  • I’m looking for the whole health bar and mouseover ship text logic. The fact that there are only some parameters in ui.lua doesn’t bode well.

By the way, I’ve been playing House of the Dying Sun and his UI is really awesome. If only I could get shaders to work, I could get close :stuck_out_tongue:

the ati system represents all that you can see attached to the ships, like texts, progressbars (health, etc…), shiptype icons, etc…

there is a lot of things there, and the sorting is not really great I’m afraid :confused:
Many categories (like missile, friendly, enemy, subsystemfriendly, subsystemenemy, healthbar, etc…), and sub-categories (like shipname,etc…) but you should be able to find what you’re looking for in there.
For the font names (like ATISmallFont), you will have to look into fontmap.lua file, which should be somewhere in the specific big file of your language.

The ATI system is not something I’ve touched a lot, so my knowledge is limited on it, compared to the pure UI stuff.

EDIT : oh yeah, and check the hw2wiki (Karos Graveyard) for the specific functions associated to it ! (all of them are called ATI_xxxxx)

1 Like

the ati system represents all that you can see attached to the ships,
like texts, progressbars (health, etc…), shiptype icons, etc…

Yay ! I saw that it was a beast so I waited for your confirmation before diving in. The sheer size of it discouraged me from experimenting. It sure is… big. And old-school. But I’m glad that I can actually do these things.

oh yeah, and check the hw2wiki (Karos Graveyard) for the specific
functions associated to it ! (all of them are called ATI_xxxxx)

Thanks, I’ll take a look.

For the font names (like ATISmallFont), you will have to look into
fontmap.lua file, which should be somewhere in the specific big file of
your language.

I experimented a bit on how fonts worked, I’m glad that you can confirm that everything is centralized in this file. I even saw that we had a community-built .rcf tool in case I wanted to get fancy, but since most of the HW1 fonts are in there already there shouldn’t be a need at this point. If I manage to get to the point where I can manage pixel-aligned text, then I’ll cross that bridge. But glyphs are way too scary for me yet.

Thanks again for your help, I’m really grateful :slight_smile:

You’re welcome :slight_smile:

You’re the first one I see interested in this part of the modding side of HW (aside from me and those crazy chinese guys from the FX mods ^^), so I’m more than happy to help if I can :wink:

2 Likes

http://hw2wiki.net/wiki.hw2.info/ seems to work intermittently…

Now that you say it, I remember having problems with it in the past too

About my shader question, it turns out if you deactivate the enhanced ui effects, you get the result I was mostly looking for. I’m still interested in a dev answer about if/how it is possible to override default shaders, but it isn’t as necessary as before :).