ESP-file number conversion issue (Java)

Post » Fri May 27, 2011 12:24 am

Hi,

I'm in the course of programming a tool which is supposed to auto-generate interior cells and therefore needs to write an ESP-file. The programming language I'm using is Java. I have no experience in other languages yet. So what I've basically done until now is anolyzing the binary data in simple esp-files that have one interior with nothing in it but varying ambient settings. I've slowly started to get a draft about which byte is used for what information.

The problem started when I tried to read the number which defines the water level in an interior cell. It consists of four bytes, so it should be a usual signed integer (also seeing that the number range of the water height in the CS equals the number range of a signed integer). When I tried to line up the four bytes into an integer in Java, there turn out numbers that don't seem sensible to me. I've tried various ways but without any success. The same applies to the numbers that define the position of objects in interior cells. I cant get the numbers right in Java.

I know it sounds somewhat stupid but I have a plain and simple problem with the conversion of the number data in the ESP-files.

Has anyone ever tried to read those numbers in ESP-files?
(The bytes defining the water height of an interior are the 4 bytes right before the bytes that say "AMBI")
User avatar
Chloe :)
 
Posts: 3386
Joined: Tue Jun 13, 2006 10:00 am

Post » Fri May 27, 2011 9:20 am

Just glancing at an interior in a hex editor and changing values through the CS and rechecking.. it's not making sense to me. I'll look further into it.
User avatar
RaeAnne
 
Posts: 3427
Joined: Sat Jun 24, 2006 6:40 pm

Post » Fri May 27, 2011 7:14 am

Its a float, not an integer.

BTW. The majority of the format has already been decoded:
http://www.uesp.net/wiki/Tes3Mod:File_Format
User avatar
Heather Stewart
 
Posts: 3525
Joined: Thu Aug 10, 2006 11:04 pm

Post » Fri May 27, 2011 12:27 pm

I don't know Java, but depending on how it works, you should be able to just read a single (float) from the file. Careful with some records, though. The ES* format uses singles, ints, and longs (that's all, IIRC). I'm not sure if the exact contents of the player/NPC stat sections has been deciphered, but there are definitely people who could help you with parts of it.
User avatar
Marguerite Dabrin
 
Posts: 3546
Joined: Tue Mar 20, 2007 11:33 am

Post » Thu May 26, 2011 10:58 pm

Thanks a lot for your answers. :liplick:
Its a float, not an integer.

BTW. The majority of the format has already been decoded:
http://www.uesp.net/wiki/Tes3Mod:File_Format

That link looks pretty useful. I'll look how far I come with that information.
User avatar
Emily Jeffs
 
Posts: 3335
Joined: Thu Nov 02, 2006 10:27 pm

Post » Fri May 27, 2011 5:14 am

Have you tried GenMod / mGen from the http://www.tamriel-rebuilt.org/?p=modding_data/utils?
User avatar
Elena Alina
 
Posts: 3415
Joined: Sun Apr 01, 2007 7:24 am


Return to III - Morrowind