Mentula Posted February 9 Report Share Posted February 9 Dear all, Long ago (A24 was the current version) I made a mod to replace in-game player colors. It was never published on the forum, although it is publicly available on my GitLab. Better leaving a trace here on the forum than out in the internet wilderness. The mod is named CustomColors and the current version 0.27.1 is compatible with Alpha 27. When I developed this mod, there were already other mods implementing color changing - and maybe it is still the case today, but the existing solutions were not satisfactory to me, as those mods replaced colors everywhere... including replay files! Hard-coding colors onto replay files has some disadvantages (noticeable f.e. when when sharing replay files with others or when playing replays). So I opted for a more flexible solution and the CustomColors mod was the result. Perhaps one day the possibility of customizing player colors will be a built-in feature of the game. Color replacement, in two screenshots Here is where colors can be changed: And here is how the result looks like: Installation Click here to download the latest release. Install following the official 0 A.D. guide: How to install mods? Alternative downloads: Latest Release (.pyromod) | Latest Release (.zip) | Older Releases Contribute The public repository is at this page. Everybody is very welcome to contribute, suggest, fork or simply give feedback. Have fun! 7 2 Quote Link to comment Share on other sites More sharing options...
sarcoma Posted February 10 Report Share Posted February 10 i had to disable autociv to see the settings tab same thing happens with moderngui moderngui + autociv dont have that problem Quote Link to comment Share on other sites More sharing options...
Mentula Posted February 10 Author Report Share Posted February 10 1 hour ago, sarcoma said: i had to disable autociv to see the settings tab same thing happens with moderngui moderngui + autociv dont have that problem Some mods overwrite existing options, instead of adding to them. We must ask authors to fix this behavior, as it breaks compatibility with other mods. It is clear from this code by @Atrik for example: g_Options, as well as the whole init() function, are overwritten. This is not good, as the original behavior will be "forgotten". I am surprised to hear it is an issue with autociv; I discussed with @nani in May '23 and he made a fix. A general recommendation to modders: use proxies to wrap functions, instead of overwriting them! See here for inspiration. 2 Quote Link to comment Share on other sites More sharing options...
seeh Posted February 10 Report Share Posted February 10 (edited) 1 hour ago, Mentula said: i had to disable autociv to see the settings tab when mods overwrite the main menu or something (maybe bad) as a workaround it could help set your mod behind. or automatically set your mod behind. then you need to identify what mods that are and then set you mod behind automatically and then automatically reload the game. Engine.SetModsAndRestartEngine(["mod",...clean_array]) Edited February 10 by seeh Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 10 Report Share Posted February 10 14 hours ago, Mentula said: Long ago (A24 was the current version) I made a mod to replace in-game player colors. It was never published on the forum, although it is publicly available on my GitLab. Better leaving a trace here on the forum than out in the internet wilderness. The mod is named CustomColors and the current version 0.27.1 is compatible with Alpha 27. Oh wow, I missed this. I almost was going to to try making this options myself! Thanks @Mentula. Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 10 Report Share Posted February 10 1 hour ago, Mentula said: It is clear from this code by @Atrik for example: g_Options, as well as the whole init() function, are overwritten. To be precise, this code is adding options if there are already existing one in a global variable, all mods could do this, it would also be working fine. Quote Link to comment Share on other sites More sharing options...
Mentula Posted February 10 Author Report Share Posted February 10 20 minutes ago, seeh said: when mods overwrite the main menu or something (maybe bad) as a workaround it could help set your mod behind. or automatically set your mod behind. then you need to identify what mods that are and then set you mod behind automatically and then automatically reload the game. Engine.SetModsAndRestartEngine(["mod",...clean_array]) This workaround (i.e. changing the mod order) did not work in A26. It should work, but it didn't, possibly because of a bug. Not sure about A27. In practice, autociv (and other overwriting mods) took precedence over CustomColors (and other proxying mods) regardless of the order mods were loaded. This is why I asked nani for the fix Quote Link to comment Share on other sites More sharing options...
Mentula Posted February 10 Author Report Share Posted February 10 15 minutes ago, Atrik said: all mods could do this A mod should be agnostic about the existence of global variables outside the public mod (such as g_autociv_optionsFiles). It is clear where this issue comes from, @Atrik: your options.js file is a copy of options~boongui.js, which was last updated in 2021. Back at that time, autociv options were not compatible with other mods, so boonGUI had to implement this "dirty trick" (i.e. to include autociv's global variables) to function properly. Nowadays, this problem does not persist anymore: autociv supports option compatibility, so other mods (including yours) can be free from autociv's global variables. If you'd like me to send an update to your repo with a fix, please let me know. It can also be quickly amended by looking at nani's autociv code or other code (here or here) 1 Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 10 Report Share Posted February 10 (edited) 19 minutes ago, Mentula said: It is clear where this issue comes from, @Atrik: your options.js file is a copy of options~boongui.js, which was last updated in 2021. Back at that time, autociv options were not compatible with other mods, so boonGUI had to implement this "dirty trick" OR, mods in a26 were aligned on a solution to add options after nani's mod and you suggested something else. Indeed I didn't write this code, but overwriting some functionality of the game such as the one that are here in option is the concept of a mod. Your approach might be slightly better in some ways but also you are asking existing mods to adapt to you instead because you didn't want to get along with using autociv purposely created global variable (that was also a easier way to add options). Edited February 10 by Atrik Quote Link to comment Share on other sites More sharing options...
seeh Posted February 10 Report Share Posted February 10 (edited) 2 hours ago, Mentula said: did not work in A26. It should work, but it didn't, possibly because of a bug. Not sure about A27 its works in both. maybe you want look at autocivP implementation Edited February 10 by seeh Quote Link to comment Share on other sites More sharing options...
ffm2 Posted February 10 Report Share Posted February 10 Nice mod. A suggestion: In addition to the individual colors you could add one long string that contains all colors at the bottom that can be easy copy / pasted like: 255 255 200 249 249 199 .... So one can share their carefully crafted color scheme here. This would also drive user engagement. But what do you guys think? Leave a like and a comment down below. 3 Quote Link to comment Share on other sites More sharing options...
Mentula Posted February 10 Author Report Share Posted February 10 3 hours ago, ffm2 said: Nice mod. A suggestion: In addition to the individual colors you could add one long string that contains all colors at the bottom that can be easy copy / pasted like: 255 255 200 249 249 199 .... So one can share their carefully crafted color scheme here. You can export/import your color scheme from/to local.cfg: [customcolors] 1 = "21 55 149" 2 = "150 20 20" 3 = "86 180 31" ... 16 = "80 80 80" or alternatively, from/to user.cfg: customcolors.1 = "21 55 149" customcolors.2 = "150 20 20" customcolors.3 = "86 180 31" ... customcolors.16 = "80 80 80" 2 Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 12 Report Share Posted February 12 Thanks Mentula. Excellent work. I used your code to replace legacy color replacements code from boongui. @Seleucids here is a version for you customcolors+.zip 1 1 Quote Link to comment Share on other sites More sharing options...
Seleucids Posted February 12 Report Share Posted February 12 1 hour ago, Atrik said: Thanks Mentula. Excellent work. I used your code to replace legacy color replacements code from boongui. @Seleucids here is a version for you customcolors+.zip Nub question: what are the commands for setting colours? Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 13 Report Share Posted February 13 (edited) 2 hours ago, Seleucids said: Nub question: what are the commands for setting colours? In option, you define what color you want to steal, then every game you aren't this color, yours will be swaped with the player who has the one you want (As well as you customizing this color in the first place ofc) Example: Set color 1 to your favorite red, then set "Replace Own Color" to 1. Spoiler Edited February 13 by Atrik 1 1 Quote Link to comment Share on other sites More sharing options...
seeh Posted February 13 Report Share Posted February 13 On 09/02/2025 at 10:13 PM, Mentula said: Better leaving a trace here on the forum than out in the internet wilderness. The mod is named CustomColors and the current version 0.27.1 is compatible with Alpha 27. Thanks. I not missed something. But i will give it a try Quote Link to comment Share on other sites More sharing options...
Atrik Posted Friday at 14:12 Report Share Posted Friday at 14:12 (edited) Spoiler I've got frustrated of not being able to find 16 colors well distinct of each others, so I added an option to force only 8 colors to be used. So with this option you could only define the 8 first colors, and they will also always appear in order. customcolors.zip@Seleucids For the mod above, there are no default config, boolean options are bugged, check and uncheck to actually set to false Or here is the configuration I'll set as default for ModernGUI with a good color palette that is nice for any game size from 1v1 to 4v4. (That config can be used for Mentula's original version as well ofc, I kept them cross-compatible). Spoiler customcolors.1 = "255 20 20" customcolors.10 = "185 0 89" customcolors.11 = "0 157 174" customcolors.12 = "255 95 180" customcolors.13 = "255 201 127" customcolors.14 = "250 250 250" customcolors.15 = "146 146 154" customcolors.16 = "2 2 2" customcolors.2 = "255 154 0" customcolors.3 = "255 227 2" customcolors.4 = "10 210 0" customcolors.5 = "17 214 255" customcolors.6 = "0 84 255" customcolors.7 = "63 0 184" customcolors.8 = "160 0 255" customcolors.9 = "187 93 0" Edited Friday at 16:52 by Atrik Ups, small oversight bug 1 1 Quote Link to comment Share on other sites More sharing options...
Classic-Burger Posted Saturday at 07:09 Report Share Posted Saturday at 07:09 I like the colors of Age of myth. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.