custom colors as UI mod

Everything about mods can be found here.

Moderator: Morax

custom colors as UI mod

Postby BlackYps » 02 Jun 2019, 13:39

Hi,

I want to tune the player colors in the strategic icons a bit, because I find some of the darker ones hard to read.
I found a very old mod here: /viewtopic.php?f=2&t=350 but it doesn't work anymore.

I also found this thread: /viewtopic.php?f=41&t=16878

I read somewhere that you can change the color by using the SetArmyColor command. But this needs cheats enabled and i couldn't get it to work in a sandbox. The console even knows the command SetArmyColor and gives a hint what arguments to pass but when I try it (e.g. SetArmyColorIndex(ARMY_1,30,30,30)) it gives an error: unknown command.

I also read somewhere, that the color of the players is stored in the replay so I can't just alter them on my side without a sim mod that everybody uses. Is it possible to only alter the displayed color in the stratgic Icons? That would be enough for me. The GameColors.lua seems to indicate that, because there is a PlayerColors and an ArmyColors list. But I don't know how to access the chosen playercolor once the game has started.

Does anybody know how I can achieve what I want? Is the color really stored in the replay and not only the colorindex? Any hints are really appreciated!
BlackYps
Avatar-of-War
 
Posts: 74
Joined: 15 Feb 2019, 19:46
Has liked: 7 times
Been liked: 31 times

Re: custom colors as UI mod

Postby speed2 » 02 Jun 2019, 14:56

You cant do it from UI. The command you found work in Sim and cant be changed without cheats enabled.

And only sim mod can modify GameColors.lua
User avatar
speed2
Contributor
 
Posts: 3189
Joined: 05 Jan 2013, 15:11
Has liked: 636 times
Been liked: 1119 times
FAF User Name: speed2

Re: custom colors as UI mod

Postby BlackYps » 02 Jun 2019, 16:15

For testing purposes I modified the file directly and started the game from the exe in FAForever/bin because the client notices the change and overwrites the file. Editing the file works and I can watch the replay after changing it back without desyncs. It seems the replay saves the Index of the colorlist but not the color directly.
This seems promising, but why can the GameColors.lua only be altered by a sim mod? There might be a good reason to it, but I don't know it.

Generally speaking how do I know which files can be changed by a UI mod? I thought lua files that handle the UI are generally modifiable by UI mods.
BlackYps
Avatar-of-War
 
Posts: 74
Joined: 15 Feb 2019, 19:46
Has liked: 7 times
Been liked: 31 times

Re: custom colors as UI mod

Postby nine2 » 03 Jun 2019, 01:56

Well some commands are just listed as "cheats" and we cant change that, its in the c code. That command changes it for all players, not just you.

It would be a mission but theoretically possible to edit the directx shader and change the colours there. You can do that without cheats and without affecting other players. However if you dont know HLSL it would take ages to work.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: custom colors as UI mod

Postby nine2 » 03 Jun 2019, 01:56

ozonex can probably do it for you :)
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: custom colors as UI mod

Postby nine2 » 03 Jun 2019, 01:58

i wouldnt mind using such a mod either. some colours are hard to see. another approach would be to change the strategic icons so they are more outlined. then it wouldnt matter what the background colour is. this would be hard to make look good, and would take aaages.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: custom colors as UI mod

Postby BlackYps » 06 Jun 2019, 15:02

I managed to create a mod that works. It does not work like other UI mods, it's more like the way advanced strategic icons works.
That means you don't install it like a normal mod. Read the readme for instructions on how to install it.

In my configuration the colors are kept similar to the defaults but made lighter to increase readability of the strategic icons.
You can change the colors to your liking by editing the mod. Instructions on how to do so are also in the readme.

You can also change the civilian color and the team colors with this mod, if you like to use the team coloring option. For my configuration I left them untouched.

If you are colorblind, always wanted to play as black, or are unhappy with the default colors for some reason, this mod is for you.

Any feedback is really appreciated!
Attachments
custom player colors.zip
(1.77 KiB) Downloaded 63 times
BlackYps
Avatar-of-War
 
Posts: 74
Joined: 15 Feb 2019, 19:46
Has liked: 7 times
Been liked: 31 times


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest