X2_Universe.xml questions

The place to discuss scripting and game modifications for X²: The Threat.

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

Post Reply
kryptyk
Posts: 483
Joined: Fri, 5. Dec 03, 20:19
x4

X2_Universe.xml questions

Post by kryptyk » Fri, 12. Mar 04, 23:14

I went sector creating today and came up with some questions....

I know that x and y are the galactic coordinates but the rest is a little fuzzy.

1) I'm assuming that the color entry is the light color given off by the light source...can anyone explain the number entry itself?

2) Is there an entry that links to a sector name?

3) All of these are in the first line of a sector entry and was wondering if anyone could explain what id, t, r, fc, ff, fn, and m are for.

4) On the second line right after the sector header (?) are 't' and 's'....anyone know what these would do?

LordSuch
Posts: 201
Joined: Tue, 22. Apr 03, 16:08
x3

Post by LordSuch » Sat, 13. Mar 04, 03:17

Kryptyk,

I can answer some of your questions....

1) Dunno!

2) To look up the sector name add 1 to each of the x and y co-ords i.e. Kingdom end (0,0) becomes (1,1), make them two digits each (01,01)
and then format them as 102YX where Y and X are the x and y co-ordinates. i.e. Kingdom end becomes 1020101 (rolks drift 1020102 etc).
This can then be looked up in the xml file in the \t directory (440001.xml for english language) under page id 7.

3) id=??
fc, ff, fn, ????
r = race id
t = type of object - 1 = sector, 6 = factory 5= dock etc...
Also....
s = sub type of that object, the item within the appropriate text file (type directory).
e.g.
<o t="11" s="0" /> = Energy cells...
Why?
type 11 = TWareE.txt
subtype = 0 The first full entry in this file (entry 0) is energy cells.

4) I don't know what that first line in a sector is for however t and s are described above.

HTH

LS

kryptyk
Posts: 483
Joined: Fri, 5. Dec 03, 20:19
x4

Post by kryptyk » Sat, 13. Mar 04, 04:41

LordSuch wrote:Kryptyk,

I can answer some of your questions....

1) Dunno!

2) To look up the sector name add 1 to each of the x and y co-ords i.e. Kingdom end (0,0) becomes (1,1), make them two digits each (01,01)
and then format them as 102YX where Y and X are the x and y co-ordinates. i.e. Kingdom end becomes 1020101 (rolks drift 1020102 etc).
This can then be looked up in the xml file in the \t directory (440001.xml for english language) under page id 7.

3) id=??
fc, ff, fn, ????
r = race id
t = type of object - 1 = sector, 6 = factory 5= dock etc...
Also....
s = sub type of that object, the item within the appropriate text file (type directory).
e.g.
<o t="11" s="0" /> = Energy cells...
Why?
type 11 = TWareE.txt
subtype = 0 The first full entry in this file (entry 0) is energy cells.

4) I don't know what that first line in a sector is for however t and s are described above.

HTH

LS
WOOOOOHOOOOOOOOO......NAMING EXPLAINED!!!!!
You don't know how long that info was bothering me. Thank You!!!
I would PM you a beer but it might short out the server...... :wink:

LordSuch
Posts: 201
Joined: Tue, 22. Apr 03, 16:08
x3

Post by LordSuch » Sat, 13. Mar 04, 05:04

I'm glad it helped.....

I have spent most of today researching exactly the same information....

Working out that the s="XX" number was the (zero based) line number into the T files took me ages......

As you've sent me a virtual beer, I'll refil my glass! :roll:

:D

kryptyk
Posts: 483
Joined: Fri, 5. Dec 03, 20:19
x4

Post by kryptyk » Sat, 13. Mar 04, 05:07

LordSuch wrote:I'm glad it helped.....

I have spent most of today researching exactly the same information....

Working out that the s="XX" number was the (zero based) line number into the T files took me ages......

As you've sent me a virtual beer, I'll refil my glass! :roll:

:D
Yeah that is a pretty obscure link....I never would of thought of that.

I know you couldn't answer the first question about the color number...but do you have any theories on how it works?

LordSuch
Posts: 201
Joined: Tue, 22. Apr 03, 16:08
x3

Post by LordSuch » Sat, 13. Mar 04, 05:37

I don't know what the colour does, however by the looks of things it is an RGB quantity - convert the number to hex and you see a nice set of three bytes....

However it could be stored in reverse order or some such, I would recommend changing it to a pure colour and seeing what you get i.e. 0000FF - if things are blue then it is RGB, if they're red then maybe its stored as BGR...

LS

kryptyk
Posts: 483
Joined: Fri, 5. Dec 03, 20:19
x4

Post by kryptyk » Sat, 13. Mar 04, 05:40

LordSuch wrote:I don't know what the colour does, however by the looks of things it is an RGB quantity - convert the number to hex and you see a nice set of three bytes....

However it could be stored in reverse order or some such, I would recommend changing it to a pure colour and seeing what you get i.e. 0000FF - if things are blue then it is RGB, if they're red then maybe its stored as BGR...

LS
will try that...thanks :wink:

User avatar
thecwby
Posts: 192
Joined: Mon, 1. Dec 03, 09:40
x3

Post by thecwby » Sat, 13. Mar 04, 10:55

the RGB numbers are as follows... something of similar sorts. you'll see as you tinker with it.

The numbers range from 0 - 255.

0 black
..
50 lighter
..
150 brighter
..
255 white

play with the varying differences between the 3. it will combine the different colors, affecting in true colors.

per say..

R: 100
G: 0
B: 100
Would give off a slightly dark purplish color.

R: 185
G: 150
B: 100

Would give off a slightly yellow/orange type mixture.

Check out custom palette colors.. For instance, Paint in Windows under Accessories, you can select a "custom" color.. using that window, you can pick up different coloring variations, as if reads RGB values in hex numbers, 0 -255.

Hope this helps.

thecwby

kryptyk
Posts: 483
Joined: Fri, 5. Dec 03, 20:19
x4

Post by kryptyk » Sat, 13. Mar 04, 20:13

@thecwby

Thanks for the info but the color number for the sector is a lot bigger than any combo of 255.....and that's where I'm stumped.
Example: Kingdom End color = 2313738 which gives everything in that sector the dark greenish color. I was thinking maybe it was R=23 G=137 B=38 but I don't think that would look right.

User avatar
Storm_Front
Posts: 1021
Joined: Mon, 15. Dec 03, 05:27
x2

Post by Storm_Front » Sat, 13. Mar 04, 22:17

A:r=80 g=165 b=85
Cut:1016
F:r=0 g=0 b=0 n=1km f=12km
Boron

If you look at the sector map in the Galaxy Editor you with see something like the above inthe lower left corner.

The first line is the color of the sun. This is editable in the sector map using r/R,g/G,f/F. This is also represented be the # after "color" on the xml. I don't understand the coding, but since it can be changed in the editor I don't really care. :)

The second line above is the background color. It can be edited in the editor using the v key. It's also on the second line in the xml. I believe only the last 2 or 3 digits show up.

The third line refers to sector fog. Queens Space is a good place to see this. r,g and b are the fog color edited with the h/H, j/J, and k/K keys from the sector map. n is the near fog distance f is the far fog distance.
These 3 things color of fog, near fog, and far fog are your fc, fn, and ff on the first line of the xml.

The forth line "Boron" refers to utterly stupid and senseless creatures with little use in the galaxy. :D

kryptyk
Posts: 483
Joined: Fri, 5. Dec 03, 20:19
x4

Post by kryptyk » Sat, 13. Mar 04, 23:22

@Storm_Front
I didn't know what the Cut number was in the sector map...that's good info :wink:

Well in the XML file I figured out the color number. This works for sun color and sector color.

All Blue = 255 (R=0 G=0 B=255)
All Green = 65280 (R=0 G=255 B=0)
All Red = 16711680 (R=255 G=0 B=0)
White = 16777215 (R=255 G=255 B=255)

I tried to find out how the game was getting the numbers so I did a little calculating and found that 255(all blue) + 65280(all green) + 16711680(all red) = 16777215(all white)

Apparently just using all green and no blue gives the blue value a 256 instead of zero which means 255(all green) * 256(no blue) = 65280
Now I can edit sector and sun color manually in the XML file without opening the editor.
Almost have all the entries in the x2_universe.xml file figured out. :D

User avatar
esd
Posts: 17964
Joined: Tue, 2. Sep 03, 05:57
x3tc

Post by esd » Sun, 14. Mar 04, 00:18

kryptyk wrote:Almost have all the entries in the x2_universe.xml file figured out. :D
And when you have... be a nice chap and put together a doc for them :D
esd's Guides: X² Loops - X³ MORTs

User avatar
Storm_Front
Posts: 1021
Joined: Mon, 15. Dec 03, 05:27
x2

Post by Storm_Front » Sun, 14. Mar 04, 02:35

esd wrote:
kryptyk wrote:Almost have all the entries in the x2_universe.xml file figured out. :D
And when you have... be a nice chap and put together a doc for them :D
That's a great idea :)

Redjack
Posts: 453
Joined: Wed, 24. Dec 03, 06:40
x3

Post by Redjack » Sun, 14. Mar 04, 03:15

If you don't mind me asking, where can I find the X2_Universe.xml file? x2tool.exe finds a file of that name in 02.dat, but it's not the right one. It's only 7KB and doesn't have any universe data in it.

kryptyk
Posts: 483
Joined: Fri, 5. Dec 03, 20:19
x4

Post by kryptyk » Sun, 14. Mar 04, 06:37

Redjack wrote:If you don't mind me asking, where can I find the X2_Universe.xml file? x2tool.exe finds a file of that name in 02.dat, but it's not the right one. It's only 7KB and doesn't have any universe data in it.
It's the right one...just unpack it with the "x2tool -unpack x2_universe.pck x2_universe.xml" command

Post Reply

Return to “X²: The Threat - Scripts and Modding”