[MOD][TC][AP][FL] Colour By Race v2.0.1 | Updated 20/12/23

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
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

Post by FriendlyFirePhoenix » Wed, 29. Mar 23, 16:36

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!

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 until Colour By Race notices them.
  • 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:16, edited 9 times in total.
I made a couple of X3 mods | Colour By Race | True Relations

camus2555
Posts: 6
Joined: Mon, 24. Nov 08, 16:37
x4

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

Post by camus2555 » Fri, 21. Apr 23, 20:41

Using this with xrm, nice work.

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

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

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

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, 03:00

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

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

Re: [MOD] [TC][AP][FL] Colour By Race v2.0

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

Updated Colour by Race - Version 2.0.0

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


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

Post by FriendlyFirePhoenix » Sat, 16. Dec 23, 12:32

That's amazing thank you! I will get these Russian translations into the next version. I would have done it now but life has been pretty hectic.
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

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

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


Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”