[SCRIPT] Library for retrieving original ship-race

The place to discuss scripting and game modifications for X³: Reunion.

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

Post Reply
Posts: 330
Joined: Sun, 1. May 05, 15:56

[SCRIPT] Library for retrieving original ship-race

Post by Kvalyr » Mon, 24. Jul 06, 17:26

////////////////--lib.z.getshiprace v1.0 for X3 - Reunion--/////////////////

Version 1.0 - 24/July/2006

////////////////--Author: Zurechial


Download -- Alternative mirror


The game by default only has a function to check the current owner-race of a ship, which if used would return "Player" for a Player-owned Nova, for instance.
This library, on the other hand, will return "Argon" for the same ship, as the Nova is attributed to the Argon race. A player-owned Pegasus will return "Paranid", etc.

This library checks a ship's subtype to decide what its original race is (as opposed to the owner race) and returns it as either a numerical value or a string, depending on the value supplied for the "Return-type required" argument.

0 = Numerical values corresponding to the races, as shown below. (eg: returns 0 for Argon)
1 = Strings of the race-names. (eg: 'Argon','Boron',etc)

1. While writing a script which requires a check on the original race of a ship:

2. Decide whether you want the race returned as a String or as a numerical value and supply a 0 or 1 to the "Return-type Required" argument.

0 = Numerical values corresponding to the races, as shown below. (eg: returns 0 for Argon)
1 = Strings of the race-names. (eg: 'Argon','Boron',etc)

3. Decide whether you want all Pirate ships treated as being from the "Pirate" race or from the original race of the ship.
ie; Do you want a Pirate Nova to return; "Argon" or "Pirate" ? Supply a 0 or 1 to the "Pirate ship treatment" argument to choose.

0 = All Pirate ships treated as "Pirate"
1 = Pirate ships returned as "Argon" or "Teladi" depending on their type (eg; Pirate Nova returns "Argon" instead of "Pirate")

4. "Call script" on the library, with the ship you want to check (from an argument, array, etc) as the target.

5. The library will then return the original race of the ship in the format requested.


0 = Argon/Any
1 = Boron
2 = Paranid
3 = Split
4 = Teladi
5 = Terran
6 = Xenon
7 = Pirate
8 = Yaki
9 = Kha'ak
10 = Goner
11 = Unknown

////////////////--Change log:

--Initial Release

////////////////--Known Issues/Bugs/Conflicts--/////////////////

--Currently only support for X3 running with no extra ships from mods such as Xtended.

Please send bug-reports and feedback to me in a PM at the Egosoft forums - My user profile:

http://forum.egosoft.com/profile.php?mo ... e&u=140507

Thanks to al_main for suggesting the method and saving me a lot of time ;)


---Extract the zip file to your main X3 - Reunion folder (Usually found at "C:\Program Files\DeepSilver\X3 Reunion" for european version)
---Your zip program should place the files in the correct paths. If not, You'll have to do it manually:

The "lib.z.getshiprace.xml" file should go in the 'scripts' folder.
Like this:
"\X3 Reunion\scripts\lib.z.getshiprace.xml"


If you wish to UN-install:

Simply delete the lib.z.getshiprace.xml file, but any scripts calling on this library will no longer function correctly if you delete it, obviously.

////////////////--Tech. Details--/////////////////

Script filenames:

Posts: 263
Joined: Sat, 18. Feb 06, 05:24

Post by Trigg004 » Mon, 24. Jul 06, 20:37

sounds good :roll:

Post Reply

Return to “X³: Reunion - Scripts and Modding”