'get maintype' script method, and game-file tie-up ?
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 2718
- Joined: Sun, 9. Sep 07, 15:39
'get maintype' script method, and game-file tie-up ?
I can see that
<Object> get maintype
returns a number that relates to which game-file the 'subtype' indexes into.
My question is what things have maintype 0 to 4 & greater then 17,
& which files do these correspond to ?
Given:
5 = TDocks
6 = TFactories
7 = TShips
8 = TLasers
9 = TShields
10 = TMissiles
11 = TWareE
12 = TWareN
13 = TWareB
14 = TWareF
15 = TWareM
16 = TWareT
17 = TAsteroids
Or perhaps they are unused (particularly > 17) ?
I assume there's an index for:
TBackgrounds, TBullets, TCockpits, TDebris, TFactoryWrecks, TGates, TLasers & TShipWrecks.
As well as for TNebula (gone in TC?), TPlanets & TSuns + TSpecial.
<Object> get maintype
returns a number that relates to which game-file the 'subtype' indexes into.
My question is what things have maintype 0 to 4 & greater then 17,
& which files do these correspond to ?
Given:
5 = TDocks
6 = TFactories
7 = TShips
8 = TLasers
9 = TShields
10 = TMissiles
11 = TWareE
12 = TWareN
13 = TWareB
14 = TWareF
15 = TWareM
16 = TWareT
17 = TAsteroids
Or perhaps they are unused (particularly > 17) ?
I assume there's an index for:
TBackgrounds, TBullets, TCockpits, TDebris, TFactoryWrecks, TGates, TLasers & TShipWrecks.
As well as for TNebula (gone in TC?), TPlanets & TSuns + TSpecial.
Last edited by exogenesis on Fri, 21. Nov 08, 21:43, edited 1 time in total.
-
- Posts: 2718
- Joined: Sun, 9. Sep 07, 15:39
Had a closer look & it seems :
Which leaves me wondering what the hell 'maintype's
1, 19, 22, 23, 24, 26 & 27 are.
If anything at all?
Anyone know if this is the complete list?
.
Code: Select all
X3 TC X3R + XTM X3 R X2
& Ashley Fabs
Maintype T File Name Subtypes Subtypes Subtypes Subtypes
0 TBullets 45 32 30 24
1 0 0 0 0
2 TBackgrounds 80 62 35 0
3 TSuns 11 25 1 23
4 TPlanets 149 156 129 20
5 TDocks 47 27 21 17
6 TFactories 398 998 301 242
7 TShips 369 332 220 114
8 TLasers 39 32 30 24
9 TShields 6 20 6 4
10 TMissiles 36 29 29 8
(TRockets)
11 TWareE 1 1 1 1
12 TWareN 80 63 63 25
13 TWareB 16 11 11 11
14 TWareF 13 15 11 11
15 TWareM 4 3 3 3
16 TWareT 112 443 81 79
17 TAsteroids 10 10 10 10
18 TGates 21 17 5 5
19 1 1 1 1
20 TSpecial 105 119 82 44
21 TNebula 1 1 1 134
22 0 0 0 131
23 0 0 0 0
24 0 0 0 0
25 TCockpits 160 663 105 103
26 0 0 0 0
27 0 0 0 0
28 TDebris 21 21 21 -
29 TDockWrecks 47 20 20 -
30 TFactoryWrecks 398 301 301 -
31 TShipWrecks 368 212 212 -
1, 19, 22, 23, 24, 26 & 27 are.
If anything at all?
Anyone know if this is the complete list?
.
-
- Posts: 269
- Joined: Sat, 20. May 06, 14:55
http://www.xai-corp.net/en/node/602
that's a nice list, but I think it's a bit out dated. My guess is that 1 are still sectors though. No idea of the others.
that's a nice list, but I think it's a bit out dated. My guess is that 1 are still sectors though. No idea of the others.
-
- Posts: 2718
- Joined: Sun, 9. Sep 07, 15:39
-
- Posts: 724
- Joined: Sat, 21. Feb 04, 02:15
Hi exogenesis,
Use the updated script I wrote years ago to get the prices for all the wares in the game (copy below - call it whatever you like).
This will let you match the wares to the Tfiles. The ones that don't have any names - just match the number of entries to the Tfiles... This worked for X3:R (can't find the list I made), haven't checked X3:TC..
The list is quite interesting - especially the ship prices.. you can check if the ships offered for sale really are bargains...
Boron - Ol Fh'art
Use the updated script I wrote years ago to get the prices for all the wares in the game (copy below - call it whatever you like).
This will let you match the wares to the Tfiles. The ones that don't have any names - just match the number of entries to the Tfiles... This worked for X3:R (can't find the list I made), haven't checked X3:TC..
Code: Select all
Script bof.ware.prices
Version: 0
for Script Engine Version: 41
Description
Log prices for all wares
Arguments
Source Text
001 * list ave, min, and max prices for ALL wares in TC
002
003 $logid = 81030
004
005 write to log file #$logid append=[TRUE] value='Teran Conflict wares'
006
007 $wtype = 0
008 $wsub = -1
009 while $wtype < 33
010 |write to log file #$logid append=[TRUE] value=' '
011 |write to log file #$logid append=[TRUE] printf: fmt='Ware Type =%s', $wtype, null, null, null, null
012 |$wsubmax = get number of subtypes of maintype $wtype
013 |while $wsub < $wsubmax
014 ||inc $wsub =
015 ||$ware = null
016 ||$ware = get ware from maintype $wtype and subtype $wsub
017 ||if $ware != null
018 |||$aveprice = get average price of ware $ware
019 |||$minprice = get min price of ware $ware
020 |||$maxprice = get max price of ware $ware
021 |||
022 |||write to log file #$logid append=[TRUE] printf: fmt='%3s %10s%10s %10s %s', $wsub, $aveprice, $minprice, $maxprice, $ware
023 ||end
024 |end
025 |inc $wtype =
026 |$wsub = -1
027 |
028 end
029
030 return null
Boron - Ol Fh'art
-
- Posts: 2718
- Joined: Sun, 9. Sep 07, 15:39
Interesting that you loop'd from 33 rather than 31,
is there something at 32 & 33 ?, or just 'playing safe' ?
'Ships offered for sale' - you mean the TC:
'I've got a 2nd hand ship for sale, one careful owner, low mileage, good price Gov'nor'
offers in TC ?
I'm not actually trying to get extra in-script info about objects,
but passing main & sub types to a log file for processing by an external util that parses
the game-files (hence the need to know to tie-up).
Util probably to be called 'Economy Planner' or something equally grand
is there something at 32 & 33 ?, or just 'playing safe' ?
'Ships offered for sale' - you mean the TC:
'I've got a 2nd hand ship for sale, one careful owner, low mileage, good price Gov'nor'
offers in TC ?
I'm not actually trying to get extra in-script info about objects,
but passing main & sub types to a log file for processing by an external util that parses
the game-files (hence the need to know to tie-up).
Util probably to be called 'Economy Planner' or something equally grand

-
- Posts: 724
- Joined: Sat, 21. Feb 04, 02:15
Hi exogenesis,
Sorry for the delay, but my ISP crashed out while writing it last night (actually it was early this morning...).
Yes, the loop to 33 was just a safety feature..
And yes, to check the prices of ships from these dealers - some are real bargains, others are a rip-off.
Your list appears to be complete - apart from type 19, but I have no idea what this single entry can be... Possibly the other ware types were for wares types that were planned but never completed, or 'reserved for future expansion'.
Best of luck with your 'Economy Planner' (or whatever you call it)...
Boron - Ol Fh'art
Sorry for the delay, but my ISP crashed out while writing it last night (actually it was early this morning...).
Yes, the loop to 33 was just a safety feature..
And yes, to check the prices of ships from these dealers - some are real bargains, others are a rip-off.
Your list appears to be complete - apart from type 19, but I have no idea what this single entry can be... Possibly the other ware types were for wares types that were planned but never completed, or 'reserved for future expansion'.
Best of luck with your 'Economy Planner' (or whatever you call it)...
Boron - Ol Fh'art
-
- Posts: 2718
- Joined: Sun, 9. Sep 07, 15:39
-
- Posts: 1916
- Joined: Sun, 20. Aug 06, 10:54
Sorry for the slight thread necromancy, I've just been "pointed" this way
but I can shed a little more light on some of the following maintypes... I think.
1: yup - still sectors
23: this is a customisable "wares list" - it's a container for adding specific wares to trading stations, equipment docks, shipyards and so on - stations that don't "produce" anything per se.
It _is_ a maintype, but only exists within maintypes 5 and 7.
24 and 26 I've not quite got a handle on yet but they seem to be some kind of special "wares" as they only exist on ships and the new OWPs (maintype 7).
For instance, this is the OWP in Kingdoms end (I've added comments)
Which, to me, looks as though the OWP has a set of wares of it's own, but also contains some fighters - and they have their own wares as well. Having a 'v' value doesn't help because I thought that generally applied to video (such as on the advertising blimps).
28 - I'm guessing this is debris in "new" sectors that hasn't been moved into x3_universe_debris.xml?

1: yup - still sectors
23: this is a customisable "wares list" - it's a container for adding specific wares to trading stations, equipment docks, shipyards and so on - stations that don't "produce" anything per se.
It _is_ a maintype, but only exists within maintypes 5 and 7.
24 and 26 I've not quite got a handle on yet but they seem to be some kind of special "wares" as they only exist on ships and the new OWPs (maintype 7).
For instance, this is the OWP in Kingdoms end (I've added comments)
Code: Select all
<o id="8287" f="1" t="7" s="SS_SH_A_OWP_3" x="4098025" y="-2882491" z="-6760417" r="2">
<o t="23" s="10"> <!-- wares list container -->
<o t="24" s="15"/> <!-- t=24 ? -->
<o t="26" s="0" v="0"/> <!-- t=26 ? -->
<o t="26" s="0" v="0"/>
<o t="26" s="0" v="0"/>
<o t="26" s="0" v="0"/>
</o> <!-- end wares list container -->
...
<o id="8290" t="7" s="SS_SH_B_M5" r="2"> <!-- ship (octopus) -->
<o t="23" s="10"> <!-- wares container -->
<o t="24" s="4"/> <!-- again? -->
<o t="26" s="6" v="8287"/> <!-- again? -->
<o t="26" s="4" v="0"/>
<o t="26" s="0" v="0"/>
<o t="26" s="0" v="0"/>
</o>
</o>
</o>
28 - I'm guessing this is debris in "new" sectors that hasn't been moved into x3_universe_debris.xml?
-
- Posts: 2718
- Joined: Sun, 9. Sep 07, 15:39