diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..071f19cf3
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "plugins/stonesense"]
+ path = plugins/stonesense
+ url = git://github.com/peterix/stonesense.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 602550b74..b13acece1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,10 @@
# main project file. use it from a build sub-folder, see COMPILE for details
+## setting the build type.
+IF(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
+ SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Release RelWithDebInfo.")
+ENDIF()
+
## some generic CMake magic
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(dfhack)
@@ -14,11 +19,6 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "In-source builds are not allowed.")
endif()
-## setting the build type.
-IF(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
- SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Release RelWithDebInfo.")
-ENDIF()
-
# set up versioning.
set(DF_VERSION_MAJOR "0")
set(DF_VERSION_MINOR "31")
diff --git a/README.rst b/README.rst
index 19fc67472..36d932cea 100644
--- a/README.rst
+++ b/README.rst
@@ -280,14 +280,28 @@ Examples:
digcircle
=========
A command for easy designation of filled and hollow circles.
+It has several types of options.
-Options:
+Shape:
--------
:hollow: Set the circle to hollow (default)
:filled: Set the circle to filled
+:#: Diameter in tiles (default = 0, does nothing)
+
+Action:
+-------
:set: Set designation (default)
:unset: Unset current designation
-:#: Radius in tiles (default = 0)
+:invert: Invert designations already present
+
+Designation types:
+------------------
+:dig: Normal digging designation (default)
+:ramp: Ramp digging
+:ustair: Staircase up
+:dstair: Staircase down
+:xstair: Staircase up/down
+:chan: Dig channel
After you have set the options, the command called with no options
repeats with the last selected parameters.
diff --git a/Readme.html b/Readme.html
index 4d7605155..ae5aaa377 100644
--- a/Readme.html
+++ b/Readme.html
@@ -318,7 +318,7 @@ ul.auto-toc {
-
+
DFHack is a Dwarf Fortress memory access library and a set of basic
tools that use it. Tools come in the form of plugins or (not yet)
external tools. It is an attempt to unite the various ways tools
@@ -326,68 +326,70 @@ access DF memory and allow for easier development of new tools.
-
+
DFHack works on Windows XP, Vista, 7 or any modern Linux distribution.
OSX is not supported due to lack of developers with a Mac.
Currently, only the 31.25 version is supported. If you need DFHack
@@ -412,7 +414,7 @@ for older versions, look for older releases.
It is possible to use the Windows DFHack under wine/OSX.
-
+
Installing DFhack involves copying files into your DF folder.
Copy the files from a release archive so that:
@@ -438,7 +440,7 @@ Copy the files from a release archive so that:
If it refuses to load, check the stderr.log file created in your DF folder.
-
+
DFHack basically extends what DF can do with something similar to a quake console. On Windows, this is a separate command line window. On linux, the terminal used to launch the dfhack script is taken over (so, make sure you start from a terminal).
Basic interaction with dfhack involves entering commands into the console. For some basic instroduction, use the 'help' command. To list all possible commands, use the 'ls' command.
Many commands have their own help or detailed description. You can use 'command help' or 'command ?' to show that.
@@ -448,21 +450,21 @@ Some commands can't be used from hotkeys - this includes interactive commands li
Most of the commands come from plugins. Those reside in 'DF/plugins/'.
-
+
First, don't panic :) Second, dfhack keeps a few log files in DF's folder - stderr.log and stdout.log. You can look at those and possibly find out what's happening.
If you found a bug, you can either report it in the bay12 DFHack thread, the issues tracker on github, contact me (peterix@gmail.com) or visit the #dfhack IRC channel on freenode.
-
+
Almost all the commands have a 'help'/'?' option that will give you further help without having to look at this document.
-
+
Automated item dumping tool. All loose items on the floor marked
for dumping are insta-dumped to the position of the in-game cursor.
Cursor must be placed on a floor tile. Instadumped items may not
show up in the cursor description list until you save/reload.
-
+
@@ -474,16 +476,16 @@ show up in the cursor description list until you save/reload.
-
+
Cleans all the splatter that get scattered all over the map.
By default, it leaves mud and snow alone.
-
+
Confiscates items owned by dwarfs.
By default, owned food on the floor and rotten items are confistacted and dumped.
-
+
@@ -503,10 +505,10 @@ By default, owned food on the floor and rotten items are confistacted and dumped
-
+
Allows listing all the vermin colonies on the map and optionally turning them into honey bee colonies.
-
+
@@ -518,16 +520,16 @@ By default, owned food on the floor and rotten items are confistacted and dumped
-
+
Removes all ramps designated for removal from the map. This is useful for replicating the old channel digging designation.
It also removes any and all 'down ramps' that can remain after a cave-in (you don't have to designate anything for that to happen).
-
+
This is the DFusion lua plugin system by warmist/darius, running as a DFHack plugin.
See the bay12 thread for details: http://www.bay12forums.com/smf/index.php?topic=69682.15
-
+
:simple_embark:allows changing the number of dwarves available on embark.
Note
@@ -540,19 +542,19 @@ It also removes any and all 'down ramps' that can remain after a cave-in (you do
-
+
A tool for checking how many tiles contain flowing liquids. If you suspect that your magma sea leaks into HFS, you can use this tool to be sure without revealing the map.
-
+
Makes all saplings present on the map grow into trees (almost) instantly.
-
+
A tool for getting rid of trees and shrubs. By default, it only kills a tree/shrub under the cursor.
The plants are turned into ashes instantly.
-
+
@@ -568,11 +570,11 @@ The plants are turned into ashes instantly.
-
+
Very similar to extirpate, but additionally sets the plants on fire. The fires can and will spread ;)
-
+
Allows adding magma, water and obsidian to the game. It replaces the normal dfhack command line and can't be used from a hotkey.
For more information, refer to the command's internal help.
@@ -582,7 +584,7 @@ temperatures (creating heat traps). You've been warned.
-
+
This command lets you see and change the game mode directly. Not all combinations are good for every situation and most of them will produce undesirable results.
There are a few good ones though.
@@ -594,22 +596,22 @@ You just lost a fortress and gained an adventurer.
I take no responsibility of anything that happens as a result of using this tool :P
-
+
Forces DF to pause. This is useful when your FPS drops below 1 and you lose control of the game.
-
+
Instantly kills DF without saving.
-
+
Can be used to determine tile properties like temperature.
-
+
Lists all available minerals on the map and how much of them there is. By default, only processes the already discovered part of the map.
-
+
@@ -621,23 +623,23 @@ You just lost a fortress and gained an adventurer.
-
+
This reveals the map. By default, HFS will remain hidden so that the demons don't spawn. You can use 'reveal hell' to reveal everything. With hell revealed, you won't be able to unpause until you hide the map again.
-
+
Reverts the effects of 'reveal'.
-
+
Switches between 'reveal' and 'unreveal'.
-
+
This command will hide the whole map and then reveal all the tiles that have a path to the in-game cursor.
-
+
An isometric visualizer that runs in a second window. This requires working graphics acceleration and at least a dual core CPU (otherwise it will slow down DF).
Unfortunately currently fails to run on Windows XP and most Linux distributions.
All the data resides in the 'stonesense' directory.
@@ -647,24 +649,24 @@ You just lost a fortress and gained an adventurer.
http://df.magmawiki.com/index.php/Utility:Stonesense/Content_repository
-
+
Fills all the adamantine veins again. Veins that were empty will be filled in too, but might still trigger a demon invasion (this is a known bug).
-
+
Designates a whole vein for digging. Requires an active in-game cursor placed over a vein tile. With the 'x' option, it will traverse z-levels (putting stairs between the same-material tiles).
-
+
A permanent alias for 'vdig x'.
-
+
This command can be used for exploratory mining.
See: http://df.magmawiki.com/index.php/DF2010:Exploratory_mining
There are two variables that can be set: pattern and filter.
-
+
@@ -681,7 +683,7 @@ You just lost a fortress and gained an adventurer.
-
+
@@ -697,7 +699,7 @@ You just lost a fortress and gained an adventurer.
After you have a pattern set, you can use 'expdig' to apply it again.
-
+
- 'expdig diag5 hidden' = designate the diagonal 5 patter over all hidden tiles.
- 'expdig' = apply last used pattern and filter.
@@ -706,10 +708,11 @@ You just lost a fortress and gained an adventurer.
-
-
A command for easy designation of filled and hollow circles.
-
-
+
+
A command for easy designation of filled and hollow circles.
+It has several types of options.
+
+
@@ -718,19 +721,51 @@ You just lost a fortress and gained an adventurer.
filled: | Set the circle to filled |
+#: | Diameter in tiles (default = 0, does nothing) |
+
+
+
+
+
+
+
+
+
+
set: | Set designation (default) |
unset: | Unset current designation |
-#: | Radius in tiles (default = 0) |
+
---|
invert: | Invert designations already present |
+
+
+
+
+
+
+
+
+
+
+dig: | Normal digging designation (default) |
+
+ramp: | Ramp digging |
+
+ustair: | Staircase up |
+
+dstair: | Staircase down |
+
+xstair: | Staircase up/down |
+
+chan: | Dig channel |
After you have set the options, the command called with no options
repeats with the last selected parameters.
-
-
+
+
- 'digcircle filled 3' = Dig a filled circle with radius = 3.
- 'digcircle' = Do it again.
@@ -738,11 +773,11 @@ repeats with the last selected parameters.
-
+
Prints the current weather map by default.
Also lets you change the current weather to 'clear sky', 'rainy' or 'snowing'.
-
-
+
+
diff --git a/library/Core.cpp b/library/Core.cpp
index d7601d8b8..b52ddc6c1 100644
--- a/library/Core.cpp
+++ b/library/Core.cpp
@@ -186,7 +186,7 @@ void fIOthread(void * iodata)
"by clicking on the program icon in the top bar of the window.\n\n"
"Basic commands:\n"
" help|? - This text.\n"
- " ls|dir [PLUGIN] - List available commands. Optionally for single plugin.\n"
+ " ls|dir [PLUGIN] - List available commands. Optionally for single plugin.\n"
" cls - Clear the console.\n"
" fpause - Force DF to pause.\n"
" die - Force DF to close immediately\n"
diff --git a/library/include/dfhack/Console.h b/library/include/dfhack/Console.h
index 0aaccd696..f6b09f9b2 100644
--- a/library/include/dfhack/Console.h
+++ b/library/include/dfhack/Console.h
@@ -27,7 +27,6 @@ distribution.
#include "dfhack/Export.h"
#include
#include
-#include
#include
#include
#include
diff --git a/library/include/dfhack/modules/Creatures.h b/library/include/dfhack/modules/Creatures.h
index 967218b56..f83f00c03 100644
--- a/library/include/dfhack/modules/Creatures.h
+++ b/library/include/dfhack/modules/Creatures.h
@@ -260,6 +260,7 @@ namespace DFHack
/**
* \ingroup grp_creatures
*/
+ /*
struct t_like
{
int16_t type;
@@ -268,25 +269,23 @@ namespace DFHack
t_matglossPair material;
bool active;
};
-
+ */
// FIXME: THIS IS VERY, VERY BAD.
+ #define NUM_CREATURE_LABORS 96
#define NUM_CREATURE_TRAITS 30
- #define NUM_CREATURE_LABORS 102
#define NUM_CREATURE_MENTAL_ATTRIBUTES 13
#define NUM_CREATURE_PHYSICAL_ATTRIBUTES 6
/**
- * structure for holding a DF creature's soul
+ * structure for holding a copy of a creature's soul
* \ingroup grp_creatures
*/
struct t_soul
{
uint8_t numSkills;
t_skill skills[256];
- /*
- uint8_t numLikes;
- t_like likes[32];
- */
+ //uint8_t numLikes;
+ //t_like likes[32];
uint16_t traits[NUM_CREATURE_TRAITS];
t_attrib analytical_ability;
t_attrib focus;
@@ -302,15 +301,15 @@ namespace DFHack
t_attrib empathy;
t_attrib social_awareness;
};
-
#define MAX_COLORS 15
+ struct df_creature;
/**
- * structure for holding a DF creature
+ * structure for holding a copy of a creature
* \ingroup grp_creatures
*/
struct t_creature
{
- uint32_t origin;
+ df_creature * origin;
uint16_t x;
uint16_t y;
uint16_t z;
@@ -328,7 +327,7 @@ namespace DFHack
t_name artifact_name;
uint8_t profession;
- char custom_profession[128];
+ std::string custom_profession;
// enabled labors
uint8_t labors[NUM_CREATURE_LABORS];
@@ -346,8 +345,8 @@ namespace DFHack
uint8_t sex;
uint16_t caste;
uint32_t pregnancy_timer; //Countdown timer to giving birth
- bool has_default_soul;
- t_soul defaultSoul;
+ //bool has_default_soul;
+ //t_soul defaultSoul;
uint32_t nbcolors;
uint32_t color[MAX_COLORS];
@@ -355,7 +354,375 @@ namespace DFHack
uint32_t birth_time;
};
- class DFContextShared;
+ /**
+ * Creature attribute descriptor
+ * \ingroup grp_creatures
+ */
+ struct df_attrib
+ {
+ uint32_t unk_0;
+ uint32_t unk_4;
+ uint32_t unk_8;
+ uint32_t unk_c;
+ uint32_t unk_10;
+ uint32_t unk_14;
+ uint32_t unk_18;
+ };
+ /**
+ * Creature skil descriptor
+ * \ingroup grp_creatures
+ */
+ struct df_skill
+ {
+ uint16_t id; // 0
+ int32_t rating; // 4
+ uint32_t experience; // 8
+ uint32_t unk_c;
+ uint32_t rusty; // 10
+ uint32_t unk_14;
+ uint32_t unk_18;
+ uint32_t unk_1c;
+ };
+ /**
+ * A creature's soul, as it appears in DF memory
+ * \ingroup grp_creatures
+ */
+ struct df_soul
+ {
+ uint32_t unk_0;
+ df_name name; // 4
+ uint32_t unk_70;
+ uint16_t unk_74;
+ uint16_t unk_76;
+ int32_t unk_78;
+ int32_t unk_7c;
+ int32_t unk_80;
+ int32_t unk_84;
+ df_attrib mental[NUM_CREATURE_MENTAL_ATTRIBUTES]; // 88..1f3
+ std::vector skills; // 1f4;
+ std::vector unk_204; // pointers to 14 0x14-byte structures ... likes?
+ uint16_t traits[NUM_CREATURE_TRAITS]; // 214
+ std::vector unk_250; // 1 pointer to 2 shorts
+ uint32_t unk_260;
+ uint32_t unk_264;
+ uint32_t unk_268;
+ uint32_t unk_26c;
+ };
+ /**
+ * A creature job - what it's supposed to be doing.
+ * \ingroup grp_creatures
+ */
+ struct df_job
+ {
+
+ };
+ /**
+ * A creature, as it appears in DF memory
+ * \ingroup grp_creatures
+ */
+ struct df_creature
+ {
+ df_name name; // 0
+ std::string custom_profession; // 6c (MSVC)
+ uint8_t profession; // 88
+ uint32_t race; // 8c
+ uint16_t x; // 90
+ uint16_t y; // 92
+ uint16_t z; // 94
+
+ uint16_t unk_x96; // 96
+ uint16_t unk_y98; // 98
+ uint16_t unk_z9a; // 9a
+
+ uint32_t unk_9c;
+ uint16_t unk_a0;
+ int16_t unk_a2;
+ uint32_t unk_a4;
+
+ uint16_t dest_x; // a8
+ uint16_t dest_y; // aa
+ uint16_t dest_z; // ac
+ uint16_t unk_ae; // -1
+
+ std::vector unk_b0; // b0->df (3*4 in MSVC) -> 68->8b (3*3 in glibc)
+ std::vector unk_c0;
+ std::vector unk_d0;
+
+ t_creaturflags1 flags1; // e0
+ t_creaturflags2 flags2; // e4
+ t_creaturflags3 flags3; // e8
+
+ void ** unk_ec;
+ int32_t unk_f0;
+ int16_t unk_f4;
+ int16_t unk_f6;
+ uint16_t caste; // f8
+ uint8_t sex; // fa
+ uint32_t id; // fc
+ uint16_t unk_100;
+ uint16_t unk_102;
+ int32_t unk_104;
+ uint32_t civ; // 108
+ uint32_t unk_10c;
+ int32_t unk_110;
+
+ std::vector unk_114;
+ std::vector unk_124;
+ std::vector unk_134;
+
+ uint32_t unk_144;
+
+ std::vector unk_148;
+ std::vector unk_158;
+
+ int32_t unk_168;
+ int32_t unk_16c;
+ uint32_t unk_170;
+ uint32_t unk_174;
+ uint16_t unk_178;
+
+ std::vector unk_17c;
+ std::vector unk_18c;
+ std::vector unk_19c;
+ std::vector unk_1ac;
+ uint32_t pickup_equipment_bit; // 1bc
+ std::vector unk_1c0;
+ std::vector unk_1d0;
+ std::vector unk_1e0;
+
+ int32_t unk_1f0;
+ int16_t unk_1f4;
+ int32_t unk_1f8;
+ int32_t unk_1fc;
+ int32_t unk_200;
+ int16_t unk_204;
+ uint32_t unk_208;
+ uint32_t unk_20c;
+
+ int16_t mood; // 210
+ uint32_t pregnancy_timer; // 214
+ void* pregnancy_ptr; // 218
+ int32_t unk_21c;
+ uint32_t unk_220;
+ uint32_t birth_year; // 224
+ uint32_t birth_time; // 228
+ uint32_t unk_22c;
+ uint32_t unk_230;
+ df_creature * unk_234; // suspiciously close to the pregnancy/birth stuff. Mother?
+ uint32_t unk_238;
+ int32_t unk_23c;
+ int32_t unk_240;
+ int32_t unk_244;
+ int32_t unk_248;
+ int32_t unk_24c;
+ int32_t unk_250;
+ int32_t unk_254;
+ int32_t unk_258;
+ int32_t unk_25c;
+ int32_t unk_260;
+ int16_t unk_264;
+ int32_t unk_268;
+ int32_t unk_26c;
+ int16_t unk_270;
+ int32_t unk_274;
+ int32_t unk_278;
+ int32_t unk_27c;
+ int16_t unk_280;
+ int32_t unk_284;
+
+ std::vector inventory; // 288 - vector of item pointers
+ std::vector owned_items; // 298 - vector of item IDs
+ std::vector unk_2a8;
+ std::vector unk_2b8;
+ std::vector unk_2c8;
+
+ uint32_t unk_2d8;
+ uint32_t unk_2dc;
+ uint32_t unk_2e0;
+ uint32_t unk_2e4;
+ uint32_t unk_2e8;
+ uint32_t unk_2ec;
+ uint32_t unk_2f0;
+ df_job * current_job; // 2f4
+ uint32_t unk_2f8; // possibly current skill?
+ uint32_t unk_2fc;
+ uint32_t unk_300;
+ uint32_t unk_304;
+
+ std::vector unk_308;
+ std::vector unk_318;
+ std::vector unk_328;
+ std::vector unk_338;
+ std::vector unk_348;
+ std::vector unk_358;
+ std::vector unk_368;
+ std::vector unk_378;
+ std::vector unk_388;
+
+ uint32_t unk_398;
+ int32_t unk_39c;
+ int32_t unk_3a0;
+ int32_t unk_3a4;
+ int32_t unk_3a8;
+ int32_t unk_3ac;
+ int32_t unk_3b0;
+ int32_t unk_3b4;
+ int32_t unk_3b8;
+ int32_t unk_3bc;
+ int32_t unk_3c0;
+ uint32_t unk_3c4;
+ uint32_t unk_3c8;
+
+ df_attrib physical[NUM_CREATURE_PHYSICAL_ATTRIBUTES]; // 3cc..473
+ uint32_t unk_474;
+ uint32_t unk_478;
+ uint32_t unk_47c;
+ uint32_t unk_480;
+ uint32_t unk_484;
+ uint32_t unk_488;
+
+ uint32_t unk_48c; // blood_max?
+ uint32_t blood_count; // 490
+ uint32_t unk_494;
+ std::vector unk_498;
+ std::vector unk_4a8;
+ std::vector unk_4b8;
+ uint32_t unk_4c8;
+ std::vector unk_4cc;
+ std::vector unk_4dc;
+ std::vector unk_4ec;
+ std::vector unk_4fc;
+ std::vector unk_50c;
+ void* unk_51c;
+ uint16_t unk_520;
+ uint16_t unk_522;
+ uint16_t* unk_524;
+ uint16_t unk_528;
+ uint16_t unk_52a;
+ std::vector appearance; // 52c
+ int16_t unk_53c;
+ int16_t unk_53e;
+ int16_t unk_540;
+ int16_t unk_542;
+ int16_t unk_544;
+ int16_t unk_546;
+ int16_t unk_548;
+ int16_t unk_54a;
+ int16_t unk_54c;
+ int16_t unk_54e;
+ int16_t unk_550;
+ int16_t unk_552;
+ int16_t unk_x554; // coords ? (-30.000x3)
+ int16_t unk_y556;
+ int16_t unk_z558;
+ int16_t unk_x55a; // coords again
+ int16_t unk_y55c;
+ int16_t unk_z55e;
+ int16_t unk_560;
+ int16_t unk_562;
+
+ uint32_t unk_564;
+ uint32_t unk_568;
+ uint32_t unk_56c;
+ uint32_t unk_570;
+ uint32_t unk_574;
+ uint32_t unk_578;
+ uint32_t unk_57c;
+ uint32_t unk_580;
+ uint32_t unk_584;
+ uint32_t unk_588;
+ uint32_t unk_58c;
+ uint32_t unk_590;
+ uint32_t unk_594;
+ uint32_t unk_598;
+ uint32_t unk_59c;
+
+ std::vector unk_5a0;
+ void* unk_5b0; // pointer to X (12?) vector
+ uint32_t unk_5b4; // 0x3e8 (1000)
+ uint32_t unk_5b8; // 0x3e8 (1000)
+ std::vector unk_5bc;
+ std::vector unk_5cc;
+ int16_t unk_5dc;
+ int16_t unk_5de;
+ df_name artifact_name; // 5e0
+ std::vector souls; // 64c
+ df_soul* current_soul; // 65c
+ std::vector unk_660;
+ uint8_t labors[NUM_CREATURE_LABORS]; // 670..6cf
+
+ std::vector unk_6d0;
+ std::vector unk_6e0;
+ std::vector unk_6f0;
+ std::vector unk_700;
+ uint32_t happiness; // 710
+ uint16_t unk_714;
+ uint16_t unk_716;
+ std::vector unk_718;
+ std::vector unk_728;
+ std::vector unk_738;
+ std::vector unk_748;
+ uint16_t unk_758;
+ uint16_t unk_x75a; // coords (-30000*3)
+ uint16_t unk_y75c;
+ uint16_t unk_z75e;
+ std::vector unk_760;
+ std::vector unk_770;
+ std::vector unk_780;
+ uint32_t hist_figure_id; // 790
+ uint16_t able_stand; // 794
+ uint16_t able_stand_impair; // 796
+ uint16_t able_grasp; // 798
+ uint16_t able_grasp_impair; // 79a
+ uint32_t unk_79c; // able_fly/impair (maybe)
+ uint32_t unk_7a0; // able_fly/impair (maybe)
+ std::vector unk_7a4;
+ uint32_t unk_7b4;
+ uint32_t unk_7b8;
+ uint32_t unk_7bc;
+ int32_t unk_7c0;
+
+ std::vector unk_7c4;
+ std::vector unk_7d4;
+ std::vector unk_7e4;
+ std::vector unk_7f4;
+ std::vector unk_804;
+ std::vector unk_814;
+
+ uint32_t unk_824;
+ void* unk_828;
+ void* unk_82c;
+ uint32_t unk_830;
+ void* unk_834;
+ void* unk_838;
+ void* unk_83c;
+
+ std::vector unk_840;
+ std::vector unk_850;
+ std::vector unk_860;
+ uint32_t unk_870;
+ uint32_t unk_874;
+ std::vector unk_878;
+ std::vector unk_888;
+ std::vector unk_898;
+ std::vector unk_8a8;
+ std::vector unk_8b8;
+ std::vector unk_8c8;
+ std::vector unk_8d8;
+ std::vector unk_8e8;
+ std::vector unk_8f8;
+ std::vector unk_908;
+
+ int32_t unk_918;
+ uint16_t unk_91c;
+ uint16_t unk_91e;
+ uint16_t unk_920;
+ uint16_t unk_922;
+ uint32_t unk_924;
+ uint32_t unk_928;
+ std::vector unk_92c;
+ uint32_t unk_93c;
+ };
/**
* The Creatures module - allows reading all non-vermin creatures and their properties
* \ingroup grp_modules
@@ -363,6 +730,8 @@ namespace DFHack
*/
class DFHACK_EXPORT Creatures : public Module
{
+ public:
+ std::vector * creatures;
public:
Creatures();
~Creatures();
@@ -372,17 +741,19 @@ namespace DFHack
/* Read Functions */
// Read creatures in a box, starting with index. Returns -1 if no more creatures
// found. Call repeatedly do get all creatures in a specified box (uses tile coords)
- int32_t ReadCreatureInBox(const int32_t index, t_creature & furball,
+ int32_t GetCreatureInBox(const int32_t index, df_creature ** furball,
const uint16_t x1, const uint16_t y1,const uint16_t z1,
const uint16_t x2, const uint16_t y2,const uint16_t z2);
- bool ReadCreature(const int32_t index, t_creature & furball);
- bool ReadJob(const t_creature * furball, std::vector & mat);
+ df_creature * GetCreature(const int32_t index);
+ void CopyCreature(df_creature * source, t_creature & target);
+
+ bool ReadJob(const df_creature * unit, std::vector & mat);
- bool ReadInventoryIdx(const uint32_t index, std::vector & item);
- bool ReadInventoryPtr(const uint32_t index, std::vector & item);
+ bool ReadInventoryByIdx(const uint32_t index, std::vector & item);
+ bool ReadInventoryByPtr(const df_creature * unit, std::vector & item);
- bool ReadOwnedItemsIdx(const uint32_t index, std::vector & item);
- bool ReadOwnedItemsPtr(const uint32_t index, std::vector & item);
+ bool ReadOwnedItemsByIdx(const uint32_t index, std::vector & item);
+ bool ReadOwnedItemsByPtr(const df_creature * unit, std::vector & item);
int32_t FindIndexById(int32_t id);
@@ -391,27 +762,27 @@ namespace DFHack
int32_t GetDwarfCivId ( void );
/* Write Functions */
- bool WriteLabors(const uint32_t index, uint8_t labors[NUM_CREATURE_LABORS]);
- bool WriteHappiness(const uint32_t index, const uint32_t happinessValue);
- bool WriteFlags(const uint32_t index, const uint32_t flags1, const uint32_t flags2);
- bool WriteFlags(const uint32_t index, const uint32_t flags1, const uint32_t flags2, uint32_t flags3);
- bool WriteSkills(const uint32_t index, const t_soul &soul);
- bool WriteAttributes(const uint32_t index, const t_creature &creature);
- bool WriteSex(const uint32_t index, const uint8_t sex);
- bool WriteTraits(const uint32_t index, const t_soul &soul);
- bool WriteMood(const uint32_t index, const uint16_t mood);
- bool WriteMoodSkill(const uint32_t index, const uint16_t moodSkill);
- bool WriteJob(const t_creature * furball, std::vector const& mat);
- bool WritePos(const uint32_t index, const t_creature &creature);
- bool WriteCiv(const uint32_t index, const int32_t civ);
- bool WritePregnancy(const uint32_t index, const uint32_t pregTimer);
-
- void CopyNameTo(t_creature &creature, uint32_t address);
+ //bool WriteLabors(const uint32_t index, uint8_t labors[NUM_CREATURE_LABORS]);
+ //bool WriteHappiness(const uint32_t index, const uint32_t happinessValue);
+ //bool WriteFlags(const uint32_t index, const uint32_t flags1, const uint32_t flags2);
+ //bool WriteFlags(const uint32_t index, const uint32_t flags1, const uint32_t flags2, uint32_t flags3);
+ //bool WriteSkills(const uint32_t index, const t_soul &soul);
+ //bool WriteAttributes(const uint32_t index, const t_creature &creature);
+ //bool WriteSex(const uint32_t index, const uint8_t sex);
+ //bool WriteTraits(const uint32_t index, const t_soul &soul);
+ //bool WriteMood(const uint32_t index, const uint16_t mood);
+ //bool WriteMoodSkill(const uint32_t index, const uint16_t moodSkill);
+ //bool WriteJob(const t_creature * furball, std::vector const& mat);
+ //bool WritePos(const uint32_t index, const t_creature &creature);
+ //bool WriteCiv(const uint32_t index, const int32_t civ);
+ //bool WritePregnancy(const uint32_t index, const uint32_t pregTimer);
+
+ void CopyNameTo(df_creature *creature, df_name * target);
protected:
friend class Items;
- bool RemoveOwnedItemIdx(const uint32_t index, int32_t id);
- bool RemoveOwnedItemPtr(const uint32_t index, int32_t id);
+ bool RemoveOwnedItemByIdx(const uint32_t index, int32_t id);
+ bool RemoveOwnedItemByPtr(df_creature * unit, int32_t id);
private:
struct Private;
diff --git a/library/include/dfhack/modules/Items.h b/library/include/dfhack/modules/Items.h
index df0718a4d..2b74bbb9e 100644
--- a/library/include/dfhack/modules/Items.h
+++ b/library/include/dfhack/modules/Items.h
@@ -73,7 +73,7 @@ union t_itemflags
unsigned int unk3 : 1; ///< 0000 0800 unknown, unseen, unusable
unsigned int unk4 : 1; ///< 0000 1000 unknown, unseen
- unsigned int unk5 : 1; ///< 0000 2000 unknown, unseen
+ unsigned int murder : 1; ///< 0000 2000 Implies murder - used in fell moods
unsigned int foreign : 1; ///< 0000 4000 Item is imported
unsigned int trader : 1; ///< 0000 8000 Item ownwed by trader
diff --git a/library/include/dfhack/modules/Translation.h b/library/include/dfhack/modules/Translation.h
index ba14c2d0d..e21102d50 100644
--- a/library/include/dfhack/modules/Translation.h
+++ b/library/include/dfhack/modules/Translation.h
@@ -67,10 +67,10 @@ namespace DFHack
// names, used by a few other modules.
bool InitReadNames();
- bool readName(t_name & name, uint32_t address);
- bool copyName(uint32_t address, uint32_t target);
+ bool readName(t_name & name, df_name * address);
+ bool copyName(df_name * address, df_name * target);
// translate a name using the loaded dictionaries
- std::string TranslateName(const DFHack::t_name& name, bool inEnglish = true);
+ std::string TranslateName(const DFHack::df_name * name, bool inEnglish = true);
private:
struct Private;
diff --git a/library/modules/Creatures.cpp b/library/modules/Creatures.cpp
index af2925c45..6964e29c9 100644
--- a/library/modules/Creatures.cpp
+++ b/library/modules/Creatures.cpp
@@ -30,6 +30,7 @@ distribution.
#include
#include