I'm trying to Dune 2000 maps, but unlike TD's .bin files, it's 2 doubles for every tile. Unfortunately, you can't store a double in a byte, so it's 4 bytes. I grew up modding CnC, so when I figured out how storing stuff worked, I went with .ini files over any sort of binary format. I think I have to use some sort of "bitwise operator". It's stored in Little Endian, BTW. Would I do something along the lines of "byte2 & byte1"? Thanks in advance.
P.S. On the top bar, "Hosted Sites" is listed twice.
EDIT: I got it working, but I still want to know how you're supposed to do this in a non-interpreted langauge.
//fileid = file_bin_open("test1.bin",0)
//Remember, file is stored Little-Endian style.
//29 02
byte2 = $02 //file_bin_read_byte(fileid)
byte1 = $29 //file_bin_read_byte(fileid)
concatenated_bytes = dec2hex(byte2)+dec2hex(byte1)
show_message(concatenated_bytes)
execute_string("ccn_real = $"+concatenated_bytes)
show_message(string(ccn_real))
//Should give us $0229 (Decimal: 553)
Based off of the specs here:
http://code.google.com/p/dune2000plusone/wiki/mapFileSpec