Difference between revisions of "Talk:TACTICAL.EXE"

From UFOpaedia
Jump to navigation Jump to search
m (→‎English2.dat: forgot to sign)
m
 
(3 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
   0      1      2      3      4
 
   0      1      2      3      4
  
0x7B (or really 0x007B) is 123, which in English2.dat is Pistol
+
* 0x7B (or really 0x007B) is 123, which in English2.dat is Pistol
  
 
For further Proof:
 
For further Proof:
Line 13: Line 13:
 
   26      27      28      29
 
   26      27      28      29
  
0x0095 = 149; english2.dat[149] = 'Stun Rod' (OBDATA[26] Is info for Stun Rod)
+
* 0x0095 = 149; english2.dat[149] = 'Stun Rod' (OBDATA[26] Is info for Stun Rod)
0x00B0 = 176; english2.dat[176] = 'Electro-flare' (OBDATA[27] is info for electro-flare)
+
* 0x00B0 = 176; english2.dat[176] = 'Electro-flare' (OBDATA[27] is info for electro-flare)
OBDATA[28-30] are 'empty' unused obdata slots
+
* OBDATA[28-30] are 'empty' unused obdata slots
  
 
  (OFFSET 5F94E, 62 byte from begining, so 62/2 = 31)
 
  (OFFSET 5F94E, 62 byte from begining, so 62/2 = 31)
Line 21: Line 21:
 
   31      32      33      34
 
   31      32      33      34
  
0x00AE = 174; english2.dat[174] = 'Corpse', Obdata[31-33] are all corpses (with different armor)
+
* 0x00AE = 174; english2.dat[174] = 'Corpse', Obdata[31-33] are all corpses (with different armor)
0x0096 = 150; english2.dat[150] = 'Heavy Plasma', Obdata[34] is info for Heavy Plasma
+
* 0x0096 = 150; english2.dat[150] = 'Heavy Plasma', Obdata[34] is info for Heavy Plasma
  
 
[[User:Pi Masta|Pi Masta]] 19:19, 9 February 2007 (PST)
 
[[User:Pi Masta|Pi Masta]] 19:19, 9 February 2007 (PST)
 +
 +
 +
: Speaking of English.dat (and english2.dat), I noticed we haven't got any documentation for it. From what I can rememeber from a little C++ experimentation a while back, the language file simply loads each null-terminated string into an array of strings and the index for each string is used as the lookup value as seen in files like facil.dat and obdata.dat. I'm not sure if english.dat and english2.dat are loaded into one large string array or if they are in separate arrays. - [[User:NKF|NKF]]
 +
 +
:: I think english.dat is used by geoscape and english2.dat is for tactical. And yes they are simply null terminated strings in an array. Though interestingly I've noticed that it seems to start at 1 and not 0 in some situations (still investigating this). I say this because the sequence matches what I expect except that the offsets are 1 greater than if the array was 0 based. Possibly a value is 'injected' before all this and contains the 0 slot. I guess we could alter one of the look ups to 0 and see what it comes out to.
 +
:: I find these patterns mainly by looking for the electro-flare entry. It appears this item was added later in the game (IRC it's the last string in these files) but in the lists it's in the middle, just before alien weapons and researched items. Otherwise it normally just enumerates (which I've noticed a lot of enumeration in the executables), but of course when it gets to the electro-flare it has to jump to the end, and then jump back. Also the un-used entries help as they break this sequence.
 +
:: I could also make some pages on these files, but should I worry about listing the contents? Is it technically copyrighted?  --[[User:Pi Masta|Pi Masta]] 21:47, 14 March 2007 (PDT)
 +
 +
::: But the presentation is yours! Ah-heh. Well, perhaps not the contents verbatim, but you could show examples. - [[User:NKF|NKF]]

Latest revision as of 05:35, 15 March 2007

English2.dat

Hey I think I found the lookup table for English2.dat (or german2, etc) in TACTICAL.EXE. It's at offset 0x5F910, each entry is 2 bytes long. It corresponds with the entry in OBDATA.DAT. The index in obdata is the offset in this array of 2 bytes. Let me give an example:

(AT OFFSET 5F910)
7B 00 | 7C 00 | 7D 00 | 7E 00 | 7F 00
  0       1       2       3       4
  • 0x7B (or really 0x007B) is 123, which in English2.dat is Pistol

For further Proof:

(OFFSET 5F944, 52 bytes from begining, so 52/2 = 26)
95 00 | B0 00 | 00 00 | 00 00
  26      27      28      29
  • 0x0095 = 149; english2.dat[149] = 'Stun Rod' (OBDATA[26] Is info for Stun Rod)
  • 0x00B0 = 176; english2.dat[176] = 'Electro-flare' (OBDATA[27] is info for electro-flare)
  • OBDATA[28-30] are 'empty' unused obdata slots
(OFFSET 5F94E, 62 byte from begining, so 62/2 = 31)
AE 00 | AE 00 | AE 00 | 96 00
  31      32      33      34
  • 0x00AE = 174; english2.dat[174] = 'Corpse', Obdata[31-33] are all corpses (with different armor)
  • 0x0096 = 150; english2.dat[150] = 'Heavy Plasma', Obdata[34] is info for Heavy Plasma

Pi Masta 19:19, 9 February 2007 (PST)


Speaking of English.dat (and english2.dat), I noticed we haven't got any documentation for it. From what I can rememeber from a little C++ experimentation a while back, the language file simply loads each null-terminated string into an array of strings and the index for each string is used as the lookup value as seen in files like facil.dat and obdata.dat. I'm not sure if english.dat and english2.dat are loaded into one large string array or if they are in separate arrays. - NKF
I think english.dat is used by geoscape and english2.dat is for tactical. And yes they are simply null terminated strings in an array. Though interestingly I've noticed that it seems to start at 1 and not 0 in some situations (still investigating this). I say this because the sequence matches what I expect except that the offsets are 1 greater than if the array was 0 based. Possibly a value is 'injected' before all this and contains the 0 slot. I guess we could alter one of the look ups to 0 and see what it comes out to.
I find these patterns mainly by looking for the electro-flare entry. It appears this item was added later in the game (IRC it's the last string in these files) but in the lists it's in the middle, just before alien weapons and researched items. Otherwise it normally just enumerates (which I've noticed a lot of enumeration in the executables), but of course when it gets to the electro-flare it has to jump to the end, and then jump back. Also the un-used entries help as they break this sequence.
I could also make some pages on these files, but should I worry about listing the contents? Is it technically copyrighted? --Pi Masta 21:47, 14 March 2007 (PDT)
But the presentation is yours! Ah-heh. Well, perhaps not the contents verbatim, but you could show examples. - NKF