Monday, June 20, 2005

Huzzah!!!!

Woo hoo!! I know it's not very impressive but it you examine the screenshot, down at the very end you'll see a little box saying "info read was 31744"... guess where that came from!... yup- my first ever script!!! And it read from a file on the disc!



**Jumps about the place**

Ahem- well it's a giant leap for me anyway as it means I can get data into the game and that the game can use AND most importantly, understand it.

However, having said all of that there are of course some... issues. First off I'm sure you're wondering why the hell the info read was 31744. Well, I had a sample binary data file and it's first few bytes were:

00 7c 3a

Now I'm a smidgen confused at the mo as to how exactly the game reads in info and I'm sure its going to take some tweaking & trial & error BUT I do know that 7C 00 is 31744 in hex. I've also tried changing the start of the file to 00 1a 3a and I got 6656 which again is consistent (6656 = 1a 00 hex) SO!! even though I asked it to just read in one byte it seem to be adding another 00 byte to the info.

I'm not really worried yet as it could be that the 00 if for end of file stuff OR it could be that the variable I used in the script must be 2 bytes long minimum so the game is automatically filling in the missing bit (or byte... HAHAHA!)

Of slightly more concern however, is that I tried to edit the binary file while the game was still running and I got some "file in use" type errors sooo I dunno if permission is going to be a problem. It's not a big problem as I was never intending on constantly having the game update/read the info from the file as it was running (just once when it starts up) but still... would be nice to edit it whenever I want! It may not be a problem for my external program though (assuming I get round to making one!)... Windows may just be being too polite about it... my external program may not be as civilised… I’ll program it to say: “Gimmie that file or I'll break your face!!!”

Oh- and if you haven’t guessed yet, the game will only read in hexadecimal data from binary files... so much for nice simple text i/o... now it's hex & binary i/o... ah well, can't have everything!

0 Comments:

Post a Comment

<< Home