[MOD] Shortname Generator

The place to discuss scripting and game modifications for X Rebirth.

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

Post Reply
User avatar
Posts: 255
Joined: Wed, 26. Jan 05, 18:17

[MOD] Shortname Generator

Post by eliseeff » Sat, 26. May 18, 13:04

Name: Shortname Generator
Version: 1.00
Autor: eliseeff
game version 4.0 or higher
Install: Subscribe to the mod on the Steam Workshop page
Uninstall: Unsubscribe from the mod and delete the mod folder
Savegame compatible: YES

XR VR-edition Steam Workshop page


When I needed to get short names of clusters and sectors (Albion ==> AL, De Vries ==> DV etc.) for my mod, it turned out that it was impossible to do this in MD.

Then I made this small mod, which can be useful to others. It generates a table global.$MapShortcuts with short names each time the player changes the sector (to take into account known and unknown clusters and sectors).

How to use:

1. Add a dependency on this mod in your context.xml file.
2. Suppose you want to get short names for the cluster and the sector where the $object object is located and write them into $cluster_shortname and $sector _shortname variables. Then:

Code: Select all

  <set_value name="$cluster_shortname" exact="global.$MapShortcuts.{$object.cluster}.{1}" />

  <set_value name="$sector_shortname" exact="global.$MapShortcuts.{$object.sector}.{1}" />


Keep in mind that for the clusters and sectors, known to player as "unknown", will be received string "??". If you want to get the result as "knownname" in MD, then you need to replace 1 to 2:

Code: Select all

  <set_value name="$cluster_shortname" exact="global.$MapShortcuts.{$object.cluster}.{2}" />

  <set_value name="$sector_shortname" exact="global.$MapShortcuts.{$object.sector}.{2}" />

Compatibility with mods that add new clusters / sectors:

Fully compatible (of course, if the author has added short names as appropriate).

Post Reply

Return to “X Rebirth - Scripts and Modding”