Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Accessing map data  (Read 1192 times)

VDOgamez

  • Bay Watcher
    • View Profile
Accessing map data
« on: January 01, 2010, 06:06:31 pm »

I am writing a program that needs to be able to access the map data from Dwarf Fortress. How is the data of the map tiles stored, and how can I access it? Basically, I want an array of all of the individual tiles in the area. How can I retrieve such information?
Logged

3

  • Bay Watcher
    • View Profile
Re: Accessing map data
« Reply #1 on: January 01, 2010, 06:10:05 pm »

While I'm possibly the furthest possible from an expert on the subject, there's a memory access library which is easily your best bet for this sort of thing. It's not perfect yet, but it'll most likely do what you need.
Logged

VDOgamez

  • Bay Watcher
    • View Profile
Re: Accessing map data
« Reply #2 on: January 01, 2010, 09:29:17 pm »

Ah, no java libraries then? Hmm... the program has to be in java.
Logged

soul4hdwn

  • Bay Watcher
  • make due with what you have
    • View Profile
Re: Accessing map data
« Reply #3 on: January 01, 2010, 10:51:12 pm »

Ah, no java libraries then? Hmm... the program has to be in java.

most of the DFhack stuff is C++ but any program (hint dwarf fortress) can make/use its own language if the creator is bold enough
Logged

Duke 2.0

  • Bay Watcher
  • [CONQUISTADOR:BIRD]
    • View Profile
Re: Accessing map data
« Reply #4 on: January 01, 2010, 11:02:50 pm »

http://www.minecraftforum.net/viewtopic.php?id=5231

 Hello and welcome to the forums!

 So yeah guys, this is basically a guy who wants to make a Dwarf Fortress to Minecraft map converter. Thus why Java is an issue. Then again, if it a program separate from either program and merely converts data then it need not be in the language of Minecraft.
Logged
Buck up friendo, we're all on the level here.
I would bet money Andrew has edited things retroactively, except I can't prove anything because it was edited retroactively.
MIERDO MILLAS DE VIBORAS FURIOSAS PARA ESTRANGULARTE MUERTO

VDOgamez

  • Bay Watcher
    • View Profile
Re: Accessing map data
« Reply #5 on: January 01, 2010, 11:25:11 pm »

Well, the language would be much less of an issue if I knew any C++.  ::) I looked at the previously linked library and saw that it did exactly what I needed from this half of the program. Maybe I can just teach myself some very basic C++ so that I can utilize the aforementioned library to output to a text file, then read that in with the java program.
Logged

VDOgamez

  • Bay Watcher
    • View Profile
Re: Accessing map data
« Reply #6 on: January 02, 2010, 10:37:43 pm »

*Headdesk* I completely fail at learning how to use libraries in C++. The program I need is just about twenty lines, but I can't get it to run! I just want to go through all of the tiles and put their values in a text file, but I keep getting errors. ;-; Can anybody figure this out?

Spoiler (click to show/hide)
This is the error I'm recieving:
Spoiler (click to show/hide)
I'm probably making some obvious amateur mistake here, but I can't figure it out.
Logged

Elvang

  • Bay Watcher
    • View Profile
Re: Accessing map data
« Reply #7 on: January 02, 2010, 10:55:58 pm »

Pretty sure something is linked incorrectly, if dfhack comes with a compiled library you'll need to make sure you link it (not an #include).
Logged
The Practicalities of Fire Imp Defense
Tileset fonts for dfterm/telnet
Win 0.34.11 SDL with 7 binary patched bugfixes
Quote from: They Dig
I have come here to drink booze and breach HFS... and I'm all out of booze.

VDOgamez

  • Bay Watcher
    • View Profile
Re: Accessing map data
« Reply #8 on: January 03, 2010, 02:39:10 pm »

I thought as much I just can't figure out how to link to a library in eclipse.
Logged