|
-
Oct 20th, 2001, 12:48 AM
#1
Thread Starter
PowerPoster
What kinda of program are you making for Age? A DRS utility like Stoyan Ratchev's? That would be cool to have a visual interface instead of the dos version. You will have to open the file for binary, and read different bits of data, then convert it from hex to decimal, then convert it from decimal to ASCII. This is some code that I wrote just now to get the header info...
VB Code:
Private Sub Command1_Click()
Dim buff As String, buff2 As Long 'declare variables
Open "D:\Age of Empires II\Data\Interfac.drs" For Binary Access Read As #1 'change to your age of empires folder
buff = String(40, Chr(0)) 'fill the buffer so that binary access works
Get #1, 1, buff 'get the info into the variable buff
MsgBox buff 'display buff to you
buff = String(4, Chr(0)) 'repeat steps over to get version, tribe, etc.
Get #1, 41, buff
MsgBox buff
buff = String(12, Chr(0))
Get #1, 45, buff
MsgBox buff
Get #1, 54, buff2
MsgBox buff2
Get #1, 59, buff2
MsgBox buff2
Close
End Sub
-
Oct 20th, 2001, 07:41 PM
#2
New Member
Thanks for the reply.
A little background: I'm trying to make a utility for a game that uses the AoE/AoK engine. Basically, only the graphics are changed - game engine is untouched.
Anyway, I tried your example, and it worked. However, the two last ones (the longs) came out much much longer than expected. The format file says it should turn up as 4 and 2188, respectively. I got numbers in the millions. (There is probably a perfectly good explanation for this, but I'm pretty new to this so I can't catch things like that )
I next tried the example on the other game's file, after modifying the string functions appropriately. The copyright came out fine, but try as I might, I could not get the version or other info to display correctly.
This is the header for the file I'm trying to open:
Code:
Copyright (c) 2001 LucasArts Entertainment Company LLC......1.00swbg............
Last edited by AoErat; Oct 20th, 2001 at 07:44 PM.
-
Oct 20th, 2001, 10:15 PM
#3
New Member
-
Oct 21st, 2001, 11:24 AM
#4
New Member
Really need help on this!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|