[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

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

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

Post by FriendlyFirePhoenix » Tue, 4. Apr 23, 16:58

Image

Colour By Race

Colour By Race is an AL plugin which colours the names of ships and stations across the galaxy. It makes for a cool looking and easier to parse sector map. Most objects only have part of their name coloured, usually the name of their race or corporation.

I've put in substantial effort to make it as performance friendly as possible - it must obviously consume some CPU cycles but I haven't noticed any slowdowns during gameplay.

Hopefully there's still some people left playing X3 who will get some enjoyment out of this. Do let me know if you find any bugs!

I'm posting this to the FL Scripts & Modding forum because as of version 1.1 Colour By Race is compatible with Farnham's Legend.

Colour By Sector

As of version 2.0.0 you can colour the names of sectors by race in X3:FL only. Sector colouring is activated as a separate AL plugin so you can use it standalone or alongside colouring of ships & stations.
  • The FL version of Colour By Race requires the [latest version of Cycrow's unofficial patch](https://www.xpluginmanager.co.uk/downlo ... ial-patch/).
  • Border sectors can be set to use different colours to core sectors.
  • Sector colour will automatically change when the sector changes owner.
  • Default sector colours can be changed in the 9964 t file similar to changing default colours for ships & stations.
  • Thanks to Cycrow's unofficial patch, coloured sectors are still searchable in the universe map search bar!
Image

Screenshots

You can get a better idea of what the plugin does in the screenshots at this Imgur Gallery.

Installation

Download the latest release at the Github repo. More detailed instructions can be found in the readme.

Colour By Race @ Github

Race Colours
  • Argon - \033B - Blue
  • Boron - \033G - Green
  • Split - \033M - Magenta
  • Paranid - \033O - Orange
  • Teladi - \033Y - Yellow
  • Pirates - \033R - Red
  • Goner - \033B - Blue
  • Independant - \033C - Cyan - - - (Only applied to XRM Privateer Trading Posts and Strong Arms Weapons Dealer)
  • ATF - \033A - Grey
  • Terran - \033A - Grey
  • Yaki - \033R - Red
If you prefer different colours you can change them in the t file. No colours are hardcoded in script files.

Examples
  • Argon Freight Transporter
  • B. Large Orbital Weapons Platform - - - Example of colouring shortened race name.
  • Military Base - - - Example of an object without a race specific string. In this case I've simply coloured the first word of the name.
  • Paranid Trading Dock
  • NMMC Security Buzzard - - - Corporation names are coloured in the same way as a race.
  • Pirate Blastclaw Prototype
  • Goner Ozias
  • Privateer Trading Post
  • ATF Escort Vali
  • Orbital Defence Station - - - This is a rare example of an object where I colour the entire name. Some stuff just looks weird partially coloured or prepended with a race name.
  • Yaki Assassin Fujin Raider
What is coloured and what isn't?

- Objects which are coloured:
  • Most ships.
  • Fighter Drones.
  • Stations:
    • Shipyards
    • Docks including Equipment Docks, Trading Docks and Stock Exchanges.
    • Corporate HQs.
    • XRM Weapons Dealers.
- Objects which are not coloured:
  • Any player property is untouched.
  • Factories.
  • Jump beacons.
  • Xenon or Kha'ak (by default). I saw little value in colouring ships which are always hostile.
How Does It Work?

Explained in detail in the readme.

Optional Files

Optionally files to improve the functionality with certain mods.
  • Modified 8513 translation files for Pirate Guild 3. PG3 dynamically renames pirate stations which overwrites any previously set coloured names. I've modified PG3's t files so that pirate stations will include colour in their name. Paste these files into your X3/addon/t/ folder overwriting existing files if necessary.
  • Modified ship naming script plugin.mbase.create.ship.name.xml for Military Base Response Revamp. Colours the race name during ship creation. Without this optional script, MBBR ships will remain uncoloured for about half a second after creation.
  • Modified ship naming script plugin.salv.al.ship.cfg.xml for Salvage Commands & NPCs. Colours the race name during ship creation. Also added setting of pilot name, skill, morale and aggression and addition of Explorer Command software.
Compatibility
  • TC - Yes
  • AP - Yes.
  • Farnham's Legend - Yes
  • X3 Reunion - No
  • XRM - Yes, I developed this while playing on an LxXRM installation. The plugin includes code to handle several XRM specific objects.
  • Litcube's universe - I've never played so I'm not sure. One player using this plugin with Mayhem 3 reported that it was working fine. Try it and let me know!
  • Military Base Response Revamp - Yes, especially if you overwrite MBBR's ship naming script with the included optional script.
  • Pirate Guild - Yes, though station names will be overwritten so I strongly advise the optional included translation files.
Languages
  • Russian (provided by Alexalsp)
  • English (my native language)
  • German (checked and improved by Olsch)
  • French (dubious Google translate translation)
  • Spanish (dubious Google translate translation)
  • Italian (dubious Google translate translation)
  • Czech (dubious Google translate translation)
  • Polish (dubious Google translate translation)
  • Japanese (dubious Google translate translation)
Changelog

I post changes in this thread, view the changelog in the readme.
Last edited by FriendlyFirePhoenix on Tue, 19. Dec 23, 16:19, edited 9 times in total.
I made a couple of X3 mods | Colour By Race | True Relations

olsch
Posts: 60
Joined: Mon, 24. May 21, 19:37
x3ap

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

Post by olsch » Wed, 5. Apr 23, 22:55

Thank you for adapting it for FL.
I wanted to try it out today, but can't find the option in the AL plugins list after copying the files. Any idea what might be wrong? Running v1.3.5 and the deployable weapons platform, but nothing else.

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

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

Post by FriendlyFirePhoenix » Sat, 8. Apr 23, 05:19

olsch wrote:
Wed, 5. Apr 23, 22:55
Thank you for adapting it for FL.
I wanted to try it out today, but can't find the option in the AL plugins list after copying the files. Any idea what might be wrong? Running v1.3.5 and the deployable weapons platform, but nothing else.
Hmm, I updated to 1.3.5 and started a new game and Colour By Race is working fine. Did you place the files into the /addon directory? Because for FL you should install into /addon2 directory. I updated the readme 5 days ago to mention this so you might have missed it.
I made a couple of X3 mods | Colour By Race | True Relations

olsch
Posts: 60
Joined: Mon, 24. May 21, 19:37
x3ap

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

Post by olsch » Sat, 8. Apr 23, 23:20

So here is what I did:
1. Complete Vanilla re-install (deleting the remaining addon2 folder after uninstalling it)
2. installing update 1.3.5
3. "installing" no-steam exe (is this necessary)?
4. copying the files into addon2 folder (but not the optional files)
5. starting the game.
Here are some pictures from the results:
Folder:
https://imgur.com/ixCfCD0
plugins list:
https://imgur.com/L6spyEf
AL plugins list:
https://imgur.com/HTNkPbU

What am I doing wrong?

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

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

Post by alexalsp » Sun, 9. Apr 23, 09:44

What are you doing wrong. Copied all files to addon2 folder
I started the game, turn on the color, in the Artificial Life Settings, everything works.

Tested with and without optional files

Check if you copied everything correctly.

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

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

Post by FriendlyFirePhoenix » Sun, 9. Apr 23, 11:59

Hi Olsch,

Thanks for the screenshots, from those it is clear you are missing the 9964 t file. ReadText9964-1100 is a reference to the name of the plugin but it can't find it because the t file is missing.

At https://github.com/jamesjonesphoenix/co ... ree/main/t you can see Colour By Race includes 2 t files. You should include both of them in your x3/addon2/t directory.

Most mods only use a single t file. But mine edits a bunch of base game station names so I don't want those being loaded until the mod is actually activated. This means I have the 9964 t file which contains the name of the plugin and a few other strings and then 9965 which is the main t file.

I saw in readme I accidentally wrote "File in the t/ folder go into the t/ folder." so have now changed that instruction to "Files" to try and avoid confusion.
I made a couple of X3 mods | Colour By Race | True Relations

olsch
Posts: 60
Joined: Mon, 24. May 21, 19:37
x3ap

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

Post by olsch » Sun, 9. Apr 23, 12:52

Thanks for the reply.
But my t folder includes both files: (I'm not good at modding, but copying files is something I can do :wink: )
https://imgur.com/D9tJebU

I also tried it with X3:AP, but the same error appears.

Maybe I should re-install the whole x3 game?

olsch
Posts: 60
Joined: Mon, 24. May 21, 19:37
x3ap

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

Post by olsch » Sun, 9. Apr 23, 23:02

Solved.
I reinstalled everything. This time I installed the mod via the plugin manager. This worked fine.
Don't know why it didn't work earlier.
Thank you again.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22225
Joined: Sun, 14. Nov 04, 23:26
x4

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

Post by Cycrow » Mon, 10. Apr 23, 02:42

im guessing your game is not in english, so the english text files wont get work

the plugin manager will generate the missing text files if the game is in a different language

olsch
Posts: 60
Joined: Mon, 24. May 21, 19:37
x3ap

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

Post by olsch » Mon, 10. Apr 23, 12:58

Thank you for the Info. You guessed correct (German version). So from now on I'll be using the Plugin Manager whenever possible.

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

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

Post by FriendlyFirePhoenix » Mon, 10. Apr 23, 20:06

im guessing your game is not in english, so the english text files wont get work

the plugin manager will generate the missing text files if the game is in a different language
Thanks Cycrow, I did not realise this. I just assumed X3 would default to whatever t file was available if a particular language wasn't present. Sometime in the future I'll look at making t files for other languages.
I made a couple of X3 mods | Colour By Race | True Relations

olsch
Posts: 60
Joined: Mon, 24. May 21, 19:37
x3ap

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

Post by olsch » Mon, 10. Apr 23, 22:45

Well, call me if you need help with the German version :wink:

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

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

Post by alexalsp » Tue, 11. Apr 23, 00:06

You can simply rename the files and type 49 instead of 44, also change the language inside the file to 49 and it will work in the German game but in English the text of the mod.

olsch
Posts: 60
Joined: Mon, 24. May 21, 19:37
x3ap

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

Post by olsch » Wed, 3. May 23, 13:07

I made an attempt for a German translation. There is also a pull request open. Until merged, you can find the t-files here:
https://github.com/olsch88/colour-by-ra ... nslation/t

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

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

Post by FriendlyFirePhoenix » Thu, 1. Jun 23, 18:40

Updated Colour by Race - Version 1.3
  • Improved plugin deactivation. Plugin will now remove the colour from the coloured part of the name of all ships and stations in the galaxy and remove all local vars and global vars. It will be as if Colour By Race was never installed.
  • Setup [SIGNAL_CREATED] for stations in FL. In FL stations will now be coloured as soon as they appear in the universe.
  • Improved detection of FL. The plugin would fail to detect FL if X3 was running unofficial patch version 1.3.6 and later. Amongst other things, this would leave corporation ships uncoloured.
  • Changed prepending of ships without a race substring to colour. Previously the plugin queried a list of approved jobs to prepend with a race name. This was cumbersome, it's quicker to query jobs which shouldn't be prepended with a race name. Currently the only job we make sure not to prepend is the UFO Unknown Ship job 8660 and any drones.
  • Setup a feature where a set of station-only search substrings will be searched before any others. For example I added "Boronen" to this set for the German translation which will be searched and coloured before "Boron". These strings are set with IDs from x50 to x60 where x is the race ID. So for example strings 450 to 460 for the Paranid.
  • Fixed some t file typos
  • German translation - Added "Militärischer" to German translation substrings and made sure it gets coloured before Militär. Added "Herzogs" as a substring to search for Duke's
  • Added descriptions to all script files.
Since this is the first time I've posted changelog, I'll also include changes from previous patches here:

Version 1.2.2
  • Added German translation - thanks to Olsch for checking and improving my initial attempt.
  • Added ability to add strings to t file to check for stations only, but checked before other strings - needed for German translation which has masculine and feminine noun modifiers.
  • Made a dubious attempt at other French, Spanish, Italian, Czech and Polish translations. I took these translations straight from Google translate.
Version 1.2.1
  • Forgot to version up event file to 1.2
Version 1.2
  • Now compatible with Terran Conflict.
  • Deleted extraneous files player.xml and init.xml
  • Lasertower activation timer fix now called on lasertower change sector signal
  • Now only check XRM stations if XRM is activated - was renaming McCallum station but couldn't find string.
Version 1.1
  • Now compatible with Farnham's Legend.
  • Fixed bug where lasertower activation timer would be saved into the name.
  • Added/Fixed search strings to be coloured:
    • FL objects - Corporations, The Marauder, Nikkonofune
    • Terraformers, Exterminator, ATF Orbital Defence Station
    • Fixed Beryll string
  • Added script to remove the local variable on all ships and stations. This is used when updating the plugin so we can re-check the galaxy and when the plugin is deactivated.
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 v1.3.1

Post by FriendlyFirePhoenix » Mon, 5. Jun 23, 02:59

Updated Colour by Race - Version 1.3.1
  • Prevented search substrings from being deleted when processing a plugin update. This bug prevented the galaxy from being reset so objects could be recoloured from a "blank slate".
I made a couple of X3 mods | Colour By Race | True Relations

olsch
Posts: 60
Joined: Mon, 24. May 21, 19:37
x3ap

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

Post by olsch » Tue, 6. Jun 23, 23:13

Since recently I get some messages that look like debug messages:
https://imgur.com/fNA2EEj
Do these come from your script?

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 » Wed, 7. Jun 23, 12:54

No, never seen anything like that while working on this. I usually debug by logging to files.
I made a couple of X3 mods | Colour By Race | True Relations

anthonysavatar
Posts: 17
Joined: Thu, 11. May 06, 13:36
x3ap

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

Post by anthonysavatar » Sat, 15. Jul 23, 21:07

Thank you for this mod! It makes everything so much more readable at a glance. IMO it fits really well with FL since diplomacy is such a huge part of the game.

How can I get the same colors in the Universe Map? It would be really handy to have the sectors names colored by owner.

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 » Thu, 20. Jul 23, 13:27

anthonysavatar wrote:
Sat, 15. Jul 23, 21:07
How can I get the same colors in the Universe Map?
Thanks! I'm currently working on an update that will allow you to do just this. You'll be able to set any colour for a race's sectors in the t file using RGB values. I've also set it up so you can have different colours for border and core sectors.

Also Deniskos has a mod at viewtopic.php?f=201&t=456297 which includes sector colouring as a feature though I haven't yet tried it myself.
I made a couple of X3 mods | Colour By Race | True Relations

Post Reply

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