Results 1 to 4 of 4

Thread: Translating Data out of File

  1. #1

    Thread Starter
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    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:
    1. Private Sub Command1_Click()
    2. Dim buff As String, buff2 As Long 'declare variables
    3. Open "D:\Age of Empires II\Data\Interfac.drs" For Binary Access Read As #1 'change to your age of empires folder
    4. buff = String(40, Chr(0)) 'fill the buffer so that binary access works
    5. Get #1, 1, buff 'get the info into the variable buff
    6. MsgBox buff 'display buff to you
    7. buff = String(4, Chr(0)) 'repeat steps over to get version, tribe, etc.
    8. Get #1, 41, buff
    9. MsgBox buff
    10. buff = String(12, Chr(0))
    11. Get #1, 45, buff
    12. MsgBox buff
    13. Get #1, 54, buff2
    14. MsgBox buff2
    15. Get #1, 59, buff2
    16. MsgBox buff2
    17. Close
    18.  
    19. End Sub
    <removed by admin>

  2. #2
    New Member
    Join Date
    May 2001
    Posts
    13
    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.

  3. #3
    New Member
    Join Date
    May 2001
    Posts
    13
    Up

  4. #4
    New Member
    Join Date
    May 2001
    Posts
    13
    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
  •  



Click Here to Expand Forum to Full Width