TwareT data is a types file relating to technical wares.
IMPORTANT
*** If you dont understand how to use the X3 editing software or use an alternative editor or know how to extract TwareT then you need to read the various tutorials first about how to do this before considering supporting your own merging processes. ***
(Remember to back-up your data before editing and use safe areas and files to do so. Also dont edit core ES data files, if you dont know what these are then I refer you to the sentence above).
Unsigned scripts and mods are add-ons to your game that are completely unsupported by Egosoft. They are generally created by other members of the community and may have varying degrees of effectiveness or even problems. Installing any of these has the potential of breaking your game. In general, the users in this forum will attempt to help you solve any problems created by the installation of scripts and mods, but you cannot expect Egosoft or the official technical support channels to help you with problems created by unofficial add-ons.
All that means use at own risk as needed for disclaimer.
---------------------------------------------------------------------------------
To merge TwareT entries without conflicts between them:
Lines in TwareT take on this format:
Code: Select all
28;0;0;0;0;Index;17id;Cargo Vol;Price Index;Price Weighting;Price Weighting;Cargo Class;Price Index;Notoreity;0;0;SS_WARE_SW_NAME
Code: Select all
27;166;0;0;0;0;2043;4;8;25;7;3;9;0;1052;0;SS_WARE_TECH204;
1) Index:
From the above definitions where you see the field marked "index" (the 6th value bounded by the semi-colon ";") and that you can also see that entries in the file are sequential (normally) starting from 0 in the definitions and increasing (0, 1, 2, 3, 4 .........).
This is the referential index so if merging content you normally add values or append them to the end of the list, and the index numbers follow the sequence. So if the last index value is 112 the next one you add is 113 then 114, 115, ......and so on.
2) Page 17 Id
Again in the above definitions in the field marked "17id" (the 7th value). This is the unique reference that the game engine and/or scripts uses to reference the the TwareT file. As a result these values need to be UNIQUE if you want to add a new one with the same defnition then you will create a conflict, so you can only sensibly merge content that have new unique definitions.
However, if all the definitions you want to add are unique and usually they are if the scripter/modder has checked for vanilla defnitions, EMP mod and any other mods that have registered id's. Then the chances are you will be able to append these values onto the list and the id's remain the same. If not you will have to discuss with the person(s) who developed the mod(s) to consider changing id references to avoid conflcits with other work. Due to mods sometimes being independant however and may have large number of TwareT entries then id's may conflict but in the main the chances of missing are in your favour.
(Note id's usually have gaps between them if following a pattern for other technical reasons (ware descriptions mostly in t-files), so don't worry if they dont follow sequentially, they just need to remain unique).
-----------------------------------------------------------------------------------
Once happy that you have no conflicts, you can append your values to the end remembering to keep the sequential index values.
Having now entered more entries you need to alter the total count in the value for it at the top of the file.
At the top of the file you will also see a two number entry e.g.:
47;nnn;
47 is ES ref to TwareT, dont! change this.
The nnn is the number that corresponds to the total number of rows. So if your value is 112 and you add 10 rows the new value should be 122.
-------------------------------------------------------------------------------------------------------------------------------------------
Note to scripters:
Using a technique like below where you supply the $ware.id (TwareT page 17 id) as an argument (or in the script) used in combination with general library fuctions means that you can reference the ware by id rather than a literal in the code. So if id definitions need to change you can change the id references accordingly without having to go through all your code to change the literals.
(Thanks to Gazz, as the supplier of the method).
Code: Select all
$ware = null
$main.type = 16
$page = 17
$ware.ref = read text: page=$page id=$ware.id
$ware.defn = sprintf: fmt='%s', $ware.ref, null, null, null, null
$found = [FALSE]
$sub.type = get number of subtypes of maintype $main.type
while $sub.type AND $found == [FALSE]
dec $sub.type =
$ware.chk = get ware from maintype $main.type and subtype $sub.type
$ware.lkup = sprintf: fmt='%s', $ware.chk, null, null, null, null
if $ware.defn == $ware.lkup
$found = [TRUE]
$ware = $ware.chk
end
end
return $ware
Hope this helps.