[MOD][TC][AP][FL] Colour By Race v2.0.1 | Updated 20/12/23 | Now with sector colouring!

The place to discuss scripting and game modifications for X³: Farnham's Legacy

Moderators: Moderators for English X Forum, Scripting / Modding Moderators, Moderators for the X3:FL Forums

rudi_pioneer
Posts: 408
Joined: Fri, 2. Apr 21, 21:06
x4

Re: [MOD] [TC][AP][FL] Colour By Race v1.3.1

Post by rudi_pioneer » Fri, 15. Sep 23, 08:33

Love the mod, works great, and ability to uninstall it works great too (turning off in settings then removing)

There’s a minor bug: in empire management > ship comparison tool, pirate ship has “pirate” in color, so it’s always sorted first.

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Re: [MOD] [TC][AP][FL] Colour By Race v1.3.1

Post by FriendlyFirePhoenix » Sat, 23. Sep 23, 07:45

rudi_pioneer wrote:
Fri, 15. Sep 23, 08:33
pirate ship has “pirate” in color, so it’s always sorted first.
Roger that, I'll remove that for the next release. You should be able to temporarily fix it for yourself by opening the 9965 t file and changing or removing the "Pirate Ship" entry (page=17, ID=3771). If you're playing in English, the file will be X3/addon/t/9965-L044.xml.
I made a couple of X3 mods | Colour By Race | True Relations

Tharrg
Posts: 257
Joined: Thu, 17. Feb 05, 16:09
x4

Re: [MOD] [TC][AP][FL] Colour By Race v1.3.1

Post by Tharrg » Thu, 30. Nov 23, 13:57

Thanks, great mod. Just a thought, \033C - Cyan seems to be unused and I don't like Prates and Yaki having the same colour - they are quite distinct in FL. I suggest using cyan for Yaki or something similar.

rudi_pioneer
Posts: 408
Joined: Fri, 2. Apr 21, 21:06
x4

Re: [MOD] [TC][AP][FL] Colour By Race v1.3.1

Post by rudi_pioneer » Thu, 30. Nov 23, 14:18

That’s a great point, especially since in FL yaki and pirates are enemies so player is likely to be allied with only one at a time

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Re: [MOD] [TC][AP][FL] Colour By Race v1.3.1

Post by FriendlyFirePhoenix » Fri, 1. Dec 23, 06:23

I'm colourblind and cyan is difficult for me to differentiate from the standard text so I won't be setting it for any major races.

The good news is you can easily change the colours to your own taste in the t file. I'll be uploading version 2.0 of Colour By Race in the next 24 hours which has major changes to the t files, so you may want to wait until then.

I do sympathise with your comment that Yaki and Pirates are enemies in FL. Unfortunately there's no easy solution - there just aren't that many colours available for text.
I made a couple of X3 mods | Colour By Race | True Relations

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Re: [MOD] [TC][AP][FL] Colour By Race v2.0 - Now with sector colouring!

Post by FriendlyFirePhoenix » Tue, 5. Dec 23, 11:10

Updated Colour by Race - Version 2.0.0 - Now with sector colouring!

Well those 24 hours from my previous comment went a bit longer than expected, but now it's here. This is a big update so please let me know if any errors occur!
  • Added dynamic colouring of sector names available only in FL.
    • Sector colouring is activated as a separate AL plugin so you can use it standalone or alongside colouring ships & stations.
      • Sector colours are editable in the 9964 t file set as a red, green and yellow value to be combined into an RGB colour. By default these RGB colours are identical to the colours used for ship & station names.
      • Border sectors can be set to use different colours to core sectors. By default they are the same. You can set the border sector colours for individual races manually or set a general % value to lighten/darken the core sector colour.
      • Colour By Race in FL now requires the unofficial patch by Cycrow as sector colouring requires some of the new scripting functions.
  • Rewrote plugin to start a task on new ships and station for rechecking their names instead of adding them to a global array to be checked on a timer. More elegant and more efficient on CPU and less likely to show uncoloured objects while waiting on 180 second timer.
  • Changed to use SIGNAL_CREATED instead of SIGNAL_CHANGESECTOR to detect new ships for colouring in FL. SIGNAL_CREATED is called once per ship only, meaning reduced CPU load.
  • Improved reset functionality.
    • Added check on game load to see if settings are changed from the last session due to a change in the t file. If a change is detected, the plugin will inform the player and reset and recolour all ships, stations and/or sectors to match the new settings. This way the player can change settings without needing to deactivate and reactivate the plugin - though this method is still possible.
    • The reset and recolouring is run in parallel for a seamless transition from the user's point of view - user won't see the entire universe uncoloured for a few minutes.
    • If a version update is detected, the plugin will inform the user of the update and reset and recolour ships, stations and/or sectors.
    • Old data from a previous game session is now stored to be used for any reset deemed necessary on session start. It's then deleted.
    • Pirate Guild 3 Mob Bosses and special XRM stations such as "Farpoint Station" are now reset properly.
  • Added script to check for short prepend on objects with short names and replace with the long prepend. This is run once on version upgrade. This was a mistake introduced to a couple of objects in earlier version of plugin. Only seen it in German translation so is fairly rare.
  • More informational messages. Short messages now appear as a game tip in FL and AP.
  • Changed Terran colour from "silver" to white as I can see it better. If you prefer to revert to silver, you can edit settings in the 9964 t file.
  • t file improvements.
    • Separated True Relations & Colour By Race into separate t files. 9964 is the main t file. 9965 now only contains hard coded coloured names of stations and is not used by FL as we can immediately detect creation of stations with SIGNAL_CREATED.
    • Added more documentation comments to the t file to explain editable settings.
    • Moved some hardcoded settings into t file so they can be edited.
      • XRM command ship job IDs and relevant sector string IDs.
      • References to object names to be prepended with race name.
    • Replaced "Pirate Ship" entry at id="3771" with original uncoloured string.
    • Added some strings to German t file to ensure an entire word is coloured in stations. For example "Piratenhafen" was only getting "Piraten" coloured which looked odd.
  • Added check to see if plugin is running processes. This stops the plugin from running two intensive processes at the same time and prevents breakage from conflicting processes. For example deactivating while init process is running would break things and vice versa.
  • Added handling of OWNER_CHANGED signal to rename a ship when its owner changes.
  • Improved debugging logging
    • Added dedicated script for enabling debugging - plugin.jj.colour.by.race.set.debug.
    • Debug now set to text number (9964) rather than boolean true.
  • A bunch of refactoring including some functions from jj.colour.by.race to jj.lib.
I made a couple of X3 mods | Colour By Race | True Relations

OrionTaltos
Posts: 62
Joined: Mon, 26. Dec 05, 23:00
x4

Re: [MOD][TC][AP][FL] Colour By Race v2.0 | Updated 05/12/23 | Now with sector colouring!

Post by OrionTaltos » Fri, 8. Dec 23, 02:46

How is the sector name coloring activated?

I let it run through its cycle on load and it gave me the message when it completed. Ship names all show fine. But I was already using the previous version, so they probably all had been renamed before.

I see the 2.0.0 plugin, but only as one item. https://i.imgur.com/kziDiVj.jpg

EDIT: I used the plugin manager to load the zip archive.
Arrow + Auto-Pillok + SETA = White Knuckle Terror

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Re: [MOD][TC][AP][FL] Colour By Race v2.0 | Updated 05/12/23 | Now with sector colouring!

Post by FriendlyFirePhoenix » Fri, 8. Dec 23, 04:26

It should appear as another AL plugin to be activated called "Colour By Sector".

It won't appear if you're not playing FL. It will also not appear if you're not using the latest version of Cycrow's unofficial patch. Looks like I need to make this more clear within the game itself.

If you are playing FL with latest patch please let me know and I'll investigate.
I made a couple of X3 mods | Colour By Race | True Relations

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Re: [MOD][TC][AP][FL] Colour By Race v2.0.1 | Updated 20/12/23 | Now with sector colouring!

Post by FriendlyFirePhoenix » Tue, 19. Dec 23, 16:20

Updated Colour by Race - Version 2.0.1
  • Added Russian translation provided by Alexalsp.
  • Added Japanese translation.
  • Improved messaging of wrong version of FL unofficial patch including adding message to plugin description in AL menu.
I made a couple of X3 mods | Colour By Race | True Relations

DragonOfWar
Posts: 16
Joined: Fri, 8. Dec 23, 23:04

Re: [MOD][TC][AP][FL] Colour By Race v2.0.1 | Updated 20/12/23 | Now with sector colouring!

Post by DragonOfWar » Wed, 20. Dec 23, 19:44

Thank you for the mod, it is great, but I have a small issue here. Playing x3 Farnham with latest patch... I changed some races colours and it worked, but not for the sectors. Does sector scripts use some other file besides 9964?

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Re: [MOD][TC][AP][FL] Colour By Race v2.0.1 | Updated 20/12/23 | Now with sector colouring!

Post by FriendlyFirePhoenix » Thu, 21. Dec 23, 10:46

Yes, sector colours are also set in 9964 but they are set separately to ship/station colours. Unfortunately the way colours are set in sectors has to be different to setting colours for ships/stations, this is just how the game works.

The text entries for Argon sectors for example straight from the 9964 t file:

Code: Select all

<t id="192">86(Argon)</t><!-- x92 -->
<t id="193">86(Argon)</t><!-- x93 -->
<t id="194">255(Argon)</t><!-- x94 -->
<t id="195">86(Argon)</t><!-- x95 -->
<t id="196">86(Argon)</t><!-- x96 -->
<t id="197">255(Argon)</t><!-- x97 -->
Colour By Race makes an RGB colour out of 3 text entries. In this case
  • id=192 is red set to 86
  • id=193 is green set to 86
  • id=194 is blue set to 255
  • Results in the colour RGB(86,86,255) or #5656FF as you can see at color-hex.com/color/5656ff
Text IDs 192, 193 and 194 are for core sectors and 195, 196, and 197 are for border sectors. If you remove the border sector text items then they will use the same colour as core sectors. Races don't include separate border sector colours by default as I thought it looked messy on the map but the functionality is there to edit for people who want it.

Does that all make sense?
I made a couple of X3 mods | Colour By Race | True Relations

DragonOfWar
Posts: 16
Joined: Fri, 8. Dec 23, 23:04

Re: [MOD][TC][AP][FL] Colour By Race v2.0.1 | Updated 20/12/23 | Now with sector colouring!

Post by DragonOfWar » Thu, 21. Dec 23, 11:12

FriendlyFirePhoenix wrote:
Thu, 21. Dec 23, 10:46

Does that all make sense?
Yes, very good explanation, thank you very much. I changed the things according to my preferences and it worked. :)

User avatar
alexalsp
Posts: 1823
Joined: Fri, 18. Jul 14, 05:28
x4

Re: [MOD][TC][AP][FL] Colour By Race v2.0.1 | Updated 20/12/23 | Now with sector colouring!

Post by alexalsp » Thu, 21. Dec 23, 16:13

I think adding a comment explaining these points, in a text file next to the color codes, would be a good solution.
:) :roll:

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Re: [MOD][TC][AP][FL] Colour By Race v2.0.1 | Updated 20/12/23 | Now with sector colouring!

Post by FriendlyFirePhoenix » Fri, 22. Dec 23, 11:54

Yes agreed, I'll add a bit more explanation to the t-file/readme when I get some more time.
I made a couple of X3 mods | Colour By Race | True Relations

Post Reply

Return to “X³: Farnham's Legacy - Scripts and Modding”