v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Editing Utility:For Each Tile

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.


The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{uv|40d}}
 
 
[[Category:Tweak Modules]][[Category:Utilities]]
 
[[Category:Tweak Modules]][[Category:Utilities]]
  
Line 17: Line 16:
  
 
Below is a list of all the required and optional memory addresses and offsets for each version of Dwarf Fortress on which this utility has been tested.  Most of them are not necessary for limited operation of the program, but certain functions will be unavailable if the needed memory locations are not available.
 
Below is a list of all the required and optional memory addresses and offsets for each version of Dwarf Fortress on which this utility has been tested.  Most of them are not necessary for limited operation of the program, but certain functions will be unavailable if the needed memory locations are not available.
 
====v0.28.181.40d====
 
 
Version Hash Code:  2c686c26307dcccd7c36cc79737ebe4f
 
 
<address name="menu_state" value="0x01393260" />
 
<address name="view_state" value="0x009FC368" />
 
<address name="mouse_x" value="0x009FC294" />
 
<address name="mouse_y" value="0x009FC298" />
 
<address name="mouse_z" value="0x009FC29C" />
 
<address name="viewport_x" value="0x00D457F4" />
 
<address name="viewport_y" value="0x00D73868" />
 
<address name="viewport_z" value="0x00D73844" />
 
<address name="window_grid_x" value="0x01706D4C" />
 
<address name="window_grid_y" value="0x01706D50" />
 
<address name="map_data" value="0x015C4D58"/>
 
<address name="map_x_count" value="0x015C4D70"/>
 
<address name="map_y_count" value="0x015C4D74"/>
 
<address name="map_z_count" value="0x015C4D78"/>
 
<offset name="map_data_type_offset" value="0x0062"/>
 
<offset name="map_data_designation_offset" value="0x0264"/>
 
<offset name="map_data_occupancy_offset" value="0x0664"/>
 
<offset name="map_data_temperature1_offset" value="0x1564"/>
 
<offset name="map_data_temperature2_offset" value="0x1764"/>
 
  
 
====v0.28.181.40c====
 
====v0.28.181.40c====
Line 256: Line 231:
  
 
The semicolon at the end of the operation is optional.  If you were to have more than one operation, as I will show later, then you would need a semicolon between each statement.
 
The semicolon at the end of the operation is optional.  If you were to have more than one operation, as I will show later, then you would need a semicolon between each statement.
 
=====Hide Radius=====
 
 
Once you use reveal, you may want to hide things like magma and UG rivers so you can dig into them "naturally" and trigger their effects.
 
Note the use of the "<" comparison operator.
 
 
Condition:
 
xy_distance_to_cursor<40
 
 
Operations:
 
hide
 
 
=====Remove Aquifers=====
 
 
And finally, do away with those inconvenient aquifers forever.
 
Note that in this example we are passing a variable to the set_aquifer function. Hover the mouse over a function in the "insert" menu to see what variables you can use with it.
 
 
Condition:
 
is_aquifer
 
 
Operations:
 
set_aquifer(false)
 
 
=====Water Ball=====
 
 
And now, just to demonstrate an important shortcoming of all DF cheating utilities:
 
 
Condition:
 
distance_to_cursor<6
 
 
Operations:
 
set_liquid_type_to_water;
 
set_water_level 7;
 
 
This will create a floating sphere of water 6 tiles in radius around your cursor. The important thing to note is that the water won't flow. In fact, any liquid created with a cheating utility will remain in suspended animation, probably forever.
 
The usual way to bring created liquids to life is to build some sort of construction adjacent to them, after which they will flow normally. Other methods may exist, add them if you find them.
 
  
 
====Advanced Examples====
 
====Advanced Examples====
 
=====Vein Miner=====
 
Mine out a vein of minerals all at once.
 
Designate the first tile to be mined then just keep running it until nothing else gets designated.
 
I put some limits on it to keep it from designating tiles that aren't near the cursor so you have to be in look mode. Some tiles other than ores are considered minerals so be careful.
 
 
Conditions:
 
(cursor_z = z) and (xy_distance_to_cursor < 10) and is_mineral and is_wall and
 
(x > 0) and (x < map_width) and
 
(y > 0) and (y < map_height) and (
 
(is_designated_for_mining(x - 1, y - 1, z)) or
 
(is_designated_for_mining(x - 1, y    , z)) or
 
(is_designated_for_mining(x - 1, y + 1, z)) or
 
(is_designated_for_mining(x    , y - 1, z)) or
 
(is_designated_for_mining(x    , y + 1, z)) or
 
(is_designated_for_mining(x + 1, y - 1, z)) or
 
(is_designated_for_mining(x + 1, y    , z)) or
 
(is_designated_for_mining(x + 1, y + 1, z))
 
)
 
 
 
Operations:
 
designate_for_mining
 
 
====Mass editing map tiles====
 
'''WARNING!''' Altering map tiles is not an exact science. Backup your save file just in case you run into nasty surprises.
 
 
=====Get Tile Info=====
 
Provides all the information you need to turn one type of tile into another.
 
 
Condition:
 
at_cursor
 
 
Operations:
 
print_line(get_type);
 
print_line(to_string(get_matgloss_id));
 
 
Once you have the information, use it to create a custom operations set like the one below:
 
 
=====Set Tile Info=====
 
Once you get the information from a tile (See previous example), you can apply it to another tile using "at_cursor", or many tiles using something like "xy_distance_to_cursor", or "is_designated_as_low_traffic"
 
 
This particular example creates red loamy sand walls.
 
 
Note that the argument for set_type is a ''string'', and must be enclosed in quotations.
 
 
Condition:
 
at_cursor
 
 
Operations:
 
set_type("SoilWall");
 
set_matgloss_id(3);
 
 
Things to be aware of:
 
 
-Walls created in this way will not naturally have a floor above them, so depending on the situation you might need to add floors manually using the same technique as you did for walls.
 
 
-Anecdotal evidence indicates that dwarves can remain imprisoned indefinitely in a created wall until it is removed, or they die of thirst/hunger. The effects on other items are unknown, and possibly undesirable.
 

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)