[SCRIPT] Library: Get Sector Info - original race, population, etc. (31/03/2007)

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

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

DangerDave
Posts: 113
Joined: Fri, 23. Mar 07, 23:32

[SCRIPT] Library: Get Sector Info - original race, population, etc. (31/03/2007)

Post by DangerDave »

Painstakingly created script library: lib.DD.GetSectorInfo.xy and lib.DD.GetSectorInfo.name.

DOWNLOAD

These library scripts take any X3 2.0 sector as a parameter and return an array, organised as following:

[0] = Race (useful for plugins that modify the owner race of a sector and want to know the original owner race).
[1] = Population.
[2] = Number of planets.
[3] = Is a core sector: TRUE if core, FALSE if border.
[4] = Is a home sector: TRUE if part of the sector cluster surrounding the home sector of a race, FALSE otherwise.

There are two versions, both with caveats:

- lib.DD.GetSectorInfo.name: This will use the name of the sector to determine which one it is. This means mods that change the universe layout will have no effect on the result. However, it is only valid for the english language version!

- lib.DD.GetSectorInfo.xy: This will use the sector x,y coordinates to determine which one it is. This means its independent of language, however it could very well be invalidated by any mod that changes the universe layout.

I've been as meticulous as possible, but of course human error is a possibility, so please report any inaccuracies.

A HUGE thankyou to Cool_SnipeR for the X3 External Script Editor. Without a copying and pasting facility it would have taken me years rather than hours to do this.

Feel free to use/abuse/modify to suit your application. I just hope this helps spawn some interesting new plugins.

Enjoy!
Dave.

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