Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 5

Author Topic: Modding Tool: DF World Tinker 0.34.11.0  (Read 35507 times)

zilpin

  • Bay Watcher
  • 437 forever!
    • View Profile
Modding Tool: DF World Tinker 0.34.11.0
« on: September 28, 2010, 09:06:01 am »

DFFD dfWorldtinker 0.34.11.x download page

Simple command line tool for tinkering with regions after world generation.
At this moment, able to export and import most raw file data.
Able to insert new tags as well. As a result, able to break save games if you're not careful.
Not user friendly, but it works.

Drop in the DF folder, open a command prompt, and run it.

Usage:
Code: [Select]
dfworldtinker <region> <export|import> <file>
Examples:
Code: [Select]
dfworldtinker region1 export -
dfworldtinker 1 export exportfile.txt
dfworldtinker 1 import modifiedfile.txt


All parameters are required.
Regions can either be entered with their full name, or just as their number for convenience.
Entering a single dash for the input/output file reads from or writes to terminal.
If no commands given, enters a very simple interactive mode.
Commands can be reduced to first character.  E.g. "e" for "export"  and "i" for "import".

* Only able to edit non-compressed saved games and regions. See your init file. *

Official Supported DF versions:
34.11

About the Sync command
Broken.  Using this may awaken the Old Ones and lead to the end of humanity.  Don't.

About Interactive Mode
It's a cheap hack, not intended to be user friendly, all it does is bootstrap the command line parameters for you, then process as it would have from the command line.  No plans to make it pretty.

Automatic Backup
The world file is automatically backed up, given an extension with a date and time stamp.  You can find the backups in the save folder.

Limitations
Toady stores entities differently in the save file, so your civilization will not gain new things you add to the raws.  No way around this until I get help from someone who understands the entity data structures.  That sucks, because it means new reactions, items, workshops, etc, can not be added as they once were.
Need help with entity data in save files.

« Last Edit: April 28, 2013, 09:49:51 am by zilpin »
Logged

Impending Doom

  • Bay Watcher
  • has gone stark raving mad!
    • View Profile
Re: DF World Tinker
« Reply #1 on: September 28, 2010, 09:20:45 am »

Link or it didn't happen.

And from what I see here, I sincerely hope that it DID happen. :)
Logged
Quote from: Robert A.Heinlein
Violence, naked force, has settled more issues in history than has any other factor, and the contrary opinion, that violence has never solved anything, is wishful thinking at its worst.

Gearheart

  • Bay Watcher
    • View Profile
Re: DF World Tinker
« Reply #2 on: September 28, 2010, 09:55:49 am »

Love it.
Logged

ungulateman

  • Bay Watcher
  • [PREFSTRING: haunting moos]
    • View Profile
Re: DF World Tinker
« Reply #3 on: September 28, 2010, 10:59:33 am »

This...is brilliant. Thank you for this awesome prgram.
Logged
That's the great thing about this forum. We can derail any discussion into any other topic.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

Aramco

  • Bay Watcher
    • View Profile
Re: DF World Tinker
« Reply #4 on: September 28, 2010, 02:09:40 pm »

Link or it didn't happen.

And from what I see here, I sincerely hope that it DID happen. :)

It's a MOD. You download it to see if it works. I also hope it works, but I am going to find out by downloading it.

EDIT: It will not work. When I click on it, it flashes onto the screen, then goes away.  I am playing 31.14, but you said it worked for that. Why is it not working? (I have a feeling I am just being stupid)
« Last Edit: September 28, 2010, 02:27:48 pm by Aramco »
Logged
Or maybe there's a god who's just completely insane and sends you to Detroit, Michigan in a new body if you ever utter the name "Pat Sajak".

zilpin

  • Bay Watcher
  • 437 forever!
    • View Profile
Re: DF World Tinker
« Reply #5 on: September 28, 2010, 03:21:59 pm »

It does work, when used as directed.

From the first post:
Quote
Simple command line tool for...
Quote
Drop in the DF folder, open a command prompt , and run it.

Also, note the "Usage:" section and examples.

It flashes and exits because you didn't give it any parameters (double clicking can't).  So it opens, recognizes that it's missing parameters, prints a short help message, then Windows automatically closes the window for you.

Here are some helpful links about the command prompt, courtesy of Google:
http://en.wikipedia.org/wiki/Command_Prompt
http://www.pcworld.com/article/121786/windows_tips_windows_command_line_puts_you_in_control.html
http://commandwindows.com/
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true


Maybe at some point I'll make an interactive user interface (like the dfhack tools), but don't hold your breath.
This is just a precursor.  I made it to test my region reverse-engineering, and released it since I figured it may be useful to modders.
My main thrust is a more involved project to perform detailed searching for embark sites.
Logged

Wideman

  • Bay Watcher
    • View Profile
Re: DF World Tinker
« Reply #6 on: September 28, 2010, 03:54:09 pm »

WOAH,

what a funky tool you, have there.

ok for those who dont know how to use it,
ill do a step by step guide.

1. download,
2.copy or cut. into your, DF folder.
3. for win 7 users. Push and hold the Win Key+R
4. type in cmd.
that should open a command prompt window.                     
Spoiler (click to show/hide)
5. go to your DF folder in my case its
C:\Users\Stephen\DF
so the command is, cd C:\Users\Stephen\DF        (used mine as an example)
where my letter C: is refers to the hard drive letter your DF file is located.
6. then type, dfworldtinker.exe 1 export exportfile.txt     push enter                 
Spoiler (click to show/hide)
7. there you go it has been created.... (where 1 is is the region you want to edit)
8. if you have edited the file then you go: dfworldtinker.exe 1 import exportfile.txt
and thats all folks..
« Last Edit: September 28, 2010, 04:23:25 pm by Wideman »
Logged
hmmmm you should be very afraid.... The computers around the world have eyes and ears and theyre plotting against the human race in theyre binary chants

Aramco

  • Bay Watcher
    • View Profile
Re: DF World Tinker
« Reply #7 on: September 28, 2010, 04:06:22 pm »

WOAH,

what a funky tool you, have there.

ok for those who dont know how to use it,
ill do a step by step guide.

1. download,
2.copy or cut. into your, DF folder.
3. for win 7 users. Push and hold the Win Key+R
4. type in cmd.
that should open a command prompt window.
5. go to your DF folder in my case its
C:\Users\Stephen\DF
so the command is, cd C:\Users\Stephen\DF        (used mine as an example)
where my letter C: is refers to the hard drive letter your DF file is located.
6. then type, dfworldtinker.exe 1 export exportfile.txt     push enter
7. there you go it has been created.... (where 1 is is the region you want to edit)
8. if you have edited the file then you go: dfworldtinker.exe 1 import exportfile.txt
and thats all folks..

I tried that, when I got to step 6. It said "'dfworldtinker.exe' is not recognized as an internal or external command operable program or batch file.
Logged
Or maybe there's a god who's just completely insane and sends you to Detroit, Michigan in a new body if you ever utter the name "Pat Sajak".

Wideman

  • Bay Watcher
    • View Profile
Re: DF World Tinker
« Reply #8 on: September 28, 2010, 04:10:26 pm »

did you, put the rest of the command line in?
and are you on win7/vista or xp?
Logged
hmmmm you should be very afraid.... The computers around the world have eyes and ears and theyre plotting against the human race in theyre binary chants

Aramco

  • Bay Watcher
    • View Profile
Re: DF World Tinker
« Reply #9 on: September 28, 2010, 04:12:12 pm »

did you, put the rest of the command line in?
and are you on win7/vista or xp?

Yeah, I put in all in. I am on windows xp.
Logged
Or maybe there's a god who's just completely insane and sends you to Detroit, Michigan in a new body if you ever utter the name "Pat Sajak".

Wideman

  • Bay Watcher
    • View Profile
Re: DF World Tinker
« Reply #10 on: September 28, 2010, 04:15:55 pm »

ok, try typing in dfWorldTinker.exe instead of dfworldtinker.exe  (i renamed my one you see)

and the program is in the DF folder with the Dwarffotress.exe?   
« Last Edit: September 28, 2010, 04:25:40 pm by Wideman »
Logged
hmmmm you should be very afraid.... The computers around the world have eyes and ears and theyre plotting against the human race in theyre binary chants

Aramco

  • Bay Watcher
    • View Profile
Re: DF World Tinker
« Reply #11 on: September 28, 2010, 04:24:41 pm »

ok, try typing in dfWorldTinker.exe instead of dfworldtinker.exe  (i renamed my one you see)

Just the capitalization difference? I've already tried that. Unless... Does Dwarf Fortress need to be open at the same time?

Oh, I'm stupid, I did leave some out.

No, wait, now it says 'The system cannot find the path specified' I figured it meant there was a typo somewhere, but I cannot find any.
« Last Edit: September 28, 2010, 04:37:30 pm by Aramco »
Logged
Or maybe there's a god who's just completely insane and sends you to Detroit, Michigan in a new body if you ever utter the name "Pat Sajak".

Wideman

  • Bay Watcher
    • View Profile
Re: DF World Tinker
« Reply #12 on: September 28, 2010, 04:26:41 pm »

no.. if u look at my original post i have included images.. if you check them, out, and make sure your dfworldtinker.exe file is where mine is is should work..

and to be honest. i dont know how it works after that.. i mean adding the tags. im still trying to work that out
« Last Edit: September 28, 2010, 04:28:43 pm by Wideman »
Logged
hmmmm you should be very afraid.... The computers around the world have eyes and ears and theyre plotting against the human race in theyre binary chants

zilpin

  • Bay Watcher
  • 437 forever!
    • View Profile
Re: DF World Tinker
« Reply #13 on: September 28, 2010, 08:46:41 pm »

Yes, it is a bit light on lacking any documentation.

Tags are dumped raw to output, and are read in raw.

Let's do an example case, like a free coke reaction for the smelter (everybody loves free coke!).

1) Do everything you would normally do when modding a new reaction.  Namely, create the reaction in the reaction_smelter.txt raw file in the region's raw\objects folder.   Something like this:
Quote
[REACTION:FREE_COKE]
[NAME:free coke baby!]
[BUILDING:SMELTER:NONE]
[PRODUCT:100:10:BAR:NO_SUBTYPE:COAL:COKE][PRODUCT_DIMENSION:150]
[SKILL:SMELT]

Add it to the end of the file.

Like  normal, add the tag to the entity_default.txt file, for example:
Quote
[PERMITTED_REACTION:FREE_COKE]

If you don't understand that so far, go look at the other reaction modding threads.


Now the free coke is supported in your save game's raws, but it doesn't exist in the world, so loading the game will ignore it.
Now's when you edit the exported file from dfworldtinker.
Search for the ====reaction====
That is how I delimit and identify the different sections.
You should see a list of all the reactions in the game.  Simply add a new line with:
Quote
FREE_COKE
It must be on it's own line, it must come after the existing reactions, and it must be in all capital letters.
Save the file, and run the import command for your region and the edited file.

First the program makes a backup of your world file, which can get big, so pay attention to it.
If everything works, inside the game the smelter will now be able to create free coke.


Some notes on importing:
When re-importing a file, note that the sections must come in the order expected, must be exactly what you want added, and the tags themselves must be in the correct order, or strange things will happen.  If, for example, you swap the DIAMOND_RED line with the SAND_RED line, every layer of red sand in the world will be replaced with red diamond, and vice versa.  Not only that, but every bag of red sand will transmute to bags of red diamond powder, every red diamond gem will transmute to red sand gem.  This is, obviously undesired and unstable.  I only intend the tool for adding tags for modding a running game... but you are free to use it as you like.

After all, a solid raw adamantine mountain where there used to be boring granite does sound kind of cool, doesn't it?
...
Spoiler (click to show/hide)
...
note how it still has all the veins in it.


Clear as mudstone?

Logged

Artanis00

  • Bay Watcher
    • View Profile
Re: DF World Tinker
« Reply #14 on: September 29, 2010, 02:58:22 am »

I'm either doing something wrong, or 0.31.10 linux saves don't work:

Code: [Select]
wine tinker.exe region4 export - > region4
Reading Region region4 at .\data\save\region4\world.sav
Error: world file version unsupported: 25.5

Also, linux version?
Logged
Git - fast, efficient, distributed version control system
Github - Free public repositories, issue tracking, wikis, downloads...
Pages: [1] 2 3 ... 5