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.

40d:Cheating

From Dwarf Fortress Wiki
Revision as of 21:31, 29 September 2009 by 71.230.249.145 (talk) (Moving the River Freeze section to Exploits)
Jump to navigation Jump to search

Cheating is altering the game to make dwarf fortress easier. This is distinctly different from exploits. There are two main ways to alter the game: changing the game's raw source files (which are really just text files), and directly altering the game's memory (which requires special tools).

File Edits

The most common use of editing raw files is to get free items, such as gems, adamantine, or flux.

When changing the raw files, you may or may not need to create a new world in order for your changes to be reflected.

Generally speaking, modifications to an existing entry in a raw file don't require a new world. Altering existing reactions or creatures is an example of this.

Worlds created before the modifications were made won't be playable unless the previous version of the raw file is restored. Save your custom raw files if you want to continue playing your game at some future point.

Attempting to play worlds not generated with identical reaction additions will fail on load.

Raw files are located in the raw/objects directory

See also: Material tokens, Creature tokens, Matgloss tokens for making your own custom cheats.

Reaction Additions

Recipes for the Smelter are stored in the file reaction_standard.txt. Adding entries to this list will allow your dwarves to make whatever items they need, as easy as smelting iron ore into iron! This is recommended if you want a lot of items very quickly, but additions you make will not take effect until you start a new world.

Easy Rough Gems

[REACTION:FREE_GEMS22][NAME: make (insert gem name)][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:(insert gem name)]

It's really easy. All you have to do is take the name of the gem from stonegem matgloss and put it in the name and at the end of the product. Take all of that and paste it into the reaction_standard. Create a new world and poof! Your smelter will spit out gems of that type.

For convience, here are all the precious gems in the game.

[REACTION:FREE_GEMS1][NAME: make DIAMOND_LY][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:DIAMOND_LY]
[REACTION:FREE_GEMS2][NAME: make DIAMOND_FY][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:DIAMOND_FY]
[REACTION:FREE_GEMS3][NAME: make EMERALD][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:EMERALD]
[REACTION:FREE_GEMS4][NAME: make RUBY][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:RUBY]
[REACTION:FREE_GEMS5][NAME: make SAPPHIRE][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:SAPPHIRE]
[REACTION:FREE_GEMS6][NAME: make DIAMOND_CLEAR][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:DIAMOND_CLEAR]
[REACTION:FREE_GEMS7][NAME: make DIAMOND_RED][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:DIAMOND_RED]
[REACTION:FREE_GEMS8][NAME: make DIAMOND_GREEN][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:DIAMOND_GREEN]
[REACTION:FREE_GEMS11][NAME: make DIAMOND_BLUE][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:DIAMOND_BLUE]
[REACTION:FREE_GEMS33][NAME: make DIAMOND_YELLOW][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:DIAMOND_YELLOW]
[REACTION:FREE_GEMS44][NAME: make DIAMOND_BLACK][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:DIAMOND_BLACK]
[REACTION:FREE_GEMS55][NAME: make RUBY_STAR][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:RUBY_STAR]
[REACTION:FREE_GEMS55][NAME: make SAPPHIRE_STAR][SMELTER][PRODUCT:100:10:ROUGH:NO_SUBTYPE:STONE:SAPPHIRE_STAR]

Easy Adamantine

Add this:

    [REACTION:ADAMANTINE_WAFERS]
    [NAME:make adamantine wafers]
    [SMELTER]
    [REAGENT]
    [PRODUCT:100:1:BAR:NO_SUBTYPE:METAL:ADAMANTINE]

into reaction_standard.txt. The next time you make a world your dwarves will be capable of creating adamantine from nothing.

  • (Note) When I first tried this, the reaction failed to work. Then I removed the [REAGENT] from the list and it worked fine.

Make Stone Into Logs

Add this:

    [REACTION:FREE_WOOD]
    [NAME:stone to wood]
    [SMELTER]
    [REAGENT:1:STONE:NO_SUBTYPE:STONE:NO_MATGLOSS]
    [PRODUCT:100:1:WOOD:NO_SUBTYPE:WOOD:OAK]

to reaction_standard.txt.

Creature Token Modifications

Modifying creature raw files does NOT require you to create a new world. If you want free items in your game without the hassle of planning your cheats when you create the world, the simplest way is to alter the creature files to make them drop the item on death.

You can also change the physical attributes of your dwarves.

Creature Loot Changes

Missing one critical item for your impatient noble, or slavering fey dwarf, but there's no trader in sight? Have no fear, for you can make your enemies (or butcherable livestock) supply your needs!

Add something like this to their creature entries.

    [ITEMCORPSE:ARMOR:ITEM_ARMOR_CHAINMAIL:METAL:ADAMANTINE]
    [ITEMCORPSE_QUALITY:5]

Note that you do not need to make a new world for this to work, and that you can even change this entry in-between saves on the same adventurer (and by highly likely extension, fortress), which has immense and obvious cheating potential. You may want to take a look at the Item tokens page for a better general understanding of the ITEMCORPSE tag; ITEMCORPSE_QUALITY, on the other hand, simply ranges from 0 (no quality modifier) to 5 (masterpiece quality).

Another example:

[ITEMCORPSE:SHELL:NO_SUBTYPE:TURTLE:TURTLE]

Adding this to, say, a horse, will make that horse drop turtle shells on death; very useful if you have no shelled animals in your fortress area and your mastercrafter gets an unlucky Strange Mood.

Super-Fast Dwarves

If you believe your dwarves are a bit too slow, try opening the following creature token file...

\raw\objects\creature_standard.txt

...and adding [SPEED:1] somewhere after [CREATURE:DWARF] but before the next [CREATURE] entry.

This will make your dwarves do the majority of their actions super fast, including moving, digging and workshop actions.

This may lower FPS when a high population is present[Verify].

Savescumming

Savescumming refers to the practice of regularly backing up your saves so you can revert to one if your fortress crumbles to the last. This can be toggled to be done automatically in the init file, so some might not consider this to be cheating.

Another method to save scum is open up task manager (ctrl+alt+delete) and open the Processes tab, and then selecting dwarfort.exe and clicking on end task. This will cause dwarf fortress to close, reverting to the last saved game. Back a long time ago, this could cause inflate errors and destroy the save-game, but Toady has solved the problem.

Memory Editing

Main article: Memory editing

Memory editing refers to using an external program to modify numbers within the game. This is at its most useful when choosing what to take with you, as you can give yourself an unlimited number of points. What doesn't work in the new version is giving your starting dwarves tons of prof skills, since there now is a limit in how many skills they can start with. You can still start your dwarves with all proficient skills, but you need to change the skill limit value first on every dwarf you want to do this with, also when editing the memory values with such programs as CheatEngine in adventure mode your point value is 4bytes but in fortress you have to change the search to 2bytes only for hex editors though(NOTE as of 0.27.176.38c I have found that you can only edit the value of the first dwarf in you starting team)

The utilities page has several tools that do specific memory hacks, such as to teleport a creature.

Don't forget, Cheat-O-Matic is a very easy to use tool for memory hacking, use it to change starting points, the dwarf skill limits, etc.

Editing the memory of a game has a possibility to cause the game to crash or misbehave, including corrupting of saves.


NOTE: WPE may be flagged as a virus because it injects a DLL, and certain viruses out there use similar techniques to steal sensitive information.

Links
Various Memory Hacking Tools: WPE Pro/PermEdit/Tsearch, ARTMONEY, Cheat-O-Matic,

Cheat Engine

Guide on how to edit the starting skills and points using TSearch: http://www.youtube.com/watch?v=boC-IxvkYsI