Petr Mrázek 2011-12-24 12:27:59 +01:00
commit 5bee16dbd8
39 changed files with 10096 additions and 2 deletions

1
.gitignore vendored

@ -29,6 +29,7 @@ build/CMakeCache.txt
build/cmake_install.cmake
build/CMakeFiles
build/doc
build/lua
build/bin
build/library
build/tools

@ -1078,6 +1078,13 @@
<Group name="Notes" description="In-game notes">
<Address name="vector"/>
</Group>
<Group name='global'>
<Address name='world'/>
<Address name='ui'/>
<Address name='gview'/>
<Address name='init'/>
<Address name='d_init'/>
</Group>
</Offsets>
</Base>
@ -2309,6 +2316,13 @@
<Group name="World">
<Address name="save_folder" value="0x1847A40" />
</Group>
<Group name='global'>
<Address name='world' value='0x16b0a58'/>
<Address name='ui' value='0x14ee7e0'/>
<Address name='gview' value='0x14f6070'/>
<Address name='init' value='0x184ae58'/>
<Address name='d_init' value='0x1848350'/>
</Group>
</Offsets>
cmake
item vector:
@ -3174,6 +3188,13 @@
<Group name="Notes">
<Address name="vector" value="0x93f635c"/>
</Group>
<Group name='global'>
<Address name='world' value='0x93f77a0'/>
<Address name='ui' value='0x93f0780'/>
<Address name='gview' value='0x8c3e900'/>
<Address name='init' value='0x959c2a0'/>
<Address name='d_init' value='0x959d340'/>
</Group>
</Offsets>
</Version>
</DFHack>

@ -15,6 +15,10 @@ include_directories (depends/tinyxml)
include_directories (depends/tthread)
include_directories (private)
execute_process(COMMAND perl xml/list.pl xml include/dfhack/df ";"
WORKING_DIRECTORY ${dfapi_SOURCE_DIR}
OUTPUT_VARIABLE GENERATED_HDRS)
SET(PROJECT_HDRS_INTERNAL
private/ContextShared.h
private/Internal.h
@ -25,6 +29,7 @@ SET(PROJECT_HDRS
include/DFHack.h
include/dfhack/Console.h
include/dfhack/Core.h
include/dfhack/DataDefs.h
include/dfhack/Error.h
include/dfhack/Export.h
include/dfhack/FakeSDL.h
@ -60,6 +65,8 @@ include/dfhack/modules/Graphic.h
SET(PROJECT_SRCS
Core.cpp
DataDefs.cpp
DataStatics.cpp
PluginManager.cpp
TileTypes.cpp
VersionInfo.cpp
@ -123,6 +130,24 @@ SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE )
LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS})
# Generation
SET_SOURCE_FILES_PROPERTIES(${GENERATED_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE GENERATED TRUE)
FILE(GLOB GENERATE_INPUT_XMLS ${dfapi_SOURCE_DIR}/xml/*.xml)
ADD_CUSTOM_COMMAND(
OUTPUT ${dfapi_SOURCE_DIR}/include/dfhack/df/static.inc
COMMAND perl xml/codegen.pl xml include/dfhack/df
WORKING_DIRECTORY ${dfapi_SOURCE_DIR}
MAIN_DEPENDENCY ${dfapi_SOURCE_DIR}/xml/codegen.pl
DEPENDS ${GENERATE_INPUT_XMLS}
)
ADD_CUSTOM_TARGET(generate_headers DEPENDS ${dfapi_SOURCE_DIR}/include/dfhack/df/static.inc)
# Compilation
ADD_DEFINITIONS(-DBUILD_DFHACK_LIB)
IF(UNIX)
@ -142,6 +167,7 @@ ELSE(WIN32)
ENDIF()
ADD_LIBRARY(dfhack SHARED ${PROJECT_SRCS})
ADD_DEPENDENCIES(dfhack generate_headers)
IF(WIN32)
SET_TARGET_PROPERTIES(dfhack PROPERTIES OUTPUT_NAME "SDL" )

@ -37,6 +37,7 @@ using namespace std;
#include "dfhack/Error.h"
#include "dfhack/Process.h"
#include "dfhack/Core.h"
#include "dfhack/DataDefs.h"
#include "dfhack/Console.h"
#include "dfhack/Module.h"
#include "dfhack/VersionInfoFactory.h"
@ -495,6 +496,10 @@ bool Core::Init()
dump.close();
}
// initialize data defs
virtual_identity::Init();
InitDataDefGlobals(this);
// create mutex for syncing with interactive tasks
StackMutex = new mutex();
AccessMutex = new mutex();

@ -0,0 +1,136 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#include "Internal.h"
#include <string>
#include <vector>
#include <map>
#include "dfhack/Process.h"
#include "dfhack/Core.h"
#include "dfhack/DataDefs.h"
#include "dfhack/VersionInfo.h"
#include "tinythread.h"
using namespace DFHack;
/* The order of global object constructor calls is
* undefined between compilation units. Therefore,
* this list has to be plain data, so that it gets
* initialized by the loader in the initial mmap.
*/
virtual_identity *virtual_identity::list = NULL;
virtual_identity::virtual_identity(const char *dfhack_name, const char *original_name, virtual_identity *parent)
: dfhack_name(dfhack_name), original_name(original_name), parent(parent),
prev(NULL), vtable_ptr(NULL), has_children(true)
{
// Link into the static list. Nothing else can be safely done at this point.
next = list; list = this;
}
/* Vtable to identity lookup. */
static tthread::mutex *known_mutex = NULL;
std::map<void*, virtual_identity*> virtual_identity::known;
virtual_identity *virtual_identity::get(virtual_class *instance_ptr)
{
if (!instance_ptr) return NULL;
// Actually, a reader/writer lock would be sufficient,
// since the table is only written once per class.
tthread::lock_guard<tthread::mutex> lock(*known_mutex);
void *vtable = get_vtable(instance_ptr);
std::map<void*, virtual_identity*>::iterator it = known.find(vtable);
if (it != known.end())
return it->second;
// If using a reader/writer lock, re-grab as write here, and recheck
Core &core = Core::getInstance();
std::string name = core.p->doReadClassName(vtable);
virtual_identity *actual = NULL;
for (virtual_identity *p = list; p; p = p->next) {
if (strcmp(name.c_str(), p->getOriginalName()) != 0) continue;
known[vtable] = p;
p->vtable_ptr = vtable;
return p;
}
known[vtable] = NULL;
return NULL;
}
bool virtual_identity::check_instance(virtual_class *instance_ptr, bool allow_subclasses)
{
virtual_identity *actual = get(instance_ptr);
if (actual == this) return true;
if (!allow_subclasses || !actual) return false;
do {
actual = actual->parent;
if (actual == this) return true;
} while (actual);
return false;
}
void virtual_identity::Init()
{
if (!known_mutex)
known_mutex = new tthread::mutex();
// This cannot be done in the constructors, because
// they are called in an undefined order.
for (virtual_identity *p = list; p; p = p->next) {
p->has_children = false;
p->children.clear();
}
for (virtual_identity *p = list; p; p = p->next) {
if (p->parent) {
p->parent->children.push_back(p);
p->parent->has_children = true;
}
}
}
#define GLOBAL(name,tname) \
df::tname *df::global::name = NULL;
DF_KNOWN_GLOBALS
#undef GLOBAL
void DFHack::InitDataDefGlobals(Core *core) {
OffsetGroup *global_table = core->vinfo->getGroup("global");
uint32_t tmp;
#define GLOBAL(name,tname) \
if (global_table->getSafeAddress(#name,tmp)) df::global::name = (df::tname*)tmp;
DF_KNOWN_GLOBALS
#undef GLOBAL
}

@ -0,0 +1,5 @@
#include "Internal.h"
#include "dfhack/DataDefs.h"
// Instantiate all the static objects
#include "dfhack/df/static.inc"

@ -190,4 +190,11 @@ namespace DFHack
tthread::mutex * misc_data_mutex;
std::map<std::string,void*> misc_data_map;
};
class CoreSuspender {
Core *core;
public:
CoreSuspender(Core *core) : core(core) { core->Suspend(); }
~CoreSuspender() { core->Resume(); }
};
}

@ -0,0 +1,151 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once
#include <string>
#include <vector>
#include <map>
#include "dfhack/Core.h"
#include "dfhack/BitArray.h"
namespace DFHack
{
class virtual_class {};
class DFHACK_EXPORT virtual_identity {
static virtual_identity *list;
static std::map<void*, virtual_identity*> known;
virtual_identity *prev, *next;
const char *dfhack_name;
const char *original_name;
virtual_identity *parent;
std::vector<virtual_identity*> children;
void *vtable_ptr;
bool has_children;
protected:
virtual_identity(const char *dfhack_name, const char *original_name, virtual_identity *parent);
bool check_instance(virtual_class *instance_ptr, bool allow_subclasses);
static void *get_vtable(virtual_class *instance_ptr) { return *(void**)instance_ptr; }
public:
const char *getName() { return dfhack_name; }
const char *getOriginalName() { return original_name ? original_name : dfhack_name; }
virtual_identity *getParent() { return parent; }
const std::vector<virtual_identity*> &getChildren() { return children; }
static virtual_identity *get(virtual_class *instance_ptr);
bool is_instance(virtual_class *instance_ptr) {
if (!instance_ptr) return false;
if (vtable_ptr) {
void *vtable = get_vtable(instance_ptr);
if (vtable == vtable_ptr) return true;
if (!has_children) return false;
}
return check_instance(instance_ptr, true);
}
bool is_direct_instance(virtual_class *instance_ptr) {
if (!instance_ptr) return false;
return vtable_ptr ? (vtable_ptr == get_vtable(instance_ptr))
: check_instance(instance_ptr, false);
}
static void Init();
};
template<class T>
inline T *virtual_cast(virtual_class *ptr) {
return T::_identity.is_instance(ptr) ? static_cast<T*>(ptr) : NULL;
}
template<class T>
inline T *strict_virtual_cast(virtual_class *ptr) {
return T::_identity.is_direct_instance(ptr) ? static_cast<T*>(ptr) : NULL;
}
void InitDataDefGlobals(Core *core);
template<class T>
T *ifnull(T *a, T *b) { return a ? a : b; }
}
namespace df
{
using DFHack::virtual_class;
using DFHack::BitArray;
template<class T>
class class_virtual_identity : public DFHack::virtual_identity {
public:
class_virtual_identity(const char *dfhack_name, const char *original_name, virtual_identity *parent)
: virtual_identity(dfhack_name, original_name, parent) {};
};
template<class EnumType, class IntType = int32_t>
struct enum_field {
IntType value;
enum_field() {}
enum_field(EnumType ev) : value(IntType(ev)) {}
template<class T>
enum_field(enum_field<EnumType,T> ev) : value(IntType(ev.value)) {}
operator EnumType () { return EnumType(value); }
enum_field<EnumType,IntType> &operator=(EnumType ev) {
value = IntType(ev); return *this;
}
};
namespace enums {}
}
#define ENUM_ATTR(enum,attr,val) (df::enums::enum::get_##attr(val))
#define ENUM_ATTR_STR(enum,attr,val) DFHack::ifnull(ENUM_ATTR(enum,attr,val),"?")
#define ENUM_KEY_STR(enum,val) ENUM_ATTR_STR(enum,key,val)
#define ENUM_FIRST_ITEM(enum) (df::enums::enum::_first_item_of_##enum)
#define ENUM_LAST_ITEM(enum) (df::enums::enum::_last_item_of_##enum)
namespace df {
#define DF_KNOWN_GLOBALS \
GLOBAL(world,world) \
GLOBAL(ui,ui) \
GLOBAL(gview,interface) \
GLOBAL(init,init) \
GLOBAL(d_init,d_init)
#define GLOBAL(name,tname) \
struct tname; \
namespace global { extern DFHACK_EXPORT tname *name; }
DF_KNOWN_GLOBALS
#undef GLOBAL
}

@ -0,0 +1,2 @@
*.h
*.inc

@ -0,0 +1,905 @@
#!/usr/bin/perl
use strict;
use warnings;
use XML::LibXML;
my $input_dir = $ARGV[0] || '.';
my $output_dir = $ARGV[1] || 'codegen';
my $main_namespace = $ARGV[2] || 'df';
my $export_prefix = 'DFHACK_EXPORT ';
my %types;
my %type_files;
# Misc XML analysis
our $typename;
our $filename;
sub parse_address($;$) {
my ($str,$in_bits) = @_;
return undef unless defined $str;
# Parse the format used by offset attributes in xml
$str =~ /^0x([0-9a-f]+)(?:\.([0-7]))?$/
or die "Invalid address syntax: $str\n";
my ($full, $bv) = ($1, $2);
die "Bits not allowed: $str\n" unless $in_bits;
return $in_bits ? (hex($full)*8 + ($bv||0)) : hex($full);
}
sub check_bad_attrs($;$$) {
my ($tag, $allow_size, $allow_align) = @_;
die "Cannot use size, alignment or offset for ".$tag->nodeName."\n"
if ((!$allow_size && defined $tag->getAttribute('size')) ||
defined $tag->getAttribute('offset') ||
(!$allow_align && defined $tag->getAttribute('alignment')));
}
sub check_name($) {
my ($name) = @_;
$name =~ /^[_a-zA-Z][_a-zA-Z0-9]*$/
or die "Invalid identifier: $name\n";
return $name;
}
sub is_attr_true($$) {
my ($tag, $name) = @_;
return ($tag->getAttribute($name)||'') eq 'true';
}
sub type_header_def($) {
my ($name) = @_;
return uc($main_namespace).'_'.uc($name).'_H';
}
# Text generation with indentation
our @lines;
our $indentation = 0;
sub with_emit(&;$) {
# Executes the code block, and returns emitted lines
my ($blk, $start_indent) = @_;
local @lines;
local $indentation = ($start_indent||0);
$blk->();
return @lines;
}
sub emit(@) {
# Emit an indented line to be returned from with_emit
my $line = join('',map { defined($_) ? $_ : '' } @_);
$line = (' 'x$indentation).$line unless length($line) == 0;
push @lines, $line;
}
sub indent(&) {
# Indent lines emitted from the block by one step
my ($blk) = @_;
local $indentation = $indentation+2;
$blk->();
}
sub outdent(&) {
# Unindent lines emitted from the block by one step
my ($blk) = @_;
local $indentation = ($indentation >= 2 ? $indentation-2 : 0);
$blk->();
}
sub emit_block(&;$$) {
# Emit a full {...} block with indentation
my ($blk, $prefix, $suffix) = @_;
$prefix ||= '';
$suffix ||= '';
emit $prefix,'{';
&indent($blk);
emit '}',$suffix;
}
# Static file output
my @static_lines;
my %static_includes;
sub with_emit_static(&) {
my ($blk) = @_;
$static_includes{$typename}++;
push @static_lines, &with_emit($blk,2);
}
# Anonymous variable names
our $anon_id = 0;
our $anon_prefix;
sub ensure_name($) {
# If the name is empty, assign an auto-generated one
my ($name) = @_;
unless ($name) {
$name = $anon_prefix.(($anon_id == 0) ? '' : '_'.$anon_id);
$anon_id++;
}
return check_name($name);
}
sub with_anon(&;$) {
# Establish a new anonymous namespace
my ($blk,$stem) = @_;
local $anon_id = $stem ? 0 : 1;
local $anon_prefix = ($stem||'anon');
$blk->();
}
# Primitive types
my @primitive_type_list =
qw(int8_t uint8_t int16_t uint16_t
int32_t uint32_t int64_t uint64_t
s-float
bool ptr-string stl-string flag-bit
pointer);
my %primitive_aliases = (
'stl-string' => 'std::string',
'ptr-string' => 'char*',
'flag-bit' => 'void',
'pointer' => 'void*',
's-float' => 'float',
);
my %primitive_types;
$primitive_types{$_}++ for @primitive_type_list;
sub primitive_type_name($) {
my ($tag_name) = @_;
$primitive_types{$tag_name}
or die "Not primitive: $tag_name\n";
return $primitive_aliases{$tag_name} || $tag_name;
}
# Type references
our %weak_refs;
our %strong_refs;
sub register_ref($;$) {
# Register a reference to another type.
# Strong ones require the type to be included.
my ($ref, $is_strong) = @_;
if ($ref) {
my $type = $types{$ref}
or die "Unknown type $ref referenced.\n";
if ($is_strong) {
$strong_refs{$ref}++;
} else {
$weak_refs{$ref}++;
}
}
}
# Determines if referenced other types should be included or forward-declared
our $is_strong_ref = 1;
sub with_struct_block(&$;$%) {
my ($blk, $tag, $name, %flags) = @_;
my $kwd = (is_attr_true($tag,'is-union') ? "union" : "struct");
my $exp = $flags{-export} ? $export_prefix : '';
my $prefix = $kwd.' '.$exp.($name ? $name.' ' : '');
emit_block {
local $_;
local $is_strong_ref = 1; # reset the state
if ($flags{-no_anon}) {
$blk->();
} else {
&with_anon($blk);
}
} $prefix, ";";
}
sub decode_type_name_ref($;%) {
# Interpret the type-name field of a tag
my ($tag,%flags) = @_;
my $force_type = $flags{-force_type};
my $force_strong = $flags{-force_strong};
my $tname = $tag->getAttribute($flags{-attr_name} || 'type-name')
or return undef;
if ($primitive_types{$tname}) {
die "Cannot use type $tname as type-name of ".$tag->nodeName."\n"
if ($force_type && $force_type ne 'primitive');
return primitive_type_name($tname);
} else {
register_ref $tname, ($force_strong||$is_strong_ref);
die "Cannot use type $tname as type-name of ".$tag->nodeName."\n"
if ($force_type && $force_type ne $types{$tname}->nodeName);
return $main_namespace.'::'.$tname;
}
}
# CONDITIONALS
sub is_conditional($) {
my ($tag) = @_;
return $tag->nodeName =~ /^(cond-if|cond-elseif)$/;
}
sub translate_if_cond($) {
my ($tag) = @_;
my @rules;
if (my $defvar = $tag->getAttribute('defined')) {
push @rules, "defined($defvar)";
}
if (my $cmpvar = $tag->getAttribute('var')) {
if (my $cmpval = $tag->getAttribute('lt')) {
push @rules, "($cmpvar < $cmpval)";
}
if (my $cmpval = $tag->getAttribute('le')) {
push @rules, "($cmpvar <= $cmpval)";
}
if (my $cmpval = $tag->getAttribute('eq')) {
push @rules, "($cmpvar == $cmpval)";
}
if (my $cmpval = $tag->getAttribute('ge')) {
push @rules, "($cmpvar >= $cmpval)";
}
if (my $cmpval = $tag->getAttribute('gt')) {
push @rules, "($cmpvar > $cmpval)";
}
if (my $cmpval = $tag->getAttribute('ne')) {
push @rules, "($cmpvar != $cmpval)";
}
}
return '('.(join(' && ',@rules) || '1').')';
}
our $in_cond = 0;
sub render_cond_if($$$;@) {
my ($tag, $in_elseif, $render_cb, @tail) = @_;
local $in_cond = 1;
{
local $indentation = 0;
my $op = ($in_elseif && $in_elseif >= 2) ? '#elif' : '#if';
emit $op, ' ', translate_if_cond($tag);
}
for my $child ($tag->findnodes('child::*')) {
&render_cond($child, $render_cb, @tail);
}
unless ($in_elseif) {
local $indentation = 0;
emit "#endif";
}
}
sub render_cond($$;@) {
my ($tag, $render_cb, @tail) = @_;
my $tag_name = $tag->nodeName;
if ($tag_name eq 'cond-if') {
render_cond_if($tag, 0, $render_cb, @tail);
} elsif ($tag_name eq 'cond-elseif') {
my $idx = 1;
for my $child ($tag->findnodes('child::*')) {
($child->nodeName eq 'cond-if')
or die "Only cond-if tags may be inside a cond-switch: ".$child->nodeName."\n";
render_cond_if($child, $idx++, $render_cb, @tail);
}
{
local $indentation = 0;
emit "#endif";
}
} else {
local $_ = $tag;
$render_cb->($tag, @tail);
}
}
# ENUM
sub render_enum_core($$) {
my ($name,$tag) = @_;
my $base = 0;
emit_block {
my @items = $tag->findnodes('child::*');
my $idx = 0;
for my $item (@items) {
render_cond $item, sub {
my $tag = $_->nodeName;
return if $tag eq 'enum-attr';
($tag eq 'enum-item')
or die "Invalid enum member: ".$item->nodeName."\n";
my $name = ensure_name $_->getAttribute('name');
my $value = $_->getAttribute('value');
$base = ($idx == 0 && !$in_cond) ? $value : undef if defined $value;
$idx++;
emit $name, (defined($value) ? ' = '.$value : ''), ',';
};
}
emit "_last_item_of_$name";
} "enum $name ", ";";
return $base;
}
sub render_enum_tables($$$) {
my ($name,$tag,$base) = @_;
# Enumerate enum attributes
my %aidx = ('key' => 0);
my @anames = ('key');
my @avals = ('NULL');
my @atypes = ('const char*');
my @atnames = (undef);
for my $attr ($tag->findnodes('child::enum-attr')) {
my $name = $attr->getAttribute('name') or die "Unnamed enum-attr.\n";
my $type = $attr->getAttribute('type-name');
my $def = $attr->getAttribute('default-value');
die "Duplicate attribute $name.\n" if exists $aidx{$name};
check_name $name;
$aidx{$name} = scalar @anames;
push @anames, $name;
push @atnames, $type;
if ($type) {
push @atypes, $type;
push @avals, (defined $def ? $def : "($type)0");
} else {
push @atypes, 'const char*';
push @avals, (defined $def ? "\"$def\"" : 'NULL');
}
}
# Emit accessor function prototypes
emit "const $name _first_item_of_$name = ($name)$base;";
emit_block {
emit "return (value >= _first_item_of_$name && value < _last_item_of_$name);";
} "inline bool is_valid($name value) ";
for (my $i = 0; $i < @anames; $i++) {
emit "${export_prefix}$atypes[$i] get_$anames[$i]($name value);";
}
# Emit implementation
with_emit_static {
emit_block {
emit_block {
# Emit the entry type
emit_block {
for (my $i = 0; $i < @anames; $i++) {
emit "$atypes[$i] $anames[$i];";
}
} "struct _info_entry ", ";";
# Emit the info table
emit_block {
for my $item ($tag->findnodes('child::*')) {
render_cond $item, sub {
my $tag = $_->nodeName;
return if $tag eq 'enum-attr';
# Assemble item-specific attr values
my @evals = @avals;
my $name = $_->getAttribute('name');
$evals[0] = "\"$name\"" if $name;
for my $attr ($_->findnodes('child::item-attr')) {
my $name = $attr->getAttribute('name') or die "Unnamed item-attr.\n";
my $value = $attr->getAttribute('value') or die "No-value item-attr.\n";
my $idx = $aidx{$name} or die "Unknown item-attr: $name\n";
if ($atnames[$idx]) {
$evals[$idx] = $value;
} else {
$evals[$idx] = "\"$value\"";
}
}
emit "{ ",join(', ',@evals)," },";
};
}
emit "{ ",join(', ',@avals)," }";
} "static const _info_entry _info[] = ", ";";
for (my $i = 0; $i < @anames; $i++) {
emit_block {
emit "return is_valid(value) ? _info[value - $base].$anames[$i] : $avals[$i];";
} "$atypes[$i] get_$anames[$i]($name value) ";
}
} "namespace $name ";
} "namespace enums ";
};
}
sub render_enum_type {
my ($tag) = @_;
emit_block {
emit_block {
my $base = render_enum_core($typename,$tag);
if (defined $base) {
render_enum_tables($typename,$tag,$base);
} else {
print STDERR "Warning: complex enum: $typename\n";
}
} "namespace $typename ";
} "namespace enums ";
emit "using enums::",$typename,"::",$typename,";";
}
# BITFIELD
sub get_primitive_base($;$) {
my ($tag, $default) = @_;
my $base = $tag->getAttribute('base-type') || $default || 'uint32_t';
$primitive_types{$base} or die "Must be primitive: $base\n";
return $base;
}
sub render_bitfield_core {
my ($name, $tag) = @_;
emit_block {
emit get_primitive_base($tag), ' whole;';
emit_block {
for my $item ($tag->findnodes('child::*')) {
render_cond $item, sub {
my ($item) = @_;
($item->nodeName eq 'flag-bit')
or die "Invalid bitfield member:".$item->nodeName."\n";
check_bad_attrs($item);
my $name = ensure_name $item->getAttribute('name');
my $size = $item->getAttribute('count') || 1;
emit "unsigned ", $name, " : ", $size, ";";
};
}
} "struct ", " bits;";
} "union $name ", ";";
}
sub render_bitfield_type {
my ($tag) = @_;
render_bitfield_core($typename,$tag);
}
# STRUCT
my %struct_field_handlers;
sub get_struct_fields($) {
# Retrieve subtags that are actual struct fields
my ($struct_tag) = @_;
local $_;
return grep {
my $tag = $_->nodeName;
die "Unknown field tag: $tag\n"
unless exists $struct_field_handlers{$tag};
$struct_field_handlers{$tag};
} $struct_tag->findnodes('child::*');
}
sub get_struct_field_type($) {
# Dispatch on the tag name, and retrieve the type prefix & suffix
my ($tag) = @_;
my $handler = $struct_field_handlers{$tag->nodeName}
or die "Unexpected tag: ".$tag->nodeName;
return $handler->($tag);
}
sub do_render_struct_field($) {
my ($tag) = @_;
my $tag_name = $tag->nodeName;
my $field_name = $tag->getAttribute('name');
# Special case: anonymous compounds.
if ($tag_name eq 'compound' && !defined $field_name &&
!defined $tag->getAttribute('type-name'))
{
check_bad_attrs($tag);
with_struct_block {
render_struct_field($_) for get_struct_fields($tag);
} $tag, undef, -no_anon => 1;
return;
}
# Otherwise, create the name if necessary, and render
my $name = ensure_name $field_name;
with_anon {
my ($prefix, $postfix) = get_struct_field_type($tag);
emit $prefix, ' ', $name, $postfix, ';';
} "T_$name";
}
sub render_struct_field($) {
my ($tag) = @_;
render_cond $tag, \&do_render_struct_field;
}
sub emit_typedef($$) {
# Convert a prefix/postfix pair into a single name
my ($pre, $post) = @_;
my $name = ensure_name undef;
emit 'typedef ', $pre, ' ', $name, $post, ';';
return $name;
}
sub get_container_item_type($$;$) {
# Interpret the type-name and nested fields for a generic container type
my ($tag,$strong_ref,$allow_void) = @_;
check_bad_attrs($tag);
my $prefix;
my $postfix = '';
local $is_strong_ref = $strong_ref;
unless ($prefix = decode_type_name_ref($tag)) {
my @fields = get_struct_fields($tag);
if (scalar(@fields) == 1 && !is_conditional($fields[0])) {
($prefix, $postfix) = get_struct_field_type($fields[0]);
} elsif (scalar(@fields) == 0) {
$allow_void or die "Empty container: ".$tag->nodeName."\n";
$prefix = $allow_void;
} else {
$prefix = ensure_name undef;
with_struct_block {
render_struct_field($_) for @fields;
} $tag, $prefix;
}
}
return ($prefix,$postfix) if wantarray;
return emit_typedef($prefix, $postfix) if $postfix;
return $prefix;
}
sub get_primitive_field_type {
# Primitive type handler
my ($tag,$fname) = @_;
check_bad_attrs($tag);
my $name = $tag->nodeName;
return (primitive_type_name($name), "");
}
sub get_static_string_type {
# Static string handler
my ($tag, $fname) = @_;
check_bad_attrs($tag, 1);
my $count = $tag->getAttribute('size') || 0;
return ('char', "[$count]");
}
sub get_padding_type {
# Padding handler. Supports limited alignment.
my ($tag, $fname) = @_;
check_bad_attrs($tag, 1, 1);
my $count = $tag->getAttribute('size') || 0;
my $align = $tag->getAttribute('alignment') || 1;
if ($align == 1) {
return ('char', "[$count]");
} elsif ($align == 2) {
($count % 2 == 0) or die "Size not aligned in padding: $count at $align\n";
return ('short', "[".($count/2)."]");
} elsif ($align == 4) {
($count % 4 == 0) or die "Size not aligned in padding: $count at $align\n";
return ('int', "[".($count/4)."]");
} else {
die "Bad padding alignment $align in $typename in $filename\n";
}
}
sub get_static_array_type {
# static-array handler
my ($tag, $fname) = @_;
my ($pre, $post) = get_container_item_type($tag, 1);
my $count = $tag->getAttribute('count')
or die "Count is mandatory for static-array in $typename in $filename\n";
return ($pre, "[$count]".$post);
}
sub get_pointer_type($) {
# pointer handler
my ($tag) = @_;
my $item = get_container_item_type($tag, 0, 'void');
return ($item.'*', '');
}
sub get_compound_type($) {
# compound (nested struct) handler
my ($tag) = @_;
check_bad_attrs($tag);
my $tname = decode_type_name_ref($tag);
unless ($tname) {
$tname = ensure_name undef;
with_struct_block {
render_struct_field($_) for get_struct_fields($tag);
} $tag, $tname;
}
return ($tname,'');
}
sub get_bitfield_type($) {
# nested bitfield handler
my ($tag) = @_;
check_bad_attrs($tag);
my $tname = decode_type_name_ref($tag, -force_type => 'bitfield-type');
unless ($tname) {
$tname = ensure_name undef;
with_anon {
render_bitfield_core($tname, $tag);
};
}
return ($tname,'');
}
sub get_enum_type($) {
# nested enum handler
my ($tag) = @_;
check_bad_attrs($tag);
my $tname = decode_type_name_ref($tag, -force_type => 'enum-type', -force_strong => 1);
my $base = get_primitive_base($tag, 'int32_t');
unless ($tname) {
$tname = ensure_name undef;
with_anon {
render_enum_core($tname,$tag);
};
}
return ("enum_field<$tname,$base>", '');
}
sub get_stl_vector_type($) {
# STL vector
my ($tag) = @_;
my $item = get_container_item_type($tag,1,'void*');
$item = 'char' if $item eq 'bool';
return ("std::vector<$item>", '');
}
sub get_stl_bit_vector_type($) {
# STL bit vector
my ($tag) = @_;
check_bad_attrs($tag);
return ("std::vector<bool>", '');
}
sub get_df_flagarray_type($) {
# DF flag array
my ($tag) = @_;
check_bad_attrs($tag);
my $type = decode_type_name_ref($tag, -attr_name => 'index-enum', -force_type => 'enum-type', -force_strong => 1) || 'int';
return ("BitArray<$type>", '');
}
# Struct dispatch table and core
%struct_field_handlers = (
'comment' => undef, # skip
'code-helper' => undef, # skip
'cond-if' => sub { die "cond handling error"; },
'cond-elseif' => sub { die "cond handling error"; },
'static-string' => \&get_static_string_type,
'padding' => \&get_padding_type,
'static-array' => \&get_static_array_type,
'pointer' => \&get_pointer_type,
'compound' => \&get_compound_type,
'bitfield' => \&get_bitfield_type,
'enum' => \&get_enum_type,
'stl-vector' => \&get_stl_vector_type,
'stl-bit-vector' => \&get_stl_bit_vector_type,
'df-flagarray' => \&get_df_flagarray_type,
);
$struct_field_handlers{$_} ||= \&get_primitive_field_type for @primitive_type_list;
sub render_struct_type {
my ($tag) = @_;
my $tag_name = $tag->nodeName;
my $is_class = ($tag_name eq 'class-type');
my $has_methods = $is_class || is_attr_true($tag, 'has-methods');
my $inherits = $tag->getAttribute('inherits-from');
my $original_name = $tag->getAttribute('original-name');
my $ispec = '';
if ($inherits) {
register_ref $inherits, 1;
$ispec = ' : '.$inherits;
} elsif ($is_class) {
$ispec = ' : virtual_class';
}
with_struct_block {
render_struct_field($_) for get_struct_fields($tag);
if ($has_methods) {
if ($is_class) {
emit "static class_virtual_identity<$typename> _identity;";
with_emit_static {
emit "class_virtual_identity<$typename> ${typename}::_identity(",
"\"$typename\",",
($original_name ? "\"$original_name\"" : 'NULL'), ',',
($inherits ? "&${inherits}::_identity" : 'NULL'),
");";
}
}
outdent {
emit "protected:";
};
if ($is_class) {
emit "virtual ~",$typename,"() {}";
} else {
emit "~",$typename,"() {}";
}
}
} $tag, "$typename$ispec", -export => 1;
}
# MAIN BODY
# Collect all type definitions from XML files
sub add_type_to_hash($) {
my ($type) = @_;
my $name = $type->getAttribute('type-name')
or die "Type without a name in $filename\n";
die "Duplicate definition of $name in $filename\n" if $types{$name};
local $typename = $name;
check_bad_attrs $type;
$types{$name} = $type;
$type_files{$name} = $filename;
}
for my $fn (glob "$input_dir/*.xml") {
local $filename = $fn;
my $parser = XML::LibXML->new();
my $doc = $parser->parse_file($filename);
add_type_to_hash $_ foreach $doc->findnodes('/data-definition/enum-type');
add_type_to_hash $_ foreach $doc->findnodes('/data-definition/bitfield-type');
add_type_to_hash $_ foreach $doc->findnodes('/data-definition/struct-type');
add_type_to_hash $_ foreach $doc->findnodes('/data-definition/class-type');
}
# Generate text representations
my %type_handlers = (
'enum-type' => \&render_enum_type,
'bitfield-type' => \&render_bitfield_type,
'class-type' => \&render_struct_type,
'struct-type' => \&render_struct_type,
);
my %type_data;
for my $name (sort { $a cmp $b } keys %types) {
local $typename = $name;
local $filename = $type_files{$typename};
local %weak_refs;
local %strong_refs;
eval {
my $type = $types{$typename};
# Emit the actual type definition
my @code = with_emit {
with_anon {
$type_handlers{$type->nodeName}->($type);
};
} 2;
delete $weak_refs{$name};
delete $strong_refs{$name};
# Add wrapping
my @all = with_emit {
my $def = type_header_def($typename);
emit "#ifndef $def";
emit "#define $def";
for my $strong (sort { $a cmp $b } keys %strong_refs) {
my $sdef = type_header_def($strong);
emit "#ifndef $sdef";
emit "#include \"$strong.h\"";
emit "#endif";
}
emit_block {
for my $weak (sort { $a cmp $b } keys %weak_refs) {
next if $strong_refs{$weak};
my $ttype = $types{$weak};
my $tstr = 'struct';
$tstr = 'enum' if $ttype->nodeName eq 'enum-type';
$tstr = 'union' if $ttype->nodeName eq 'bitfield-type';
$tstr = 'union' if ($ttype->nodeName eq 'struct-type' && is_attr_true($ttype,'is-union'));
emit $tstr, ' ', $weak, ';';
}
push @lines, @code;
} "namespace $main_namespace ";
emit "#endif";
};
$type_data{$typename} = \@all;
};
if ($@) {
print 'Error: '.$@."Type $typename in $filename ignored\n";
}
}
# Write output files
mkdir $output_dir;
{
# Delete the old files
for my $name (glob "$output_dir/*.h") {
unlink $name;
}
# Write out the headers
local $, = "\n";
local $\ = "\n";
for my $name (keys %type_data) {
open FH, ">$output_dir/$name.h";
print FH "/* THIS FILE WAS GENERATED. DO NOT EDIT. */";
print FH @{$type_data{$name}};
close FH;
}
# Write out the static file
open FH, ">$output_dir/static.inc";
print FH "/* THIS FILE WAS GENERATED. DO NOT EDIT. */";
for my $name (sort { $a cmp $b } keys %static_includes) {
print FH "#include \"$name.h\"";
}
print FH "namespace $main_namespace {";
print FH @static_lines;
print FH '}';
close FH;
}

@ -0,0 +1,58 @@
<data-definition>
<class-type type-name='building_def' original-name='building_defst' key-field='code'>
<stl-string name="code"/>
<int32_t name="index"/>
<stl-string name="name"/>
<int32_t name='unk_40'/>
<int32_t name='unk_44'/>
<static-array name='name_color' count='3' type-name='int16_t'/>
<static-array name='tile' count='4'>
<static-array count='31'>
<static-array count='31' type-name='uint8_t'/>
</static-array>
</static-array>
<static-array name='tile_color' count='3'>
<static-array count='4'>
<static-array count='31'>
<static-array count='31' type-name='uint8_t'/>
</static-array>
</static-array>
</static-array>
<static-array name='tile_block' count='31'>
<static-array count='31' type-name='uint8_t'/>
</static-array>
<int32_t name='build_key'/>
<bool name='needs_magma'/>
<stl-vector name="build_items">
<pointer/>
</stl-vector>
<int32_t name="dim_x"/>
<int32_t name="dim_y"/>
<int32_t name="workloc_x"/>
<int32_t name="workloc_y"/>
<stl-vector name="build_labors">
<enum base-type='int32_t' type-name='unit_labor'/>
</stl-vector>
<stl-string name="labor_description"/>
<int32_t name="build_stages"/>
</class-type>
<class-type type-name='building_def_workshopst' inherits-from='building_def'/>
<class-type type-name='building_def_furnacest' inherits-from='building_def'/>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,403 @@
<data-definition>
<bitfield-type type-name='building_flags'>
<flag-bit name='exists' comment='actually built, not just ordered'/>
<flag-bit/>
<flag-bit name='room_collision' comment='major intersection with another room?'/>
<flag-bit/>
<flag-bit name='justice'/>
</bitfield-type>
<class-type type-name='building' original-name='buildingst' key-field='id'>
<code-helper name='find-instance'>(find-by-id $global.world.buildings.all $id $)</code-helper>
<int32_t name='x1' comment='left'/>
<int32_t name='y1'/>
<int32_t name='x2' comment='work location'/>
<int32_t name='x3' comment='right'/>
<int32_t name='y3'/>
<int32_t name='y2'/>
<int32_t name='z'/>
<compound name='flags' type-name='building_flags'/>
<int16_t name='materialType' ref-target='material' aux-value='$$.materialIndex'/>
<int32_t name='materialIndex'/>
<compound name='room'>
<pointer name='extents' type-name='uint8_t'>
<comment>0 - not room; 1 in stockpile; 2 wall; 3 inner; 4 distance boundary.</comment>
</pointer>
<int32_t name='x'/>
<int32_t name='y'/>
<int32_t name='width'/>
<int32_t name='height'/>
</compound>
<int32_t name='age'/>
<int16_t name='race' ref-target='creature_raw'/>
<int32_t name='id'/>
<stl-vector name='jobs'>
<pointer type-name='job'/>
</stl-vector>
<stl-vector name='meetings'>
<pointer type-name='meeting_ref'/>
</stl-vector>
<stl-vector name='unk6' type-name='pointer'/>
<bool name='is_room'/>
<stl-vector name='children' comment='other buildings within this room'>
<pointer type-name='building'/>
</stl-vector>
<stl-vector name='parents' comment='rooms this building belongs to'>
<pointer type-name='building'/>
</stl-vector>
<pointer type-name='unit' name='owner'/>
<stl-vector name='unk7' type-name='pointer'/>
<stl-string name='name'/>
<stl-vector name='activities'>
<pointer>
<int32_t name='id' ref-target='activity_entry'/>
<int32_t name='is_group'/>
</pointer>
</stl-vector>
</class-type>
-- stockpile --
<class-type type-name='building_stockpilest' inherits-from='building'>
<compound type-name='stockpile_settings' name='settings'/>
<int16_t name='max_barrels'/>
<int16_t name='max_bins'/>
<stl-vector name='container_type'>
<enum base-type='int16_t' type-name='item_type'/>
</stl-vector>
<stl-vector name='container_item_id'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='container_x' type-name='int16_t'/>
<stl-vector name='container_y' type-name='int16_t'/>
<pointer name='give_to' type-name='building_stockpilest'/>
<stl-vector name='take_from'>
<pointer type-name='building_stockpilest'/>
</stl-vector>
<int32_t name='stockpile_number'/>
</class-type>
-- zone --
<class-type type-name='building_civzonest' inherits-from='building'>
</class-type>
-- actual --
<class-type type-name='building_actual' inherits-from='building'
original-name='building_actualst'>
<int16_t name='construction_stage'
comment='0 not started, then 1 or 3 max depending on type'/>
<stl-vector name='contained_items'>
<pointer>
<pointer name='item' type-name='item'/>
<int16_t name='use_mode'/>
</pointer>
</stl-vector>
<pointer name='design' type-name='building_design'/>
</class-type>
<struct-type type-name='building_design'>
<int32_t name='architect' ref-target='historical_figure'/>
<int32_t name='unk2' comment='-1'/>
<int16_t name='unk3'/>
<int32_t name='builder1' ref-target='historical_figure'/>
<int32_t name='unk5' comment='-1'/>
<int16_t name='unk6'/>
<int16_t name='build_timer1' comment='+1 per 10 frames while building'/>
<int32_t name='builder2' ref-target='historical_figure'/>
<int16_t name='build_timer2'/>
<int16_t name='unk8b'/>
<int16_t name='unk9'/>
<bitfield name='flags' base-type='uint32_t'>
<flag-bit name='rough' comment='rough gabbro road'/>
<flag-bit name='built'/>
<flag-bit name='designed'/>
</bitfield>
<int32_t name='unk11'/>
<int32_t name='unk12'/>
<int32_t name='unk13'/>
</struct-type>
-- workshops --
<enum-type type-name='furnace_type'>
<enum-item name="WoodFurnace"/>
<enum-item name="Smelter"/>
<enum-item name="GlassFurnace"/>
<enum-item name="Kiln"/>
<enum-item name="MagmaSmelter"/>
<enum-item name="MagmaGlassFurnace"/>
<enum-item name="MagmaKiln"/>
<enum-item name="Custom"/>
</enum-type>
<class-type type-name='building_furnacest' inherits-from='building_actual'>
<stl-vector name='melt_remainder' type-name='int32_t'
index-refers-to='(material-by-id 0 $)'/>
<int16_t name="unk_108"/>
<enum base-type='int16_t' name="type" type-name='furnace_type'/>
<stl-vector name="permitted_workers">
<int32_t ref-target='unit'/>
</stl-vector>
<int32_t name="min_level"/>
<int32_t name="max_level"/>
<int32_t name="custom_type" refers-to='$global.world.raws.buildings.furnaces[$]'/>
</class-type>
<enum-type type-name='workshop_type'>
<enum-item name="Carpenters"/>
<enum-item name="Farmers"/>
<enum-item name="Masons"/>
<enum-item name="Craftdwarfs"/>
<enum-item name="Jewelers"/>
<enum-item name="MetalsmithsForge"/>
<enum-item name="MagmaForge"/>
<enum-item name="Bowyers"/>
<enum-item name="Mechanics"/>
<enum-item name="Siege"/>
<enum-item name="Butchers"/>
<enum-item name="Leatherworks"/>
<enum-item name="Tanners"/>
<enum-item name="Clothiers"/>
<enum-item name="Fishery"/>
<enum-item name="Still"/>
<enum-item name="Loom"/>
<enum-item name="Quern"/>
<enum-item name="Kennels"/>
<enum-item name="Kitchen"/>
<enum-item name="Ashery"/>
<enum-item name="Dyers"/>
<enum-item name="Millstone"/>
<enum-item name="Custom"/>
</enum-type>
<class-type type-name='building_workshopst' inherits-from='building_actual'>
<enum base-type='int16_t' name="type" type-name='workshop_type'/>
<stl-vector name="permitted_workers">
<int32_t ref-target='unit'/>
</stl-vector>
<int32_t name="min_level"/>
<int32_t name="max_level"/>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_118"/>
<int32_t name="custom_type" refers-to='$global.world.raws.buildings.workshops[$]'/>
</class-type>
-- misc --
<class-type type-name='building_animaltrapst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_archerytargetst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_armorstandst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_bars_verticalst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_bars_floorst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_bedst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_boxst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_bridgest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_cabinetst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_cagest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_chainst' inherits-from='building_actual'>
<pointer name='assigned' type-name='unit'/>
<pointer name='chained' type-name='unit'/>
<int16_t name='unk'/>
</class-type>
<class-type type-name='building_chairst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_coffinst' inherits-from='building_actual'>
<bitfield name='burial_mode' base-type='uint16_t'>
<flag-bit name='allow_burial'/>
<flag-bit name='no_citizens'/>
<flag-bit name='no_pets'/>
</bitfield>
</class-type>
<class-type type-name='building_constructionst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_doorst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_farmplotst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_floodgatest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_grate_floorst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_grate_wallst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_hatchst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_hivest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_nestst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_nest_boxst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_roadst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_road_dirtst' inherits-from='building_roadst'>
</class-type>
<class-type type-name='building_road_pavedst' inherits-from='building_roadst'>
</class-type>
<class-type type-name='building_shopst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_siegeenginest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_slabst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_statuest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_supportst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_tablest' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_traction_benchst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_tradedepotst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_trapst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_wagonst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_weaponst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_weaponrackst' inherits-from='building_actual'>
<int16_t name='unk_c0'/>
<stl-vector name='assignments'>
<pointer>
<int32_t name='squad_id' ref-target='squad'/>
<compound name='mode' type-name='squad_use_flags'/>
</pointer>
</stl-vector>
<int32_t name='unk_d0'/>
</class-type>
<class-type type-name='building_wellst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_windowst' inherits-from='building_actual'>
</class-type>
<class-type type-name='building_window_glassst' inherits-from='building_windowst'>
</class-type>
<class-type type-name='building_window_gemst' inherits-from='building_windowst'>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,592 @@
<data-definition>
<enum-type type-name='creature_raw_flags'>
<enum-item/>
<enum-item name='EQUIPMENT_WAGON'/>
<enum-item name='MUNDANE'/>
<enum-item name='VERMIN_EATER'/>
<enum-item name='VERMIN_GROUNDER'/>
<enum-item name='VERMIN_ROTTER'/>
<enum-item name='VERMIN_SOIL'/>
<enum-item name='VERMIN_SOIL_COLONY'/>
<enum-item name='LARGE_ROAMING'/>
<enum-item name='VERMIN_FISH'/>
<enum-item name='LOOSE_CLUSTERS'/>
<enum-item name='FANCIFUL'/>
<enum-item name='BIOME_MOUNTAIN'/>
<enum-item name='BIOME_GLACIER'/>
<enum-item name='BIOME_TUNDRA'/>
<enum-item name='BIOME_SWAMP_TEMPERATE_FRESHWATER'/>
<enum-item name='BIOME_SWAMP_TEMPERATE_SALTWATER'/>
<enum-item name='BIOME_MARSH_TEMPERATE_FRESHWATER'/>
<enum-item name='BIOME_MARSH_TEMPERATE_SALTWATER'/>
<enum-item name='BIOME_SWAMP_TROPICAL_FRESHWATER'/>
<enum-item name='BIOME_SWAMP_TROPICAL_SALTWATER'/>
<enum-item name='BIOME_SWAMP_MANGROVE'/>
<enum-item name='BIOME_MARSH_TROPICAL_FRESHWATER'/>
<enum-item name='BIOME_MARSH_TROPICAL_SALTWATER'/>
<enum-item name='BIOME_FOREST_TAIGA'/>
<enum-item name='BIOME_FOREST_TEMPERATE_CONIFER'/>
<enum-item name='BIOME_FOREST_TEMPERATE_BROADLEAF'/>
<enum-item name='BIOME_FOREST_TROPICAL_CONIFER'/>
<enum-item name='BIOME_FOREST_TROPICAL_DRY_BROADLEAF'/>
<enum-item name='BIOME_FOREST_TROPICAL_MOIST_BROADLEAF'/>
<enum-item name='BIOME_GRASSLAND_TEMPERATE'/>
<enum-item name='BIOME_SAVANNA_TEMPERATE'/>
<enum-item name='BIOME_SHRUBLAND_TEMPERATE'/>
<enum-item name='BIOME_GRASSLAND_TROPICAL'/>
<enum-item name='BIOME_SAVANNA_TROPICAL'/>
<enum-item name='BIOME_SHRUBLAND_TROPICAL'/>
<enum-item name='BIOME_DESERT_BADLAND'/>
<enum-item name='BIOME_DESERT_ROCK'/>
<enum-item name='BIOME_DESERT_SAND'/>
<enum-item name='BIOME_OCEAN_TROPICAL'/>
<enum-item name='BIOME_OCEAN_TEMPERATE'/>
<enum-item name='BIOME_OCEAN_ARCTIC'/>
<enum-item name='BIOME_SUBTERRANEAN_WATER'/>
<enum-item name='BIOME_SUBTERRANEAN_CHASM'/>
<enum-item name='BIOME_SUBTERRANEAN_LAVA'/>
<enum-item name='BIOME_POOL_TEMPERATE_FRESHWATER'/>
<enum-item name='BIOME_POOL_TEMPERATE_BRACKISHWATER'/>
<enum-item name='BIOME_POOL_TEMPERATE_SALTWATER'/>
<enum-item name='BIOME_POOL_TROPICAL_FRESHWATER'/>
<enum-item name='BIOME_POOL_TROPICAL_BRACKISHWATER'/>
<enum-item name='BIOME_POOL_TROPICAL_SALTWATER'/>
<enum-item name='BIOME_LAKE_TEMPERATE_FRESHWATER'/>
<enum-item name='BIOME_LAKE_TEMPERATE_BRACKISHWATER'/>
<enum-item name='BIOME_LAKE_TEMPERATE_SALTWATER'/>
<enum-item name='BIOME_LAKE_TROPICAL_FRESHWATER'/>
<enum-item name='BIOME_LAKE_TROPICAL_BRACKISHWATER'/>
<enum-item name='BIOME_LAKE_TROPICAL_SALTWATER'/>
<enum-item name='BIOME_RIVER_TEMPERATE_FRESHWATER'/>
<enum-item name='BIOME_RIVER_TEMPERATE_BRACKISHWATER'/>
<enum-item name='BIOME_RIVER_TEMPERATE_SALTWATER'/>
<enum-item name='BIOME_RIVER_TROPICAL_FRESHWATER'/>
<enum-item name='BIOME_RIVER_TROPICAL_BRACKISHWATER'/>
<enum-item name='BIOME_RIVER_TROPICAL_SALTWATER'/>
<enum-item name='GOOD'/>
<enum-item name='EVIL'/>
<enum-item name='SAVAGE'/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item name='GENERATED'/>
<enum-item/>
<enum-item/>
<enum-item name='DOES_NOT_EXIST'/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item name='ARTIFICIAL_HIVEABLE'/>
<enum-item name='UBIQUITOUS'/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
</enum-type>
<struct-type type-name='body_part_layer_raw' key-field='layer_name'>
<stl-string name='layer_name'/>
<int32_t name='tissue_id'/>
<df-flagarray name='flags'/>
<int32_t name='unk2'/>
<int32_t name='healing_rate'/>
<int32_t name='vascular'/>
<int32_t name='pain_receptors'/>
<int32_t name='unk6'/>
<int16_t name='unk7'/>
<stl-vector name='unk8'/>
<int32_t name='layer_id' comment='across all body parts'/>
<int32_t name='unk10'/>
<int32_t name='unk11'/>
<int32_t name='layer_depth' comment='-1 for skin and internal organs'/>
<int32_t name='unk13'/>
<int32_t name='unk14'/>
<int32_t name='unk15'/>
<int32_t name='unk16'/>
</struct-type>
<struct-type type-name='body_part_raw' key-field='part_name'>
<stl-string name='part_code'/>
<stl-string name='part_name'/>
<int16_t name='con_part_id'/>
<df-flagarray name='flags'/>
<stl-vector name='layers'>
<pointer type-name='body_part_layer_raw'/>
</stl-vector>
<int32_t name='unk2'/>
<int32_t name='unk3'/>
<int32_t name='unk4'/>
<int32_t name='unk5'/>
<int32_t name='relsize'/>
<int32_t name='unk7'/>
<int16_t name='unk7b'/>
<stl-vector name='name_singular'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector name='name_plural'>
<pointer type-name='stl-string'/>
</stl-vector>
<pointer name='bp_relation_part_id'>
<stl-vector type-name='int16_t'/>
</pointer>
<pointer name='bp_relation_code'>
<stl-vector type-name='int16_t'/> // 0 around of, 1 around by
</pointer>
<pointer name='bp_relation_coverage'>
<stl-vector type-name='int16_t'/>
</pointer>
<uint16_t name='min_temp'/>
<uint16_t name='max_temp'/>
<uint16_t name='temp_factor'/>
<int32_t name='unused'/>
<int32_t name='unk11'/>
<int16_t name='unk12'/>
</struct-type>
<struct-type type-name='caste_raw' key-field='caste_id'>
<stl-string name='caste_id'/>
<code-helper name='find-instance'>$global.world.raws.creatures.all[$$].caste[$]</code-helper>
<static-array type-name='stl-string' name='caste_name' count='3'/>
<stl-string name='vermin_bite_txt'/>
<stl-string name='gnawer_txt'/>
<static-array type-name='stl-string' name='baby_name' count='2'/>
<static-array type-name='stl-string' name='child_name' count='2'/>
<static-array type-name='stl-string' name='itemcorpse_str' count='5'/> // temporary
<static-array type-name='stl-string' name='remains' count='2'/>
<stl-string name='description'/>
<static-array type-name='stl-string' name='mannerisms' count='17'>
<comment>fingers[2], nose, ear, head, eyes, mouth, hair, knuckles, lips, cheek, nails, f eet, arms, hands, tongue, leg</comment>
</static-array>
<uint8_t name='caste_tile'/>
<uint8_t name='caste_soldier_tile'/>
<uint8_t name='caste_alttile'/>
<uint8_t name='caste_soldier_alttile'/>
<uint8_t name='caste_glowtile'/>
<uint16_t name='homeotherm'/>
<int16_t name='unk1_1'/>
<int16_t name='unk1_2'/>
<uint16_t name='fixed_temp'/>
<static-array type-name='int16_t' name='caste_color' count='3'/>
<compound name='misc'>
<int16_t name='litter_size_min'/>
<int16_t name='litter_size_max'/>
<int16_t name='penetratepower'/>
<int16_t name='vermin_bite_chance'/>
<int16_t name='grasstrample'/>
<int16_t name='buildingdestroyer'/>
<enum base-type='int16_t' name='itemcorpse_itemtype' type-name='item_type'/>
<int16_t name='itemcorpse_itemsubtype'/>
<int16_t name='itemcorpse_materialtype'
ref-target='material' aux-value='$$.itemcorpse_materialindex'/>
<int16_t name='itemcorpse_materialindex'/> // NOT 32-bit!
<int16_t name='itemcorpse_quality'/>
<static-array type-name='int16_t' name='remains_color' count='3'/>
<int16_t name='difficulty'/>
<static-array type-name='int16_t' name='caste_glowcolor' count='3'/>
<int16_t name='beach_frequency'/>
<int16_t name='clutch_size_min'/>
<int16_t name='clutch_size_max'/>
<int32_t name='speed'/>
<int32_t name='modvalue'/>
<int32_t name='petvalue'/>
<int32_t name='milkable'/>
<int32_t name='viewrange'/>
<int32_t name='maxage_min'/>
<int32_t name='maxage_max'/>
<static-array type-name='int32_t' name='unk3' count='2'/>
<int32_t name='swim_speed'/>
<int32_t name='trade_capacity'/>
<int32_t name='unk4'/>
<int32_t name='pop_ratio'/>
<int32_t name='adult_size'/>
<static-array type-name='int32_t' name='unk5' count='4'/>
<static-array type-name='int32_t' name='attack_trigger' count='3'/>
<int32_t name='egg_size'/>
<int32_t name='grazer'/>
<int32_t name='petvalue_divisor'/>
<int32_t name='prone_to_rage'/>
<static-array type-name='int32_t' name='unk6' count='29'/>
</compound>
<static-array name='personality' count='30'>
<int16_t name='a'/>
<int16_t name='b'/>
<int16_t name='c'/>
</static-array>
<df-flagarray name='flags'/>
<int32_t name='unk7'/>
<stl-vector name='body_parts'>
<pointer type-name='body_part_raw'/>
</stl-vector>
<stl-vector name='attacks'>
<pointer/>
</stl-vector>
<compound name='unknown1'>
<int32_t name='unk8'/>
<stl-vector type-name='int16_t' name='unk9a'/>
<stl-vector type-name='int16_t' name='unk9b'/>
<stl-vector name='unk10'/>
<stl-vector name='unk11'/>
<stl-vector name='unk12'/>
<stl-vector type-name='int16_t' name='unk13'/>
<stl-vector type-name='int32_t' name='unk14'/>
</compound>
<static-array type-name='int32_t' name='unk15' count='4'/>
<stl-vector name='caste_speech_1'/>
<stl-vector name='caste_speech_2'/>
<static-array name='skill_rates' count='116'>
<static-array type-name='int32_t' count='4'/>
</static-array>
<compound name='attributes'>
<static-array name='phys_att_range' count='7'>
<static-array type-name='int32_t' count='6'/>
</static-array>
<static-array name='ment_att_range' count='7'>
<static-array type-name='int32_t' count='13'/>
</static-array>
<static-array name='phys_att_rates' count='4'>
<static-array type-name='int32_t' count='6'/>
</static-array>
<static-array name='ment_att_rates' count='4'>
<static-array type-name='int32_t' count='13'/>
</static-array>
<static-array type-name='int32_t' name='phys_att_cap_perc' count='6'/>
<static-array type-name='int32_t' name='ment_att_cap_perc' count='13'/>
</compound>
<int8_t name='gender'/>
<stl-vector type-name='int32_t' name='body_size_1'/>
<stl-vector type-name='int32_t' name='body_size_2'/>
<static-array name='unk16' count='19'>
<stl-vector/>
</static-array>
<static-array type-name='int32_t' name='unk17' count='2'/>
<stl-vector type-name='int16_t' name='natural_skill_id'/>
<stl-vector type-name='int32_t' name='natural_skill_exp'/>
<stl-vector type-name='int32_t' name='natural_skill_lvl'/>
<static-array name='caste_profession_name' count='106'>
<stl-string name='singular'/>
<stl-string name='plural'/>
</static-array>
<compound name='extracts'>
<stl-vector type-name='int16_t' name='extract_mat'/>
<stl-vector type-name='int32_t' name='extract_matidx'/>
<static-array name='extract_str' count='3'>
<stl-vector>
<pointer type-name='stl-string'/>
</stl-vector>
</static-array>
<int16_t name='milkable_mat'/>
<int32_t name='milkable_matidx'/>
<static-array name='milkable_str' count='3'>
<stl-string/>
</static-array>
<int16_t name='webber_mat'/>
<int32_t name='webber_matidx'/>
<static-array name='webber_str' count='3'>
<stl-string/>
</static-array>
<int16_t name='vermin_bite_mat'/>
<int32_t name='vermin_bite_matidx'/>
<int16_t name='vermin_bite_chance'/>
<static-array name='vermin_bite_str' count='3'>
<stl-string/>
</static-array>
<int16_t name='tendons_mat'/>
<int32_t name='tendons_matidx'/>
<static-array name='tendons_str' count='3'>
<stl-string/>
</static-array>
<int32_t name='tendons_heal'/>
<int16_t name='ligaments_mat'/>
<int32_t name='ligaments_matidx'/>
<static-array name='ligaments_str' count='3'>
<stl-string/>
</static-array>
<int32_t name='ligaments_heal'/>
<int16_t name='blood_state'/>
<int16_t name='blood_mat'/>
<int32_t name='blood_matidx'/>
<static-array name='blood_str' count='3'>
<stl-string/>
</static-array>
<int16_t name='pus_state'/>
<int16_t name='pus_mat'/>
<int32_t name='pus_matidx'/>
<static-array name='pus_str' count='3'>
<stl-string/>
</static-array>
<stl-vector type-name='int16_t' name='material_breath_attack_mattype'/>
<stl-vector type-name='int32_t' name='material_breath_attack_matindex'/>
<static-array name='material_breath_attack_str' count='3'>
<stl-vector>
<pointer type-name='stl-string'/>
</stl-vector>
</static-array>
<stl-vector type-name='int16_t' name='material_breath_attack_type'/>
<stl-vector type-name='int16_t' name='egg_material_mattype'/>
<stl-vector type-name='int32_t' name='egg_material_matindex'/>
<static-array name='egg_material_str' count='3'>
<stl-vector>
<pointer type-name='stl-string'/>
</stl-vector>
</static-array>
<stl-vector name='lays_unusual_eggs_itemtype'>
<enum base-type='int16_t' type-name='item_type'/>
</stl-vector>
<stl-vector name='lays_unusual_eggs_itemsubtype'/>
<stl-vector type-name='int16_t' name='lays_unusual_eggs_mattype'/>
<stl-vector type-name='int32_t' name='lays_unusual_eggs_matindex'/>
<static-array name='lays_unusual_eggs_str' count='5'>
<stl-vector>
<pointer type-name='stl-string'/>
</stl-vector>
</static-array>
</compound>
<stl-vector name='unk22'/>
<stl-vector name='creature_class'>
<pointer type-name='stl-string'/>
</stl-vector>
<compound name='unknown2'>
<stl-vector name='unk23a'/>
<stl-vector name='unk23b'/>
<stl-vector name='unk23c'/>
<df-flagarray name='unk24_flags'/>
<df-flagarray name='unk25_flags'/>
<static-array type-name='int32_t' name='unk26' count='33'/>
<static-array name='unk27' count='5'><stl-vector/></static-array>
<static-array type-name='int32_t' name='unk28' count='2'/>
</compound>
<static-array type-name='int32_t' name='habit_num' count='2'/>
<static-array name='habit' count='2'><stl-vector/></static-array>
<static-array name='lair' count='2'><stl-vector/></static-array>
<static-array name='lair_characteristic' count='2'><stl-vector/></static-array>
<static-array name='lair_hunter_speech' count='2'><stl-vector/></static-array>
<static-array name='unk29' count='2'><stl-vector/></static-array>
<static-array name='specific_food' count='2'><stl-vector/></static-array>
<static-array name='unk30' count='3'><stl-vector/></static-array>
</struct-type>
<struct-type type-name='creature_raw' key-field='creature_id'>
<stl-string name='creature_id'/>
<code-helper name='find-instance'>$global.world.raws.creatures.all[$]</code-helper>
<static-array type-name='stl-string' name='name' count='3'/>
<static-array type-name='stl-string' name='general_baby_name' count='2'/>
<static-array type-name='stl-string' name='general_child_name' count='2'/>
<uint8_t name='creature_tile'/>
<uint8_t name='creature_soldier_tile'/>
<uint8_t name='alttile'/>
<uint8_t name='soldier_alttile'/>
<uint8_t name='glowtile'/>
<int16_t name='unk1'/>
<int16_t name='unk2'/>
<int16_t name='frequency'/>
<static-array type-name='int16_t' name='population_number' count='2'/>
<static-array type-name='int16_t' name='cluster_number' count='2'/>
<static-array type-name='int16_t' name='triggerable_group' count='2'/>
<static-array type-name='int16_t' name='color' count='3'/>
<static-array type-name='int16_t' name='glowcolor' count='3'/>
<int32_t name='adultsize'/>
<stl-vector name='prefstring'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector type-name='int16_t' name='sphere'/>
<stl-vector name='caste'>
<pointer type-name='caste_raw'/>
</stl-vector>
<stl-vector type-name='int32_t' name='pop_ratio'/>
<df-flagarray name='flags' index-enum='creature_raw_flags'/>
<compound name='stuff'>
<static-array name='stuff1' count='2'>
<static-array type-name='int32_t' count='7'/>
</static-array>
<static-array name='stuff2a' count='7'>
<static-array type-name='int32_t' count='12'/>
</static-array>
<static-array name='stuff2b' count='7'>
<static-array type-name='int32_t' count='12'/>
</static-array>
<static-array type-name='int32_t' name='unk3' count='84'/>
<static-array name='stuff3a' count='7'>
<static-array type-name='int32_t' count='106'/>
</static-array>
<static-array name='stuff3b' count='7'>
<static-array type-name='int32_t' count='106'/>
</static-array>
<static-array type-name='int8_t' name='stuff4' count='7'/>
<static-array name='stuff2c' count='7'>
<static-array type-name='int8_t' count='12'/>
</static-array>
<static-array type-name='int8_t' name='unk4' count='42'/>
<static-array name='stuff3c' count='7'>
<static-array type-name='int8_t' count='106'/>
</static-array>
</compound>
<stl-vector name='unk5'/>
<stl-vector name='speech1'/>
<stl-vector name='speech2'/>
<stl-vector name='speech3'/>
<stl-vector name='material'>
<pointer type-name='material'/>
</stl-vector>
<stl-vector type-name='pointer' name='tissue'/>
<static-array name='profession_name' count='106'>
<stl-string name='singular'/>
<stl-string name='plural'/>
</static-array>
<pointer name='unk6pa'/>
<pointer name='unk6pb'/>
<stl-vector type-name='int32_t' name='unk6'/>
<stl-vector type-name='int32_t' name='unk7'/>
<stl-vector type-name='int32_t' name='hive_product_0'/>
<stl-vector type-name='int32_t' name='hive_product_1'/>
<stl-vector type-name='int16_t' name='hive_product_2'/>
<stl-vector type-name='int16_t' name='hive_product_3'/>
<stl-vector type-name='int16_t' name='hive_product_4'/>
<stl-vector type-name='int32_t' name='hive_product_5'/>
<static-array name='hive_product_tmpstr' count='5'>
<stl-vector>
<pointer type-name='stl-string'/>
</stl-vector>
</static-array>
<int32_t name='unk8'/>
<stl-vector name='raws'>
<pointer type-name='stl-string'/>
</stl-vector>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,129 @@
<data-definition>
<enum-type type-name='d_init_nickname'>
<enum-item name='REPLACE_FIRST'/>
<enum-item name='CENTRALIZE'/>
<enum-item name='REPLACE_ALL'/>
</enum-type>
<enum-type type-name='d_init_z_view'>
<enum-item name='OFF'/>
<enum-item name='UNHIDDEN'/>
<enum-item name='CREATURE'/>
<enum-item name='ON'/>
</enum-type>
<enum-type type-name='d_init_idlers'>
<enum-item name='OFF' value='-1'/>
<enum-item name='TOP'/>
<enum-item name='BOTTOM'/>
</enum-type>
<enum-type type-name='d_init_tunnel'>
<enum-item name='NO'/>
<enum-item name='FINDER'/>
<enum-item name='ALWAYS'/>
</enum-type>
<enum-type type-name='d_init_flags1'>
<enum-item name='VARIED_GROUND_TILES'/>
<enum-item name='ENGRAVINGS_START_OBSCURED'/>
<enum-item name='SHOW_IMP_QUALITY'/>
<enum-item name='SHOW_FLOW_AMOUNTS'/>
</enum-type>
<enum-type type-name='d_init_flags2'>
<enum-item name='MORE'/>
<enum-item name='ADVENTURER_TRAPS'/>
<enum-item name='ADVENTURER_ALWAYS_CENTER'/>
</enum-type>
<enum-type type-name='d_init_flags3'>
<enum-item name='COFFIN_NO_PETS_DEFAULT'/>
</enum-type>
<enum-type type-name='d_init_flags4'>
<enum-item name='TEMPERATURE'/>
<enum-item name='WEATHER'/>
<enum-item name='ECONOMY'/>
<enum-item name='ZERO_RENT'/>
<enum-item name='AUTOSAVE_SEASONAL'/>
<enum-item name='AUTOSAVE_YEARLY'/>
<enum-item name='AUTOSAVE_PAUSE'/>
<enum-item name='AUTOBACKUP'/>
<enum-item name='INITIAL_SAVE'/>
<enum-item name='INVADERS'/>
<enum-item name='CAVEINS'/>
<enum-item name='ARTIFACTS'/>
<enum-item name='LOG_MAP_REJECTS'/>
<enum-item name='PAUSE_ON_LOAD'/>
<enum-item name='EMBARK_WARNING_ALWAYS'/>
<enum-item name='SHOW_ALL_HISTORY_IN_DWARF_MODE'/>
<enum-item name='TESTING_ARENA'/>
<enum-item name='WALKING_SPREADS_SPATTER_DWF'/>
<enum-item name='WALKING_SPREADS_SPATTER_ADV'/>
</enum-type>
<struct-type type-name='d_init'>
<df-flagarray name='flags1' index-enum='d_init_flags1'/>
<enum name="nickname_dwarf" type-name='d_init_nickname'/>
<enum name="nickname_adventure" type-name='d_init_nickname'/>
<enum name="nickname_legends" type-name='d_init_nickname'/>
<enum name="nickname_dwarf2" type-name='d_init_nickname'/>
<int32_t name="unk_18"/>
<int32_t name="unk_1c"/>
<uint8_t name='sky_tile'/>
<static-array name='sky_color' type-name='int16_t' count='3'/>
<uint8_t name='chasm_tile'/>
<uint8_t name='pillar_tile'/>
<static-array name='chasm_color' type-name='int16_t' count='3'/>
<compound name='wound_color'>
<static-array name='none' type-name='int16_t' count='3'/>
<static-array name='minor' type-name='int16_t' count='3'/>
<static-array name='inhibited' type-name='int16_t' count='3'/>
<static-array name='function_loss' type-name='int16_t' count='3'/>
<static-array name='broken' type-name='int16_t' count='3'/>
<static-array name='missing' type-name='int16_t' count='3'/>
</compound>
<enum name="idlers" base-type='int16_t' type-name='d_init_idlers'/>
<enum name="show_embark_tunnel" base-type='int16_t' type-name='d_init_tunnel'/>
<df-flagarray name='flags2' index-enum='d_init_flags2'/>
<int32_t name="display_length"/>
<enum name="adventurer_z_view" type-name='d_init_z_view'/>
<int32_t name="adventurer_z_view_size"/>
<df-flagarray name='flags3' index-enum='d_init_flags3'/>
<int32_t name="population_cap"/>
<int32_t name="baby_cap_absolute"/>
<int32_t name="baby_cap_percent"/>
<static-array name='path_cost' type-name='int32_t' count='4'/>
<static-array name='embark_rect' type-name='int16_t' count='2'/>
<compound name='store_dist'>
<int16_t name='item_decrease'/>
<int16_t name='seed_combine'/>
<int16_t name='bucket_combine'/>
<int16_t name='barrel_combine'/>
<int16_t name='bin_combine'/>
</compound>
<df-flagarray name='flags4' index-enum='d_init_flags4'/>
85266c0
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,120 @@
<data-definition>
<struct-type type-name='historical_figure' key-field='id'>
<enum base-type='int16_t' name='profession' type-name='profession'/>
<int16_t name='race' ref-target='creature_raw'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int8_t name='sex'/>
<int32_t name='appeared_year'/>
<int32_t name='born_year'/>
<int32_t name='born_seconds'/>
<int32_t name='old_year'/>
<int32_t name='old_seconds'/>
<int32_t name='died_year'/>
<int32_t name='died_seconds'/>
<compound type-name='language_name' name='name'/>
<code-helper name='find-instance'>(find-by-id $global.world.history.figures $id $)</code-helper>
<code-helper name='describe'>
(describe-obj $.name)
(awhen (find-creature $.race)
(fmt "~:(~A ~A~)" $it.caste[$.caste].caste_id $it.creature_id))
</code-helper>
<int32_t name='civ_id' ref-target='historical_entity'/>
<int32_t name='population_id' ref-target='entity_population'/>
<df-flagarray name='flags'/>
<int32_t name='unit_id' ref-target='unit'/>
<int32_t name='id'/>
<int32_t name='unk4'/>
<stl-vector name='entity_links'/>
<stl-vector name='site_links'/>
<stl-vector name='histfig_links'/>
<pointer name='unk6'/>
<static-array name='unk7' count='5' type-name='int32_t' comment='empty'/>
</struct-type>
<class-type type-name='history_event_masterpiece_createdst' inherits-from='history_event'>
<int32_t name='maker' ref-target='historical_figure'/>
<int32_t name='maker_entity' ref-target='historical_entity'/>
<int32_t name='site' ref-target='world_site'/>
</class-type>
<class-type type-name='history_event_masterpiece_created_itemst'
inherits-from='history_event_masterpiece_createdst'>
<enum base-type='int32_t' name='skill_used' type-name='job_skill'/>
<enum base-type='int16_t' name='item_type' type-name='item_type'/>
<int16_t name='item_subtype' refers-to='(item-subtype-target $$._parent.item_type $)'/>
<int16_t name='mat_type' ref-target='material' aux-value='$$.mat_index'/>
<int16_t name='mat_index'/>
<int32_t name='item_id' ref-target='item'/>
</class-type>
<class-type type-name='history_event_masterpiece_created_foodst'
inherits-from='history_event_masterpiece_createdst'>
<int32_t name='unk1'/>
<int16_t name='item_subtype' refers-to='$global.world.raws.itemdefs.food[$]'/>
<int32_t name='item_id' ref-target='item'/>
</class-type>
<struct-type type-name='world_history'>
dtor 8532fa0
<stl-vector name='events'>
<pointer type-name='history_event'/>
</stl-vector>
<stl-vector name='events2'>
<pointer type-name='history_event'/>
</stl-vector>
<stl-vector name='figures'>
<pointer type-name='historical_figure'/>
</stl-vector>
<static-array name='other_events' count='9'>
<stl-vector>
<pointer type-name='history_event'/>
</stl-vector>
</static-array>
<stl-vector name='ages'>
<pointer/>
</stl-vector>
<stl-vector name='unk1' type-name='int32_t'/>
<stl-vector name='unk2' type-name='int16_t'/>
<int32_t/>
<int32_t/>
<int32_t/>
<int32_t/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<bool/>
<stl-vector/>
<int32_t/>
<int32_t/>
<int32_t/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,138 @@
<data-definition>
-- init.h
<enum-type type-name='init_display_flags'>
<enum-item name='USE_GRAPHICS'/>
<enum-item name='BLACK_SPACE'/>
<enum-item name='PARTIAL_PRINT'/>
<enum-item name='FRAME_BUFFER'/>
<enum-item name='SINGLE_BUFFER'/>
<enum-item name='ACCUM_BUFFER'/>
<enum-item name='VBO'/>
<enum-item name='RENDER_2D'/>
<enum-item name='RENDER_2DHW'/>
<enum-item name='RENDER_2DASYNC'/>
<enum-item name='UNUSED_01_08'/>
<enum-item name='TEXT'/>
<enum-item name='SHADER'/>
<enum-item name='NOT_RESIZABLE'/>
<enum-item name='ARB_SYNC'/>
</enum-type>
<struct-type type-name='init_display'>
<df-flagarray name='flag' index-enum='init_display_flags'/>
<enum name='windowed'>
<enum-item name='True'/>
<enum-item name='False'/>
<enum-item name='Prompt'/>
</enum>
<int32_t name='grid_x'/>
<int32_t name='grid_y'/>
<int32_t name='desired_fullscreen_width'/>
<int32_t name='desired_fullscreen_height'/>
<int32_t name='desired_windowed_width'/>
<int32_t name='desired_windowed_height'/>
<int8_t name='partial_print_count'/>
</struct-type>
<enum-type type-name='init_media_flags'>
<enum-item name='SOUND_OFF'/>
<enum-item name='INTRO_OFF'/>
<enum-item name='COMPRESS_SAVES'/>
</enum-type>
<struct-type type-name='init_media'>
<df-flagarray name='flag' index-enum='init_media_flags'/>
<int32_t name='volume'/>
</struct-type>
<enum-type type-name='init_input_flags'>
<enum-item name='MOUSE_OFF'/>
<enum-item name='MOUSE_PICTURE'/>
</enum-type>
<struct-type type-name='init_input'>
<int32_t name='hold_time'/>
<int32_t name='repeat_time'/>
<int32_t name='macro_time'/>
<int32_t name='pause_zoom_no_interface_ms'/>
<df-flagarray name='flag' index-enum='init_input_flags'/>
<int32_t name='zoom_speed'/>
<int32_t name='repeat_accel_start'/>
<int32_t name='repeat_accel_limit'/>
</struct-type>
<struct-type type-name='init_font'>
<static-array name='small_font_texpos' type-name='int32_t' count='256'/>
<static-array name='large_font_texpos' type-name='int32_t' count='256'/>
<static-array name='small_font_datapos' type-name='int32_t' count='256'/>
<static-array name='large_font_datapos' type-name='int32_t' count='256'/>
<s-float name='small_font_adjx'/>
<s-float name='small_font_adjy'/>
<s-float name='large_font_adjx'/>
<s-float name='large_font_adjy'/>
<int32_t name='small_font_dispx'/>
<int32_t name='small_font_dispy'/>
<int32_t name='large_font_dispx'/>
<int32_t name='large_font_dispy'/>
<bool name='use_ttf'/>
</struct-type>
<enum-type type-name='init_window_flags'>
<enum-item name='TOPMOST'/>
<enum-item name='VSYNC_ON'/>
<enum-item name='VSYNC_OFF'/>
<enum-item name='TEXTURE_LINEAR'/>
</enum-type>
<struct-type type-name='init_window'>
<df-flagarray name='flag' index-enum='init_window_flags'/>
</struct-type>
<struct-type type-name='init'>
<compound name='display' type-name='init_display'/>
<compound name='media' type-name='init_media'/>
<compound name='input' type-name='init_input'/>
<compound name='font' type-name='init_font'/>
<compound name='window' type-name='init_window'/>
</struct-type>
-- texture_handler.h
<struct-type type-name='tile_page'>
<stl-string name='token'/>
<stl-string name='filename'/>
<int16_t name='tile_dim_x'/>
<int16_t name='tile_dim_y'/>
<int16_t name='page_dim_x'/>
<int16_t name='page_dim_y'/>
<stl-vector name='texpos' type-name='int32_t'/>
<stl-vector name='datapos' type-name='int32_t'/>
<stl-vector name='texpos_gs' type-name='int32_t'/>
<stl-vector name='datapos_gs' type-name='int32_t'/>
<bool name='loaded'/>
</struct-type>
<struct-type type-name='texture_handler'>
<stl-vector name='page'>
<pointer type-name='tile_page'/>
</stl-vector>
<stl-vector name='texpos' type-name='int32_t'/>
<stl-vector name='datapos' type-name='int32_t'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,303 @@
<data-definition>
<enum-type type-name='item_type'>
<enum-item name='BAR' comment='Bars, such as metal, fuel, or soap.'/>
<enum-item name='SMALLGEM' comment='Cut gemstones usable in jewelers workshop'/>
<enum-item name='BLOCKS' comment='Blocks of any kind.'/>
<enum-item name='ROUGH' comment='Rough gemstones.'/>
<enum-item name='BOULDER' comment='Raw mined stone.'/>
<enum-item name='WOOD' comment='Wooden logs.'/>
<enum-item name='DOOR' comment='Doors.'/>
<enum-item name='FLOODGATE' comment='Floodgates.'/>
<enum-item name='BED' comment='Beds.'/>
<enum-item name='CHAIR' comment='Chairs and thrones.'/>
<enum-item name='CHAIN' comment='Restraints.'/>
<enum-item name='FLASK' comment='Flasks.'/>
<enum-item name='GOBLET' comment='Goblets.'/>
<enum-item name='INSTRUMENT' comment='Musical instruments.'/>
<enum-item name='TOY' comment='Toys.'/>
<enum-item name='WINDOW' comment='Glass windows.'/>
<enum-item name='CAGE' comment='Cages.'/>
<enum-item name='BARREL' comment='Barrels.'/>
<enum-item name='BUCKET' comment='Buckets.'/>
<enum-item name='ANIMALTRAP' comment='Animal traps.'/>
<enum-item name='TABLE' comment='Tables.'/>
<enum-item name='COFFIN' comment='Coffins.'/>
<enum-item name='STATUE' comment='Statues.'/>
<enum-item name='CORPSE' comment='Corpses. Does not have a material.'/>
<enum-item name='WEAPON' comment='Weapons.'/>
<enum-item name='ARMOR' comment='Armor and clothing worn on the upper body.'/>
<enum-item name='SHOES' comment='Armor and clothing worn on the feet.'/>
<enum-item name='SHIELD' comment='Shields and bucklers.'/>
<enum-item name='HELM' comment='Armor and clothing worn on the head.'/>
<enum-item name='GLOVES' comment='Armor and clothing worn on the hands.'/>
<enum-item name='BOX' comment='Chests (wood), coffers (stone), boxes (glass), and bags (cloth or leather).'/>
<enum-item name='BIN' comment='Bins.'/>
<enum-item name='ARMORSTAND' comment='Armor stands.'/>
<enum-item name='WEAPONRACK' comment='Weapon racks.'/>
<enum-item name='CABINET' comment='Cabinets.'/>
<enum-item name='FIGURINE' comment='Figurines.'/>
<enum-item name='AMULET' comment='Amulets.'/>
<enum-item name='SCEPTER' comment='Scepters.'/>
<enum-item name='AMMO' comment='Ammunition for hand-held weapons.'/>
<enum-item name='CROWN' comment='Crowns.'/>
<enum-item name='RING' comment='Rings.'/>
<enum-item name='EARRING' comment='Earrings.'/>
<enum-item name='BRACELET' comment='Bracelets.'/>
<enum-item name='GEM' comment='Large gems.'/>
<enum-item name='ANVIL' comment='Anvils.'/>
<enum-item name='CORPSEPIECE' comment='Body parts. Does not have a material.'/>
<enum-item name='REMAINS' comment='Dead vermin bodies. Material is CREATURE_ID:CASTE.'/>
<enum-item name='MEAT' comment='Butchered meat.'/>
<enum-item name='FISH' comment='Prepared fish. Material is CREATURE_ID:CASTE.'/>
<enum-item name='FISH_RAW' comment='Unprepared fish. Material is CREATURE_ID:CASTE.'/>
<enum-item name='VERMIN' comment='Live vermin. Material is CREATURE_ID:CASTE.'/>
<enum-item name='PET' comment='Tame vermin. Material is CREATURE_ID:CASTE.'/>
<enum-item name='SEEDS' comment='Seeds from plants.'/>
<enum-item name='PLANT' comment='Plants.'/>
<enum-item name='SKIN_TANNED' comment='Tanned skins.'/>
<enum-item name='LEAVES' comment='Leaves, usually from quarry bushes.'/>
<enum-item name='THREAD' comment='Thread gathered from webs or made at the farmers workshop.'/>
<enum-item name='CLOTH' comment='Cloth made at the loom.'/>
<enum-item name='TOTEM' comment='Skull totems.'/>
<enum-item name='PANTS' comment='Armor and clothing worn on the legs.'/>
<enum-item name='BACKPACK' comment='Backpacks.'/>
<enum-item name='QUIVER' comment='Quivers.'/>
<enum-item name='CATAPULTPARTS' comment='Catapult parts.'/>
<enum-item name='BALLISTAPARTS' comment='Ballista parts.'/>
<enum-item name='SIEGEAMMO' comment='Siege engine ammunition.'/>
<enum-item name='BALLISTAARROWHEAD' comment='Ballista arrow heads.'/>
<enum-item name='TRAPPARTS' comment='Mechanisms.'/>
<enum-item name='TRAPCOMP' comment='Trap components.'/>
<enum-item name='DRINK' comment='Alcoholic drinks.'/>
<enum-item name='POWDER_MISC' comment='Powders such as flour, gypsum plaster, dye, or sand.'/>
<enum-item name='CHEESE' comment='Pieces of cheese.'/>
<enum-item name='FOOD' comment='Prepared meals. Subtypes come from item_food.txt'/>
<enum-item name='LIQUID_MISC' comment='Liquids such as water, lye, and extracts.'/>
<enum-item name='COIN' comment='Coins.'/>
<enum-item name='GLOB' comment='Fat, tallow, pastes/pressed objects, and small bits of molten rock/metal.'/>
<enum-item name='ROCK' comment='Small rocks (usually sharpened and/or thrown in adventurer mode)'/>
<enum-item name='PIPE_SECTION' comment='Pipe sections.'/>
<enum-item name='HATCH_COVER' comment='Hatch covers.'/>
<enum-item name='GRATE' comment='Grates.'/>
<enum-item name='QUERN' comment='Querns.'/>
<enum-item name='MILLSTONE' comment='Millstones.'/>
<enum-item name='SPLINT' comment='Splints.'/>
<enum-item name='CRUTCH' comment='Crutches.'/>
<enum-item name='TRACTION_BENCH' comment='Traction benches.'/>
<enum-item name='ORTHOPEDIC_CAST' comment='Casts'/>
<enum-item name='TOOL' comment='Tools.'/>
<enum-item name='SLAB' comment='Slabs.'/>
<enum-item name='EGGS' comment='Eggs. Material is CREATURE_ID:CASTE.'/>
</enum-type>
<class-type type-name='itemdef' original-name='itemdefst' key-field='id'>
<stl-string name="id"/>
<int16_t name="subtype"/>
</class-type>
<class-type type-name='itemdef_ammost' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-string name="ammo_class"/>
<df-flagarray name='flags'/>
<int32_t name="size" comment='divided by 10'/>
<int32_t name="unk_84"/>
<stl-vector name="attacks">
<pointer/>
</stl-vector>
</class-type>
<struct-type type-name='armor_properties'>
<df-flagarray name='flags'/>
<int32_t name="layer"/>
<int16_t name="layer_size"/>
<int16_t name="layer_permit"/>
<int16_t name="coverage"/>
</struct-type>
<class-type type-name='itemdef_armorst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-string name="name_preplural"/>
<stl-string name="material_placeholder"/>
<int32_t name="value"/>
<int8_t name="armorlevel"/>
<int16_t name="ubstep"/>
<int16_t name="lbstep"/>
<int32_t name="material_size"/>
<compound name='props' type-name='armor_properties'/>
<df-flagarray name='flags'/>
</class-type>
<class-type type-name='itemdef_foodst' inherits-from='itemdef'>
<stl-string name="name"/>
<int16_t name="level"/>
</class-type>
<class-type type-name='itemdef_glovesst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<int32_t name="value"/>
<int8_t name='armorlevel'/>
<int16_t name="ubstep"/>
<df-flagarray name='flags'/>
<int32_t name="material_size"/>
<compound name='props' type-name='armor_properties'/>
</class-type>
<class-type type-name='itemdef_helmst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<int32_t name="value"/>
<int8_t name='armorlevel'/>
<df-flagarray name='flags'/>
<int32_t name="material_size"/>
<compound name='props' type-name='armor_properties'/>
</class-type>
<class-type type-name='itemdef_instrumentst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<df-flagarray name='flags'/>
</class-type>
<class-type type-name='itemdef_pantsst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-string name="name_preplural"/>
<stl-string name="material_placeholder"/>
<int32_t name="value"/>
<int8_t name="armorlevel"/>
<df-flagarray name='flags'/>
<int32_t name="material_size"/>
<int16_t name="lbstep"/>
<compound name='props' type-name='armor_properties'/>
</class-type>
<class-type type-name='itemdef_shieldst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<int32_t name="value"/>
<int32_t name="blockchance"/>
<int8_t name='armorlevel'/>
<int16_t name="ubstep"/>
<int32_t name="material_size"/>
</class-type>
<class-type type-name='itemdef_shoesst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<int32_t name="value"/>
<int8_t name='armorlevel'/>
<int16_t name="ubstep"/>
<df-flagarray name='flags'/>
<int32_t name="material_size"/>
<compound name='props' type-name='armor_properties'/>
</class-type>
<class-type type-name='itemdef_siegeammost' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-string name="ammo_class"/>
</class-type>
<enum-type type-name='tool_uses'>
<enum-item name='TOOL_USE_LIQUID_COOKING'/>
<enum-item name='TOOL_USE_LIQUID_SCOOP'/>
<enum-item name='TOOL_USE_GRIND_POWDER_RECEPTACLE'/>
<enum-item name='TOOL_USE_GRIND_POWDER_GRINDER'/>
<enum-item name='TOOL_USE_MEAT_CARVING'/>
<enum-item name='TOOL_USE_MEAT_BONING'/>
<enum-item name='TOOL_USE_MEAT_SLICING'/>
<enum-item name='TOOL_USE_MEAT_CLEAVING'/>
<enum-item name='TOOL_USE_HOLD_MEAT_FOR_CARVING'/>
<enum-item name='TOOL_USE_MEAL_CONTAINER'/>
<enum-item name='TOOL_USE_LIQUID_CONTAINER'/>
<enum-item name='TOOL_USE_FOOD_STORAGE'/>
<enum-item name='TOOL_USE_HIVE'/>
<enum-item name='TOOL_USE_NEST_BOX'/>
</enum-type>
<class-type type-name='itemdef_toolst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<df-flagarray name='flags'/>
<int32_t name="value"/>
<uint8_t name="tile"/>
<stl-vector name="tool_use">
<enum base-type='int16_t' type-name='tool_uses'/>
</stl-vector>
<stl-string name="adjective"/>
<int32_t name="size"/>
<int16_t name="skill_melee"/>
<int16_t name="skill_ranged"/>
<stl-string name="ranged_ammo"/>
<int32_t name="two_handed"/>
<int32_t name="minimum_size"/>
<int32_t name="material_size"/>
<stl-vector name="attacks"/>
<int32_t name="shoot_force"/>
<int32_t name="shoot_maxvel"/>
<int32_t name="container_capacity"/>
</class-type>
<class-type type-name='itemdef_toyst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<df-flagarray name='flags'/>
</class-type>
<class-type type-name='itemdef_trapcompst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-string name="adjective"/>
<int32_t name="size"/>
<int32_t name="unk_7c"/>
<int32_t name="hits"/>
<int32_t name="material_size"/>
<df-flagarray name='flags'/>
<stl-vector name="attacks">
<pointer/>
</stl-vector>
</class-type>
<class-type type-name='itemdef_weaponst' inherits-from='itemdef'>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-string name="adjective"/>
<int32_t name="size"/>
<int32_t name="unk_7c"/>
<int16_t name="skill_melee"/>
<int16_t name="skill_ranged"/>
<stl-string name="ranged_ammo"/>
<int32_t name="two_handed"/>
<int32_t name="minimum_size"/>
<int32_t name="material_size"/>
<df-flagarray name='flags'/>
<stl-vector name="attacks">
<pointer/>
</stl-vector>
<int32_t name="shoot_force"/>
<int32_t name="shoot_maxvel"/>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,578 @@
<data-definition>
-- MISC TYPES
<bitfield-type type-name='item_flags'>
<flag-bit name='on_ground' comment='Item on ground'/>
<flag-bit name='in_job' comment='Item currently being used in a job'/>
<flag-bit name='hostile' comment='Item owned by hostile'/>
<flag-bit name='in_inventory' comment='Item in a creature or workshop inventory'/>
<flag-bit name='unk1' comment='unknown, lost (artifact)?, unusable, unseen'/>
<flag-bit name='in_building' comment='Part of a building (including mechanisms, bodies in coffins)'/>
<flag-bit name='unk2' comment='unknown, unseen'/>
<flag-bit name='dead_dwarf' comment='Dwarfs dead body or body part'/>
<flag-bit name='rotten' comment='Rotten food'/>
<flag-bit name='spider_web' comment='Thread in spider web'/>
<flag-bit name='construction' comment='Material used in construction'/>
<flag-bit name='unk3' comment='unknown, unseen, unusable'/>
<flag-bit name='unk4' comment='unknown, unseen'/>
<flag-bit name='murder' comment='Implies murder - used in fell moods'/>
<flag-bit name='foreign' comment='Item is imported'/>
<flag-bit name='trader' comment='Item ownwed by trader'/>
<flag-bit name='owned' comment='Item is owned by a dwarf'/>
<flag-bit name='garbage_colect' comment='Marked for deallocation by DF it seems'/>
<flag-bit name='artifact1' comment='Artifact ?'/>
<flag-bit name='forbid' comment='Forbidden item'/>
<flag-bit name='unk6' comment='unknown, unseen'/>
<flag-bit name='dump' comment='Designated for dumping'/>
<flag-bit name='on_fire' comment='Indicates if item is on fire, Will Set Item On Fire if Set!'/>
<flag-bit name='melt' comment='Designated for melting, if applicable'/>
<flag-bit name='hidden' comment='Hidden item'/>
<flag-bit name='in_chest' comment='Stored in chest/part of well?'/>
<flag-bit name='unk7' comment='unknown, unseen'/>
<flag-bit name='artifact2' comment='Artifact ?'/>
<flag-bit name='unk8' comment='unknown, unseen, common'/>
<flag-bit name='weight_computed'/>
<flag-bit name='unk10' comment='unknown, unseen'/>
<flag-bit name='unk11' comment='unknown, unseen'/>
</bitfield-type>
<struct-type type-name='contaminant'>
<int16_t name='mat_type' ref-target='material' aux-value='$$.mat_index'/>
<int32_t name='mat_index'/>
<int16_t name='mat_state' comment='enum or document in text'/>
<uint16_t name='temperature'/>
<uint16_t name='temperature_fraction'/>
<int32_t name='size' comment='1-24=spatter, 25-49=smear, 50-* = coating'/>
<int16_t name='unk' comment='-1'/>
<int16_t name='id'/>
</struct-type>
<enum-type type-name='item_quality'>
<enum-item name='Ordinary'/>
<enum-item name='WellCrafted'/>
<enum-item name='FinelyCrafted'/>
<enum-item name='Superior'/>
<enum-item name='Exceptional'/>
<enum-item name='Masterful'/>
<enum-item name='Artifact'/>
</enum-type>
-- CORE ITEM
<class-type type-name='item' original-name='itemst' key-field='id'>
<code-helper name='find-instance'>(find-by-id $global.world.items.all $id $)</code-helper>
<int16_t name='x'/>
<int16_t name='y'/>
<int16_t name='z'/>
<compound name='flags' type-name='item_flags'/>
<uint32_t name='age'/>
<uint32_t name='id'/>
<stl-vector name='jobs'>
<pointer>
<int32_t name='unk1'/>
<pointer name='job' type-name='job'/>
<int32_t name='unk2'/>
</pointer>
</stl-vector>
<stl-vector name='itemrefs'>
<pointer type-name='general_ref'/>
</stl-vector>
<compound name='temp'>
<int16_t name='unk1'/>
<int16_t name='unk2'/>
<int16_t name='unk3'/>
<int16_t name='unk4'/>
<int16_t name='unk5'/>
<int16_t name='spec_heat'/>
<int16_t name='ignite_point'/>
<int16_t name='heatdam_point'/>
<int16_t name='colddam_point'/>
<int16_t name='boiling_point'/>
<int16_t name='melting_point'/>
<int16_t name='fixed_temp'/>
</compound>
<int32_t name='weight' comment='if flags.weight_computed'/>
<int32_t name='weight_fraction' comment='1e-6'/>
</class-type>
-- ACTUAL ITEM
<struct-type type-name='item_kill_info'>
-- Important
<stl-vector name="events">
<int32_t ref-target='history_event'/>
</stl-vector>
-- Misc
<stl-vector name="killed_race">
<int16_t ref-target='creature_raw'/>
</stl-vector>
<stl-vector name="killed_caste">
<int16_t ref-target='caste_raw' aux-value='$$._parent.killed_race[$._key]'/>
</stl-vector>
<stl-vector name="unk_30">
<int32_t comment='-1'/>
</stl-vector>
<stl-vector name="unk_40">
<int32_t comment='-1'/>
</stl-vector>
<stl-vector name="killed_site">
<int32_t ref-target='world_site'/>
</stl-vector>
<stl-vector name="killed_undead">
<bitfield base-type='uint16_t'>
<flag-bit name='skeletal'/>
<flag-bit name='zombie'/>
<flag-bit name='ghostly'/>
</bitfield>
</stl-vector>
<stl-vector name="killed_count" type-name='int32_t'/>
-- Wielders
<stl-vector name="slayers">
<int32_t ref-target='historical_figure'/>
</stl-vector>
<stl-vector name="slayer_kill_counts" type-name='int32_t'/>
</struct-type>
<class-type type-name='item_actual' inherits-from='item' original-name='item_actualst'>
<int32_t name='stack_size'/>
<code-helper name='describe'>
(if (> $.stack_size 1) (fmt "stack: ~A" $.stack_size))
(if (> $.wear 0) (fmt "wear: ~A" $.wear))
</code-helper>
<pointer name='history_info'>
<pointer>
<pointer name='kills' type-name='item_kill_info'/>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
</pointer>
</pointer>
<pointer name='unk5'>
<stl-vector/>
</pointer>
<pointer name='contaminants'>
<stl-vector>
<pointer type-name='contaminant'/>
</stl-vector>
</pointer>
<uint16_t name='temperature'/>
<uint16_t name='temperature_fraction'/>
<int16_t name='wear'/>
<int32_t name='wear_timer' comment='counts up to 806400'/>
<int32_t name='unk3' comment='-1'/>
</class-type>
-- CRAFTED ITEM
<class-type type-name='item_crafted' inherits-from='item_actual'
original-name='item_craftedst'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<code-helper name='describe'>
$.quality
(describe-obj (material-by-id $.matType $.matIndex))
</code-helper>
<int16_t name='maker_race' ref-target='creature_raw'/>
<enum base-type='int16_t' name='quality' type-name='item_quality'/>
<enum base-type='int32_t' name='skill_used' type-name='job_skill'/>
<int32_t name='maker' ref-target='historical_figure'/>
<int32_t name='masterpiece_event' ref-target='history_event'/>
</class-type>
-- CONSTRUCTED ITEM
<class-type type-name='item_constructed' inherits-from='item_crafted'
original-name='item_constructedst'>
<stl-vector name='improvements'>
<pointer/>
</stl-vector>
</class-type>
-- BODY COMPONENT
<class-type type-name='item_body_component' inherits-from='item_actual'
original-name='item_body_componentst'>
<int16_t name='race' ref-target='creature_raw'/>
<int32_t name='unk_7c'/>
<int32_t name='unk_80'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int8_t name='unk_86'/>
<int32_t name='unk_88'/>
<int8_t name='unk_8c'/>
<stl-vector name='unk_90'/>
<padding size='44'/>
<stl-vector name='unk_cc'/>
<stl-vector name='unk_dc'/>
<stl-vector name='unk_ec'/>
<stl-vector name='unk_fc'/>
<stl-vector name='unk_10c'/>
<stl-vector name='unk_11c'/>
<stl-vector name='unk_12c'/>
<stl-vector name='unk_13c'/>
<padding size='72'/>
<stl-vector name='unk_194'/>
<stl-vector name='unk_1a4'/>
<stl-vector name='unk_1b4'/>
<padding size='20'/>
<stl-vector name='unk_1d8'/>
<stl-vector name='unk_1e8'/>
<stl-vector name='unk_1f8'/>
<stl-vector name='unk_208'/>
<stl-vector name='unk_218'/>
<padding size='12'/>
<static-array name='unk_234' count='19' type-name='int32_t'/>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int16_t name='unk_288'/>
<int32_t name='unk_28c'/>
</class-type>
<class-type type-name='item_corpsest' inherits-from='item_body_component'/>
<class-type type-name='item_corpsepiecest' inherits-from='item_body_component'/>
-- CRITTER
<class-type type-name='item_critter' inherits-from='item_actual' original-name='item_critterst'>
<int16_t name='race' ref-target='creature_raw'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int32_t name='unk_7c'/>
<int32_t name='unk_80'/>
</class-type>
-- LIQUID/POWER
<bitfield-type type-name='item_matstate'>
<flag-bit/>
<flag-bit name='pressed'/>
<flag-bit name='paste'/>
</bitfield-type>
<class-type type-name='item_liquidpowder' inherits-from='item_actual'
original-name='item_liquidpowderst'>
<compound name='mat_state' type-name='item_matstate'/>
<int32_t name='dimension'/>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
<class-type type-name='item_liquid' inherits-from='item_liquidpowder' original-name='item_liquidst'/>
<class-type type-name='item_powder' inherits-from='item_liquidpowder' original-name='item_powderst'/>
-- MISC
<class-type type-name='item_barst' inherits-from='item_actual'>
<int16_t name='subtype'/>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='dimension'/>
</class-type>
<class-type type-name='item_smallgemst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
<class-type type-name='item_blocksst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
<class-type type-name='item_roughst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
<class-type type-name='item_boulderst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
<class-type type-name='item_woodst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
<class-type type-name='item_rockst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='sharpness'/>
<int32_t name='unk_84'/>
</class-type>
<class-type type-name='item_seedsst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='unk_80'/>
<int32_t name='unk_84'/>
</class-type>
<class-type type-name='item_skin_tannedst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='unk_80'/>
</class-type>
<class-type type-name='item_meatst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_plantst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_leavesst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_cheesest' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_globst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int32_t name='rot_timer'/>
<compound name='mat_state' type-name='item_matstate'/>
</class-type>
<class-type type-name='item_remainsst' inherits-from='item_actual'>
<int16_t name='race' ref-target='creature_raw'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_fishst' inherits-from='item_actual'>
<int16_t name='race' ref-target='creature_raw'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_fish_rawst' inherits-from='item_actual'>
<int16_t name='race' ref-target='creature_raw'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_foodst' inherits-from='item_crafted'>
<pointer name='subtype' type-name='itemdef_foodst'/>
<int32_t name='unk_94'/>
<int16_t name='unk_98'/>
<stl-vector name='unk_9c'/>
<int32_t name='rot_timer'/>
</class-type>
<class-type type-name='item_verminst' inherits-from='item_critter'/>
<class-type type-name='item_petst' inherits-from='item_critter'/>
<class-type type-name='item_drinkst' inherits-from='item_liquid'/>
<class-type type-name='item_powder_miscst' inherits-from='item_powder'/>
<class-type type-name='item_liquid_miscst' inherits-from='item_liquid'>
<int32_t name='unk_88'/>
</class-type>
<class-type type-name='item_threadst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int16_t name='dyeColor'/>
<int32_t name='unk_84'/>
<int32_t name='unk_88'/>
<int32_t name='unk_8c'/>
<int16_t name='unk_90'/>
<int16_t name='unk_92'/>
<int32_t name='unk_94'/>
<int8_t name='unk_98'/>
<int32_t name='dimension'/>
</class-type>
<class-type type-name='item_eggst' inherits-from='item_actual'>
<int16_t name='race' ref-target='creature_raw'/>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int32_t name='unk_7c'/>
<stl-vector name='eggMatType' type-name='int16_t'/>
<stl-vector name='eggMatIndex' type-name='int32_t'/>
<padding size='44'/>
<compound name='unk_cc'>
<int16_t/>
<int16_t/>
<int16_t/>
<int32_t/>
<int32_t/>
<int32_t/>
<int16_t/>
</compound>
<int32_t/>
<int32_t name='size'/>
</class-type>
-- CONSTRUCTED
<class-type type-name='item_doorst' inherits-from='item_constructed'/>
<class-type type-name='item_floodgatest' inherits-from='item_constructed'/>
<class-type type-name='item_bedst' inherits-from='item_constructed'/>
<class-type type-name='item_chairst' inherits-from='item_constructed'/>
<class-type type-name='item_chainst' inherits-from='item_constructed'/>
<class-type type-name='item_flaskst' inherits-from='item_constructed'/>
<class-type type-name='item_gobletst' inherits-from='item_constructed'/>
<class-type type-name='item_windowst' inherits-from='item_constructed'/>
<class-type type-name='item_cagest' inherits-from='item_constructed'/>
<class-type type-name='item_bucketst' inherits-from='item_constructed'/>
<class-type type-name='item_animaltrapst' inherits-from='item_constructed'/>
<class-type type-name='item_tablest' inherits-from='item_constructed'/>
<class-type type-name='item_coffinst' inherits-from='item_constructed'/>
<class-type type-name='item_boxst' inherits-from='item_constructed'/>
<class-type type-name='item_armorstandst' inherits-from='item_constructed'/>
<class-type type-name='item_weaponrackst' inherits-from='item_constructed'/>
<class-type type-name='item_cabinetst' inherits-from='item_constructed'/>
<class-type type-name='item_amuletst' inherits-from='item_constructed'/>
<class-type type-name='item_scepterst' inherits-from='item_constructed'/>
<class-type type-name='item_crownst' inherits-from='item_constructed'/>
<class-type type-name='item_ringst' inherits-from='item_constructed'/>
<class-type type-name='item_earringst' inherits-from='item_constructed'/>
<class-type type-name='item_braceletst' inherits-from='item_constructed'/>
<class-type type-name='item_gemst' inherits-from='item_constructed'/>
<class-type type-name='item_anvilst' inherits-from='item_constructed'/>
<class-type type-name='item_backpackst' inherits-from='item_constructed'/>
<class-type type-name='item_quiverst' inherits-from='item_constructed'/>
<class-type type-name='item_catapultpartsst' inherits-from='item_constructed'/>
<class-type type-name='item_ballistapartsst' inherits-from='item_constructed'/>
<class-type type-name='item_trappartsst' inherits-from='item_constructed'/>
<class-type type-name='item_pipe_sectionst' inherits-from='item_constructed'/>
<class-type type-name='item_hatch_coverst' inherits-from='item_constructed'/>
<class-type type-name='item_gratest' inherits-from='item_constructed'/>
<class-type type-name='item_quernst' inherits-from='item_constructed'/>
<class-type type-name='item_millstonest' inherits-from='item_constructed'/>
<class-type type-name='item_splintst' inherits-from='item_constructed'/>
<class-type type-name='item_crutchst' inherits-from='item_constructed'/>
<class-type type-name='item_traction_benchst' inherits-from='item_constructed'/>
<class-type type-name='item_instrumentst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_instrumentst'/>
</class-type>
<class-type type-name='item_toyst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_toyst'/>
</class-type>
<class-type type-name='item_armorst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_armorst'/>
</class-type>
<class-type type-name='item_shoesst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_shoesst'/>
</class-type>
<class-type type-name='item_shieldst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_shieldst'/>
</class-type>
<class-type type-name='item_helmst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_helmst'/>
</class-type>
<class-type type-name='item_glovesst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_glovesst'/>
<df-flagarray name='flags' comment='1 right, 2 left'/>
</class-type>
<class-type type-name='item_pantsst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_pantsst'/>
</class-type>
<class-type type-name='item_siegeammost' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_siegeammost'/>
</class-type>
<class-type type-name='item_weaponst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_weaponst'/>
<int32_t name='sharpness'/>
</class-type>
<class-type type-name='item_ammost' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_ammost'/>
<int32_t name='sharpness'/>
</class-type>
<class-type type-name='item_trapcompst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_trapcompst'/>
<int32_t name='sharpness'/>
</class-type>
<class-type type-name='item_toolst' inherits-from='item_constructed'>
<pointer name='subtype' type-name='itemdef_toolst'/>
<int32_t name='sharpness'/>
<int32_t name='unk_a8'/>
<int16_t name='unk_ac'/>
<int16_t name='unk_ae'/>
</class-type>
<class-type type-name='item_barrelst' inherits-from='item_constructed'>
<int32_t name='stockpile' ref-target='building'/>
<int16_t name='x'/>
<int16_t name='y'/>
</class-type>
<class-type type-name='item_binst' inherits-from='item_constructed'>
<int32_t name='stockpile' ref-target='building'/>
<int16_t name='x'/>
<int16_t name='y'/>
</class-type>
<class-type type-name='item_statuest' inherits-from='item_constructed'>
<int32_t name='unk_a0'/>
<int16_t name='unk_a4'/>
<stl-string name='description'/>
</class-type>
<class-type type-name='item_figurinest' inherits-from='item_constructed'>
<int32_t name='unk_a0'/>
<int16_t name='unk_a4'/>
<stl-string name='description'/>
</class-type>
<class-type type-name='item_slabst' inherits-from='item_constructed'>
<stl-string name='description'/>
<int32_t name='unk_bc'/>
<int16_t name='unk_c0'/>
</class-type>
<class-type type-name='item_orthopedic_castst' inherits-from='item_constructed'>
<stl-string name='unk_a0'/>
<stl-string name='unk_bc'/>
</class-type>
<class-type type-name='item_coinst' inherits-from='item_constructed'>
<int16_t name='unk_a0'/>
</class-type>
<class-type type-name='item_totemst' inherits-from='item_constructed'>
<int16_t name='unk_a0'/>
<int16_t name='unk_a2'/>
<int16_t name='unk_a4'/>
</class-type>
<class-type type-name='item_clothst' inherits-from='item_constructed'>
<int32_t name='dimension'/>
</class-type>
<class-type type-name='item_ballistaarrowheadst' inherits-from='item_actual'>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

File diff suppressed because it is too large Load Diff

@ -0,0 +1,265 @@
<data-definition>
<struct-type type-name='meeting_diplomat'>
<int32_t name='unk1' comment='uninitialized'/>
<pointer name='person1' type-name='unit' comment='diplomat'/>
<pointer name='person2' type-name='unit' comment='count'/>
<pointer name='place' type-name='building'/>
<int16_t name='unk2' comment='1'/>
<int8_t name='unk3' comment='3'/>
<int16_t name='unk4' comment='0'/>
<int32_t name='unk5' comment='-1'/>
</struct-type>
<struct-type type-name='meeting_pet' key-field='name'>
<int32_t name='unk0' comment='uninitialized'/>
<int32_t name='unk1' comment='-1'/>
<int32_t name='pet_id' ref-target='unit'/>
<compound name='name' type-name='language_name'/>
<int32_t name='unk3'/>
</struct-type>
<struct-type type-name='meeting_ref'>
<int32_t name='unk1'
comment='4 person, 7 pet (pet), 8 pet (owner)'/>
<pointer name='ptr' comment='type varies'/>
<int32_t name='unk2' comment='0'/>
</struct-type>
<bitfield-type type-name='job_material_category' base-type='uint32_t'>
<flag-bit name='plant'/>
<flag-bit name='wood'/>
<flag-bit name='cloth'/>
<flag-bit name='silk'/>
<flag-bit name='leather'/>
<flag-bit name='bone'/>
<flag-bit name='shell'/>
<flag-bit name='wood2'/>
<flag-bit name='soap'/>
<flag-bit name='tooth'/>
<flag-bit name='horn'/>
<flag-bit name='pearl'/>
<flag-bit name='yarn'/>
</bitfield-type>
<bitfield-type type-name='job_item_category' base-type='uint32_t'>
<flag-bit name='unk1'/>
<flag-bit name='unk2'/>
<flag-bit name='furniture'/>
<flag-bit name='unk8'/>
<flag-bit name='unk16'/>
<flag-bit name='unk32'/>
<flag-bit name='ammo'/>
<flag-bit name='unk128'/>
<flag-bit name='unk256'/>
<flag-bit name='unk512'/>
<flag-bit name='finished_goods'/>
</bitfield-type>
<struct-type type-name='job_list_link' key-field='job'>
<pointer name='job' type-name='job'/>
<pointer name='prev' type-name='job_list_link'/>
<pointer name='next' type-name='job_list_link'/>
</struct-type>
<struct-type type-name='job' key-field='id'>
<int32_t name='id'/>
<pointer name='list_link' type-name='job_list_link'/>
<enum name='job_id' base-type='int16_t' type-name='job_type'/>
<int32_t name='unk2'/>
<int16_t name='x'/>
<int16_t name='y'/>
<int16_t name='z'/>
<int32_t name='completion_timer' comment='-1 per 10 frames'/>
<uint16_t name='unk4a'/>
<uint16_t name='unk4b'/>
<bitfield name='flags' base-type='uint32_t'>
<flag-bit name='repeat'/>
<flag-bit name='suspend'/>
</bitfield>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<int16_t name='unk5'/>
<int16_t name='unk6'/>
<int16_t name='item_subtype'/>
<int32_t name='unk7'/>
<int32_t name='unk8'/>
<compound name='job_material_category' type-name='job_material_category'/>
<stl-string name='reaction_name'/>
<int32_t name='unk9'/>
<int32_t name='unk10'/>
<stl-vector name='items'>
<pointer>
<pointer name='item' type-name='item'/>
<int32_t name='unk1' comment='1 for reagents, 2 for build materials'/>
<int32_t name='to_bring'
comment='0 immediately once taken to be brought'/>
<int32_t name='job_item_idx'/>
</pointer>
</stl-vector>
<stl-vector name='unk11' type-name='pointer'/>
<stl-vector name='references'>
<pointer type-name='general_ref'/>
</stl-vector>
<stl-vector name='job_items'>
<pointer type-name='job_item'/>
</stl-vector>
</struct-type>
<struct-type type-name='job_item'>
<enum base-type='int16_t' name='itemType' type-name='item_type'/>
<int16_t name='itemSubtype' refers-to='(item-subtype-target $$._parent.itemType $)'/>
<int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
<int32_t name='matIndex'/>
<bitfield name='flags1' base-type='uint32_t'/>
<int32_t name='count'/>
<int16_t name='unk1'/>
<bitfield name='flags2' base-type='uint32_t'/>
<int32_t name='unk2'/>
<bitfield name='flags3' base-type='uint32_t'/>
<int32_t name='unk3'/>
<int32_t name='metal_ore'/>
<stl-string name='reaction_class'/>
<stl-string name='has_material_reaction_product'/>
<int32_t name='unk4'/>
<int32_t name='reagent_index'/>
<stl-vector type-name='int32_t' name='contains' comment='used with custom reactions'/>
<int32_t name='unk5'/>
<int16_t name='has_tool_use'/>
</struct-type>
<struct-type type-name='manager_order'>
<enum name='job_id' base-type='int16_t' type-name='job_type'/>
<int16_t name="unk_2"/>
<int16_t name="item_subtype"/>
<stl-string name="reaction_name"/>
<int16_t name="mat_type" ref-target='material' aux-value='$$.mat_index'/>
<int32_t name="mat_index"/>
<compound name="item_category" type-name='job_item_category'/>
<int32_t name="unk_18"/>
<compound name="material_category" type-name='job_material_category'/>
<int16_t name="amount_left"/>
<int16_t name="amount_total"/>
<int32_t name="is_validated"/>
</struct-type>
<struct-type type-name='mandate'>
<pointer name='unit' type-name='unit'/>
<int16_t name='mode' comment='0 export, 1 make, 2 guild jobs'/>
<enum base-type='int16_t' name='item_type' type-name='item_type'/>
<int16_t name='item_subtype' refers-to='(item-subtype-target $$._parent.item_type $)'/>
<int16_t name='mat_type' ref-target='material' aux-value='$$.mat_index'/>
<int32_t name='mat_index'/>
<int16_t name='amount_total'/>
<int16_t name='amount_remaining'/>
<int32_t name='timeout_counter' comment='counts once per 10 frames'/>
<int32_t name='timeout_limit' comment='once counter passes limit, mandate ends'/>
<int16_t name='unk2'/>
<int16_t name='unk3'/>
<int32_t name='unk4'/>
<uint8_t name='unk5'/>
</struct-type>
<struct-type type-name='activity_entry' key-field='id'>
<code-helper name='find-instance'>(find-by-id $global.world.activities.all $id $)</code-helper>
<int32_t name='id'/>
<int16_t name='is_individual'/>
<stl-vector name='events'>
<pointer type-name='activity_event'/>
</stl-vector>
<int32_t name='unk2'/>
</struct-type>
<class-type type-name='activity_event' original-name='activity_eventst'>
<int32_t name='event_id'
comment='mostly, but not always, the index in activity.events'/>
<int32_t name='activity_id' ref-target='activity_entry'/>
-- Guess:
<int32_t name='subevent_id' comment='-1 unless subevent'/>
<int32_t name='num_subevents' comment='0 for ind.drill, 2 for all in training session'/>
<stl-vector name='hist_figure_ids'>
<int32_t ref-target='historical_figure'/>
</stl-vector>
<stl-vector name='participant_ids'>
<int32_t ref-target='unit'/>
</stl-vector>
-- Either empty, or same as above:
<stl-vector name='hist_figure_ids2'>
<int32_t ref-target='historical_figure'/>
</stl-vector>
<stl-vector name='participant_ids2'>
<int32_t ref-target='unit'/>
</stl-vector>
-- These are equal to the ones above:
<int32_t name='activity_id2' ref-target='activity_entry'/>
<int32_t name='event_id2'/>
</class-type>
<class-type type-name='activity_event_individual_skill_drillst' inherits-from='activity_event'>
<int32_t name='building_id' ref-target='building'/>
<int32_t name='unk5'/>
</class-type>
<class-type type-name='activity_event_training_sessionst' inherits-from='activity_event'>
</class-type>
<class-type type-name='activity_event_combat_trainingst' inherits-from='activity_event'>
<int32_t name='building_id' ref-target='building'/>
<int32_t name='hist_figure_id' ref-target='historical_figure'/>
<int32_t name='unit_id' ref-target='unit'/>
<int32_t name='unk5'/>
</class-type>
<class-type type-name='activity_event_skill_demonstrationst' inherits-from='activity_event'>
<int32_t name='building_id' ref-target='building'/>
<int32_t name='hist_figure_id' ref-target='historical_figure'/>
<int32_t name='unit_id' ref-target='unit'/>
<int16_t name='unk5'/>
<int32_t name='unk6'/>
<int32_t name='unk7'/>
<int32_t name='unk8'/>
<int32_t name='unk9'/>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,108 @@
<data-definition>
<enum-type type-name='language_word_flags'>
<enum-item name='FRONT_COMPOUND_NOUN_SING'/>
<enum-item name='FRONT_COMPOUND_NOUN_PLUR'/>
<enum-item name='FRONT_COMPOUND_ADJ'/>
<enum-item name='FRONT_COMPOUND_PREFIX'/>
<enum-item name='REAR_COMPOUND_NOUN_SING'/>
<enum-item name='REAR_COMPOUND_NOUN_PLUR'/>
<enum-item name='REAR_COMPOUND_ADJ'/>
<enum-item name='THE_NOUN_SING'/>
<enum-item name='THE_NOUN_PLUR'/>
<enum-item name='THE_COMPOUND_NOUN_SING'/>
<enum-item name='THE_COMPOUND_NOUN_PLUR'/>
<enum-item name='THE_COMPOUND_ADJ'/>
<enum-item name='THE_COMPOUND_PREFIX'/>
<enum-item name='OF_NOUN_SING'/>
<enum-item name='OF_NOUN_PLUR'/>
<enum-item name='STANDARD_VERB'/>
</enum-type>
<struct-type type-name='language_word' key-field='word'>
<stl-string name='word'/>
<code-helper name='find-instance'>$global.world.raws.language_words[$]</code-helper>
<compound name='forms' is-union='true'>
<static-array type-name='stl-string' name='all' count='9'/>
<compound>
<stl-string name='noun'/>
<stl-string name='noun_plural'/>
<stl-string name='adjective'/>
<stl-string name='prefix'/>
<stl-string name='verb'/>
<stl-string name='verb_3rd_person'/>
<stl-string name='verb_past'/>
<stl-string name='verb_passive'/>
<stl-string name='verb_gerund'/>
</compound>
</compound>
<uint8_t name='adj_dist'/>
<padding size='7' comment='looks like garbage'/>
<df-flagarray name='flags' index-enum='language_word_flags'/>
</struct-type>
<struct-type type-name='language_translation' key-field='name'>
<stl-string name='name'/>
<code-helper name='find-instance'>$global.world.raws.translations[$]</code-helper>
<stl-vector name='unknown1' comment='empty'/>
<stl-vector name='unknown2' comment='empty'/>
<stl-vector name='words' index-refers-to='$global.world.raws.language_words[$]'>
<pointer type-name='stl-string'/>
</stl-vector>
</struct-type>
<struct-type type-name='language_symbol'>
<stl-string name='name'/>
<stl-vector name='unknown' comment='empty'/>
<stl-vector name='words'>
<int32_t ref-target='language_word'/>
</stl-vector>
</struct-type>
<struct-type type-name='language_name'>
<stl-string name='first_name'/>
<stl-string name='nickname'/>
<static-array name='words' count='7'>
<int32_t ref-target='language_word'/>
</static-array>
<static-array name='parts_of_speech' count='7' type-name='int16_t'/>
<int32_t name='language' ref-target='language_translation'/>
<int16_t name='unknown'/>
<bool name='has_name'/>
<code-helper name='describe'>
(when $.has_name
(let* ((nick $.nickname)
(language $global.world.raws.translations[$.language])
(fname $.first_name)
(lwords $language.words))
(fmt "~:(~@[~A ~]~@['~A' ~]~{~A~^ ~}~)"
(if (> (length fname) 0) fname)
(if (> (length nick) 0) nick)
(loop for i from 0 below 7 for word = $.words[i]
when (>= word 0) collect $lwords[word].value))))
</code-helper>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,317 @@
<data-definition>
<struct-type type-name='historical_entity' key-field='id'>
<int16_t name='unk1'/>
<int32_t name='id' comment='index in the array'/>
<pointer name='entity_raw'/>
<int32_t name='save_file_id' comment='changes once has 100 entries'/>
<int16_t name='next_member_idx'/>
<compound name='name' type-name='language_name'/>
<code-helper name='find-instance'>(find-by-id $global.world.entities.all $id $)</code-helper>
<code-helper name='describe'>
(describe-obj $.name)
(describe-obj (find-creature $.race))
</code-helper>
<int16_t name='race' ref-target='creature_raw'/>
<int32_t name='unk5'/>
<static-array name='unk6' count='2'>
<stl-vector>
<pointer>
<int16_t name='unk1'/>
<int32_t name='unk2'/>
<int16_t name='unk3'/>
</pointer>
</stl-vector>
</static-array>
<stl-vector name='unit_ids'>
<int32_t ref-target='unit'/>
</stl-vector>
<stl-vector name='unk7' type-name='int32_t'/>
<stl-vector name='nemesis_ids'>
<int32_t ref-target='historical_figure'/>
</stl-vector>
<compound name='unknown1'>
<static-array name='unk8' count='15'>
<stl-vector type-name='int16_t'/>
</static-array>
<static-array name='unk9' count='12'>
<stl-vector name='unk1' type-name='int16_t'/>
<stl-vector name='unk2' type-name='int32_t'/>
</static-array>
<static-array name='unk10' count='3'>
<stl-vector type-name='int32_t'/>
</static-array>
<static-array name='unk11' count='21'>
<stl-vector name='unk1' type-name='int16_t'/>
<stl-vector name='unk2' type-name='int32_t'/>
</static-array>
<compound name='unk12'>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector name='unk6e8' type-name='int32_t' comment='empty'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t' comment='empty'/>
<stl-vector type-name='int16_t'/>
<stl-vector name='unk748' type-name='int16_t' comment='empty'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector name='unk798' type-name='int32_t' comment='empty'/>
<stl-vector name='unk7a8' type-name='int32_t' comment='empty'/>
</compound>
<static-array name='unk13' count='3'>
<int16_t name='unk1'/>
<int32_t name='unk2'/>
</static-array>
<stl-vector name='unk14' type-name='pointer' comment='empty'/>
<static-array name='unk15' count='24' type-name='int16_t'/>
<stl-vector name='unk16' type-name='int16_t'/>
<stl-vector name='unk17' type-name='int32_t'/>
<stl-vector name='unk18' type-name='int16_t'/>
<stl-vector name='unk19' type-name='int8_t'/>
<stl-vector name='unk20' type-name='int8_t'/>
<stl-vector name='unk21' type-name='int8_t'/>
<stl-vector name='unk22' type-name='int8_t'/>
<stl-vector name='unk23' type-name='int16_t'/>
<stl-vector name='unk24' type-name='int16_t'/>
</compound>
<stl-vector name='uniforms'>
<pointer type-name='entity_uniform'/>
</stl-vector>
<compound name='unknown1b'>
<int16_t name='unk26a'/>
<int16_t name='unk26b'/>
<int16_t name='unk27'/>
<int32_t name='unk28'/>
<int32_t name='unk29'/>
<int32_t name='unk30'/>
<int32_t name='unk31'/>
<df-flagarray name='flags'/>
<stl-vector name='unk32a' type-name='pointer' comment='empty'/>
<stl-vector name='unk32b' type-name='int32_t'/>
<stl-vector name='unk32c' type-name='int32_t'/>
<stl-vector name='unk32d' type-name='int32_t'/>
<stl-vector name='unk32e' type-name='pointer'/>
<stl-vector name='unk32f' type-name='pointer'/>
<int16_t name='unk33'/>
<stl-vector name='unk34a' type-name='int16_t'/>
<stl-vector name='unk34b' type-name='int16_t'/>
<stl-vector name='unk34c' type-name='int16_t'/>
<stl-vector name='unk34d' type-name='pointer' comment='empty'/>
<stl-vector name='unk34e' type-name='pointer' comment='empty'/>
<stl-vector name='unk34f' type-name='pointer'/>
<stl-vector name='unk34g' type-name='pointer'/>
<stl-vector name='unk34h' type-name='pointer'/>
<int32_t name='unk35'/>
<stl-vector name='unk36' type-name='pointer'/>
<int32_t name='unk37'/>
<stl-vector name='unk38' type-name='pointer'/>
<int32_t name='unk39'/>
<stl-vector name='unk40' type-name='pointer'/>
<stl-vector name='unk41' type-name='int32_t'/>
<int32_t name='unk42'/>
<stl-vector name='unk43' type-name='pointer' comment='empty'/>
<int32_t name='unk44'/>
<stl-vector name='unk45' type-name='pointer'/>
<pointer name='unk46'/>
<int16_t name='unk47'/>
<int32_t name='unk48'/>
<static-array name='unk49' count='15' type-name='int32_t'/>
<stl-vector name='unk50' type-name='pointer' comment='empty'/>
</compound>
<stl-vector name='hist_figures'>
<pointer type-name='historical_figure'/>
</stl-vector>
<stl-vector name='nemesis'>
<pointer type-name='nemesis_record'/>
</stl-vector>
<compound name='unknown2'>
<stl-vector name='unk1' type-name='int16_t'/>
<stl-vector name='unk2' type-name='int32_t'/>
<stl-vector name='unk3' type-name='int16_t'/>
<stl-vector name='unk4' type-name='int32_t'/>
<static-array name='unk5' count='30'>
<stl-vector type-name='int16_t'/>
</static-array>
<static-array name='unk6' count='25'>
<stl-vector type-name='pointer'/>
</static-array>
<static-array name='unk6b' count='6'>
<stl-vector type-name='int16_t'/>
</static-array>
<stl-vector name='unk8' type-name='int32_t'/>
<int32_t name='unk9'/>
<stl-vector name='unk10' type-name='int16_t'/>
<pointer name='unk11'/>
<int16_t name='unk12a' comment='-1'/>
<int16_t name='unk12b' comment='uninitialized'/>
<bool name='unk13' comment='0'/>
<int32_t name='unk14' comment='0'/>
<int32_t name='unk15' comment='uninitialized'/>
<int32_t name='unk16' comment='uninitialized'/>
<int16_t name='unk17' comment='0'/>
<stl-vector name='unk18' type-name='pointer' comment='empty'/>
<stl-vector name='unk19' type-name='pointer' comment='empty'/>
<int16_t name='unk20' comment='0'/>
<int32_t name='unk21' comment='0'/>
<int32_t name='unk22' comment='0'/>
<int32_t name='unk23' comment='0'/>
<stl-vector name='unk24' type-name='pointer' comment='empty'/>
<stl-vector name='unk25' type-name='pointer' comment='empty'/>
<static-array name='unk26' count='173' type-name='int32_t' comment='Uninitialized'/>
<static-array name='unk27' count='15' type-name='int32_t' comment='0'/>
<stl-vector name='unk28' type-name='pointer' comment='empty'/>
</compound>
</struct-type>
<struct-type type-name='entity_population' key-field='id'>
<compound name='name' type-name='language_name'/>
<code-helper name='find-instance'>(find-by-id $global.world.entity_populations $id $)</code-helper>
<code-helper name='describe'>
(describe-obj $.name)
</code-helper>
<stl-vector name='unk1'>
<int16_t ref-target='creature_raw'/>
</stl-vector>
<stl-vector name='unk2' type-name='int32_t'/>
<stl-vector name='unk3' type-name='int32_t'/>
<stl-vector name='unk4'>
<pointer>
<static-array count='3'>
<stl-vector>
<pointer>
<int32_t name='idx'/>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
</pointer>
</stl-vector>
</static-array>
</pointer>
</stl-vector>
<int32_t name='unk5'/>
<int32_t name='unk6'/>
<int32_t name='id'/>
<bool name='unk7' comment='unk6 == -1'/>
<int32_t name='civ_id' ref-target='historical_entity'/>
</struct-type>
<struct-type type-name='nemesis_record' key-field='id'>
<int32_t name='id' comment='sequential index in the array'/>
<code-helper name='find-instance'>(find-by-id $global.world.nemesis.all $id $)</code-helper>
<int32_t name='unit_id' ref-target='unit'/>
<int32_t name='save_file_id' comment='unit-*.dat'/>
<int16_t name='member_idx' comment='index in the file'/>
<pointer name='figure' type-name='historical_figure'/>
<pointer name='unit' type-name='unit'/>
<code-helper name='describe'>
(describe-obj $.figure)
</code-helper>
<int32_t name='unk6' comment='-1'/>
<stl-vector name='unk7' type-name='pointer' comment='empty'/>
<int16_t name='unk10' comment='-1'/>
<int32_t name='unk11' comment='-1'/>
<int32_t name='unk12' comment='-1'/>
<df-flagarray name='flags'/>
<stl-vector name='unk13' type-name='pointer' comment='empty'/>
</struct-type>
<struct-type type-name='artifact_record' key-field='id'>
<int32_t name='id'/>
<code-helper name='find-instance'>(find-by-id $global.world.artifacts.all $id $)</code-helper>
<code-helper name='describe'>
(describe-obj $.name)
</code-helper>
<compound name='name' type-name='language_name'/>
<pointer name='unk1'/>
<int32_t name='unk2'/>
<pointer name='item' type-name='item'/>
</struct-type>
<class-type type-name='history_event' original-name='history_eventst' key-field='id'>
<int32_t name='year'/>
<int32_t name='seconds'/>
<df-flagarray name='flags'/>
<int32_t name='id'/>
<code-helper name='find-instance'>(find-by-id $global.world.history.events $id $)</code-helper>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,97 @@
<data-definition>
-- MACHINE
<class-type type-name='machine' original-name='machinest' key-field='id'>
<int32_t name="x"/>
<int32_t name="y"/>
<int32_t name="z"/>
<int32_t name="id"/>
<code-helper name='find-instance'>(find-by-id $global.world.machines.all $id $)</code-helper>
<stl-vector name="components">
<pointer>
<int32_t name="building_id" ref-target='building'/>
<stl-vector name="connections" type-name='int32_t'
comment='indices into the same component vector'/>
</pointer>
</stl-vector>
<int32_t name="cur_power"/>
<int32_t name="min_power"/>
<int8_t name='visual_phase'/>
<int16_t name="phase_timer"/>
<int32_t name="is_active"/>
</class-type>
<class-type type-name='machine_standardst' inherits-from='machine'>
</class-type>
-- MACHINE COMPONENT BUILDINGS
<class-type type-name='building_axle_horizontalst' inherits-from='building_actual'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_fc"/>
<bool name='is_vertical'/>
</class-type>
<class-type type-name='building_axle_verticalst' inherits-from='building_actual'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_fc"/>
</class-type>
<class-type type-name='building_gear_assemblyst' inherits-from='building_actual'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_fc"/>
<bitfield name='gear_flags'>
<flag-bit name='disengaged'/>
</bitfield>
</class-type>
<class-type type-name='building_windmillst' inherits-from='building_actual'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_fc"/>
<int16_t name="orient_angle"/>
<int16_t name="orient_mode"/>
<int16_t name="is_working"/>
<bool name="visual_rotated"/>
<int16_t name="rotate_timer"/>
<int16_t name="orient_timer"/>
</class-type>
<class-type type-name='building_water_wheelst' inherits-from='building_actual'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_fc"/>
<bool name='is_vertical'/>
<bool name='gives_power'/>
</class-type>
<class-type type-name='building_screw_pumpst' inherits-from='building_actual'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t name="unk_fc"/>
<uint8_t name="unk_100"/>
<enum name='direction' base-type='int8_t'>
<enum-item name='FromNorth'/>
<enum-item name='FromEast'/>
<enum-item name='FromSouth'/>
<enum-item name='FromWest'/>
</enum>
<bool name='pump_manually'/>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,247 @@
<data-definition>
<enum-type type-name='tile_traffic'>
<enum-item name='Normal'/>
<enum-item name='Low'/>
<enum-item name='High'/>
<enum-item name='Restricted'/>
</enum-type>
<enum-type type-name='tile_dig_designation'>
<enum-item name='No' comment='no designation'/>
<enum-item name='Default' comment='dig walls, remove stairs and ramps, gather plants, fell trees'/>
<enum-item name='UpDownStair'/>
<enum-item name='Channel'/>
<enum-item name='Ramp'/>
<enum-item name='DownStair'/>
<enum-item name='UpStair'/>
</enum-type>
<enum-type type-name='tile_liquid'>
<enum-item name='Water'/>
<enum-item name='Magma'/>
</enum-type>
<bitfield-type type-name='tile_designation'>
<flag-bit name='flow_size' count='3' comment='liquid amount'/>
<flag-bit name='pile' comment='stockpile?'/>
<flag-bit name='dig' count='3'
refers-to='(enum-to-key $tile_dig_designation $)'/>
<flag-bit name='smooth' count='2'/>
<flag-bit name='hidden'/>
<flag-bit name='geolayer_index' count='4'/>
<flag-bit name='light'/>
<flag-bit name='subterranean'/>
<flag-bit name='outside'/>
<flag-bit name='biome' count='4'/>
<flag-bit name='liquid_type'
refers-to='(enum-to-key $tile_liquid $)'/>
<flag-bit name='water_table' comment='aquifer'/>
<flag-bit name='rained'/>
<flag-bit name='traffic' count='2'
refers-to='(enum-to-key $tile_traffic $)'/>
<flag-bit name='flow_forbid'/>
<flag-bit name='liquid_static'/>
<flag-bit name='feature_local'/>
<flag-bit name='feature_global'/>
<flag-bit name='water_stagnant'/>
<flag-bit name='water_salt'/>
</bitfield-type>
<bitfield-type type-name='tile_occupancy'>
<flag-bit name='building' count='3'/>
<flag-bit name='unit' comment='standing'/>
<flag-bit name='unit_grounded' comment='prone'/>
<flag-bit name='item'/>
<flag-bit name='edge_flow_in'
comment='if set on an edge tile, water or magma will flow in'/>
<flag-bit name='moss'/>
<flag-bit name='arrow_color' count='4'/>
<flag-bit name='arrow_variant'/>
<flag-bit name='unk13'/>
<flag-bit name='monster_lair'
comment='A monster lair. Items placed wont be moved.'/>
<flag-bit name='no_grow'
comment='seems to be set on terrain tiles where grass growth is impossible'/>
</bitfield-type>
<enum-type type-name='block_flags'>
<enum-item name='Designated' comment='for jobs etc'/>
<enum-item name='UpdateTemperature'/>
<enum-item name='UpdateLiquid'/>
<enum-item name='UpdateLiquidTwice'
comment='Protects UpdateLiquid from being cleared the first time.'/>
</enum-type>
<struct-type type-name='block_burrow'>
<int32_t name='id' ref-target='burrow'/>
<static-array name='tile_bitmask' count='16'>
<uint16_t/>
</static-array>
<pointer name="link" type-name='block_burrow_link'/>
</struct-type>
<struct-type type-name='block_burrow_link'>
<pointer name='item' type-name='block_burrow'/>
<pointer name='prev' type-name='block_burrow_link'/>
<pointer name='next' type-name='block_burrow_link'/>
</struct-type>
<struct-type type-name='map_block'>
<df-flagarray name='flags' index-enum='block_flags'/>
<stl-vector name='block_events'>
<pointer/>
</stl-vector>
<compound name='block_burrows' type-name='block_burrow_link'/>
<int32_t name='local_feature'/>
<int32_t name='global_feature'/>
<int32_t name='unk2'/>
<int32_t name='unk3' comment='undef'/>
<int32_t name='unk4'/>
<int32_t name='unk5'/>
<stl-vector name='items'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='effects'>
<pointer/>
</stl-vector>
<int32_t name='unk7'/>
<int32_t name='unk8' comment='undef'/>
<stl-vector name='plants'>
<pointer/>
</stl-vector>
<int16_t name='map_x'/>
<int16_t name='map_y'/>
<int16_t name='map_z'/>
<int16_t name='region_x'/>
<int16_t name='region_y'/>
<static-array name='tiletype' count='16'>
<static-array count='16'>
<int16_t/>
</static-array>
</static-array>
<static-array name='designation' count='16'>
<static-array count='16'>
<compound type-name='tile_designation'/>
</static-array>
</static-array>
<static-array name='occupancy' count='16'>
<static-array count='16'>
<compound type-name='tile_occupancy'/>
</static-array>
</static-array>
<static-array name='unk9' count='16'>
<static-array count='16'>
<int8_t/>
</static-array>
</static-array>
<static-array name='pathfinding' count='16'>
<static-array count='16'>
<int32_t/>
</static-array>
</static-array>
<static-array name='unk10' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='unk11' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='unk12' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='temperature_1' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='temperature_2' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='unk13' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='unk14' count='16'>
<static-array count='16'>
<uint16_t/>
</static-array>
</static-array>
<static-array name='region_offset' count='9'>
<uint8_t/>
</static-array>
</struct-type>
<struct-type type-name='cave_column_link'>
<pointer name='item'/>
<pointer name='prev' type-name='cave_column_link'/>
<pointer name='next' type-name='cave_column_link'/>
</struct-type>
<struct-type type-name='map_block_column'>
<int16_t name="unk_0"/>
<int16_t name="unk_2"/>
<int16_t name="unk_4"/>
<stl-vector name="unk_8">
<pointer>
<static-array name='unk1' count='8' type-name='int16_t'/>
<static-array name='unk2' count='4' type-name='uint8_t'/>
</pointer>
</stl-vector>
<int16_t name="z_base"/>
<static-array name='cave_columns' count='16'>
<static-array count='16'>
<compound type-name='cave_column_link'/>
</static-array>
</static-array>
<stl-vector name='column_rectangles'>
<pointer/>
</stl-vector>
<int16_t name='unk_c2c'/>
<df-flagarray name='flags'/>
<int16_t name='tile_min_x'/>
<int16_t name='tile_min_y'/>
<int16_t name='unk_c3c' comment='uninitialized'/>
<int16_t name='unk_c3e'/>
<int16_t name='unk_c40'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,341 @@
<data-definition>
<struct-type type-name='material_common'>
<stl-string name='id'/>
<stl-string name='gem_name1'/>
<stl-string name='gem_name2'/>
<stl-string name='stone_name'/>
<code-helper name='describe'> (describe-material $) </code-helper>
<compound name='heat'>
<uint16_t name='spec_heat'/>
<uint16_t name='heatdam_point'/>
<uint16_t name='colddam_point'/>
<uint16_t name='ignite_point'/>
<uint16_t name='melting_point'/>
<uint16_t name='boiling_point'/>
<uint16_t name='mat_fixed_temp'/>
</compound>
<int32_t name='solid_density'/>
<int32_t name='liquid_density'/>
<int32_t name='molar_mass'/>
<static-array name='state_color' type-name='int32_t' count='6'/>
<static-array name='state_name' type-name='stl-string' count='6'/>
<static-array name='state_adj' type-name='stl-string' count='6'/>
<compound name='strength'>
<int32_t name='absorption'/>
<int32_t name='bending_yield'/>
<int32_t name='shear_yield'/>
<int32_t name='torsion_yield'/>
<int32_t name='impact_yield'/>
<int32_t name='tensile_yield'/>
<int32_t name='compressive_yield'/>
<int32_t name='bending_fracture'/>
<int32_t name='shear_fracture'/>
<int32_t name='torsion_fracture'/>
<int32_t name='impact_fracture'/>
<int32_t name='tensile_fracture'/>
<int32_t name='compressive_fracture'/>
<int32_t name='bending_strain_at_yield'/>
<int32_t name='shear_strain_at_yield'/>
<int32_t name='torsion_strain_at_yield'/>
<int32_t name='impact_strain_at_yield'/>
<int32_t name='tensile_strain_at_yield'/>
<int32_t name='compressive_strain_at_yield'/>
<int32_t name='max_edge'/>
</compound>
<int32_t name='material_value'/>
<df-flagarray name='mat_flags'/>
<int16_t name='extract_storage'/>
<int16_t name='butcher_special_type'/>
<int16_t name='butcher_special_subtype'/>
<static-array name='meat_name' type-name='stl-string' count='3'/>
<static-array name='block_name' type-name='stl-string' count='2'/>
<stl-vector name='material_reaction_product_id'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector name='material_reaction_product_matType' type-name='int16_t'/>
<stl-vector name='material_reaction_product_matIndex' type-name='int32_t'/>
<static-array name='material_reaction_product_str' count='3'>
<stl-vector>
<pointer type-name='stl-string'/>
</stl-vector>
</static-array>
<int16_t name='hardens_with_water_matType'/>
<int32_t name='hardens_with_water_matIndex'/>
<static-array name='hardens_with_water_str' type-name='stl-string' count='3'/>
<stl-vector name='reaction_class'>
<pointer type-name='stl-string'/>
</stl-vector>
<uint8_t name='tile'/>
<static-array name='basic_color' type-name='int16_t' count='2'/>
<static-array name='build_color' type-name='int16_t' count='3'/>
<static-array name='tile_color' type-name='int16_t' count='3'/>
<uint8_t name='item_symbol'/>
<int16_t name='powder_dye'/> // color token index
<int16_t name='temp_diet_info'/>
<stl-vector name='syndrome'>
<pointer/>
</stl-vector>
<int32_t name='soap_level'/>
</struct-type>
<struct-type type-name='material'>
<compound type-name='material_common'/>
<code-helper name='find-instance'>(material-by-id $ $$)</code-helper>
<code-helper name='describe'> (describe-material $) </code-helper>
<stl-string name='prefix'/>
<static-array name='food_mat_index' count='37'>
<int32_t refers-to='(food-mat-by-idx $$._key $)'
comment='When valid, refers to itself.'/>
</static-array>
<stl-string name='powder_dye_str' comment='temporary'/>
<static-array name='state_color_str' type-name='stl-string' count='6'/>
</struct-type>
<struct-type type-name='material_template'>
<compound type-name='material_common'/>
<code-helper name='describe'> (describe-material $) </code-helper>
<stl-string name='powder_dye_str' comment='temporary'/>
<static-array name='state_color_str' type-name='stl-string' count='6'/>
</struct-type>
<struct-type type-name='material_plant' key-field='id'>
<stl-string name='id'/>
<code-helper name='find-instance'>$global.world.raws.plants.all[$]</code-helper>
<df-flagarray name='flags'/>
<stl-string name='name'/>
<stl-string name='name_plural'/>
<stl-string name='adj'/>
<stl-string name='seed_singular'/>
<stl-string name='seed_plural'/>
<stl-string name='leaves_singular'/>
<stl-string name='leaves_plural'/>
<uint8_t name='unk1'/>
<uint8_t name='unk2'/>
<compound name='tiles'>
<uint8_t name='picked_tile'/>
<uint8_t name='dead_picked_tile'/>
<uint8_t name='shrub_tile'/>
<uint8_t name='dead_shrub_tile'/>
<uint8_t name='leaves_tile'/>
<uint8_t name='tree_tile'/>
<uint8_t name='dead_tree_tile'/>
<uint8_t name='sapling_tile'/>
<uint8_t name='dead_sapling_tile'/>
<static-array type-name='uint8_t' name='grass_tiles' count='16'/>
<static-array type-name='uint8_t' name='alt_grass_tiles' count='12'/>
</compound>
<int32_t name='growdur'/>
<int32_t name='value'/>
<compound name='colors'>
<static-array type-name='int8_t' name='picked_color' count='3'/>
<static-array type-name='int8_t' name='dead_picked_color' count='3'/>
<static-array type-name='int8_t' name='shrub_color' count='3'/>
<static-array type-name='int8_t' name='dead_shrub_color' count='3'/>
<static-array type-name='int8_t' name='seed_color' count='3'/>
<static-array type-name='int8_t' name='leaves_color' count='3'/>
<static-array type-name='int8_t' name='dead_leaves_color' count='3'/>
<static-array type-name='int8_t' name='tree_color' count='3'/>
<static-array type-name='int8_t' name='dead_tree_color' count='3'/>
<static-array type-name='int8_t' name='sapling_color' count='3'/>
<static-array type-name='int8_t' name='dead_sapling_color' count='3'/>
<static-array type-name='int8_t' name='grass_colors_0' count='20'/>
<static-array type-name='int8_t' name='grass_colors_1' count='20'/>
<static-array type-name='int8_t' name='grass_colors_2' count='20'/>
</compound>
<static-array type-name='int32_t' name='alt_period' count='2'/>
<int8_t name='shrub_drown_level'/>
<int8_t name='tree_drown_level'/>
<int8_t name='sapling_drown_level'/>
<int16_t name='frequency'/>
<int16_t name='clustersize'/>
<stl-vector name='prefstring'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector name='material'>
<pointer type-name='material'/>
</stl-vector>
<compound name='material_defs'>
<int16_t name='material_type_basic_mat'/>
<int16_t name='material_type_tree'/>
<int16_t name='material_type_drink'/>
<int16_t name='material_type_seed'/>
<int16_t name='material_type_thread'/>
<int16_t name='material_type_mill'/>
<int16_t name='material_type_extract_vial'/>
<int16_t name='material_type_extract_barrel'/>
<int16_t name='material_type_extract_still_vial'/>
<int16_t name='material_type_leaves'/>
<int32_t name='material_idx_basic_mat'/>
<int32_t name='material_idx_tree'/>
<int32_t name='material_idx_drink'/>
<int32_t name='material_idx_seed'/>
<int32_t name='material_idx_thread'/>
<int32_t name='material_idx_mill'/>
<int32_t name='material_idx_extract_vial'/>
<int32_t name='material_idx_extract_barrel'/>
<int32_t name='material_idx_extract_still_vial'/>
<int32_t name='material_idx_leaves'/>
<static-array type-name='stl-string' name='material_str_basic_mat' count='3'/>
<static-array type-name='stl-string' name='material_str_tree' count='3'/>
<static-array type-name='stl-string' name='material_str_drink' count='3'/>
<static-array type-name='stl-string' name='material_str_seed' count='3'/>
<static-array type-name='stl-string' name='material_str_thread' count='3'/>
<static-array type-name='stl-string' name='material_str_mill' count='3'/>
<static-array type-name='stl-string' name='material_str_extract_vial' count='3'/>
<static-array type-name='stl-string' name='material_str_extract_barrel' count='3'/>
<static-array type-name='stl-string' name='material_str_extract_still_vial' count='3'/>
<static-array type-name='stl-string' name='material_str_leaves' count='3'/>
</compound>
<int32_t name='underground_depth_min'/>
<int32_t name='underground_depth_max'/>
</struct-type>
<struct-type type-name='material_inorganic' key-field='id'>
<stl-string name='id'/>
<code-helper name='find-instance'>$global.world.raws.inorganics.all[$]</code-helper>
<df-flagarray name='flags'/>
<stl-vector name='metal_ore_str' comment='only during parsing'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector type-name='int16_t' name='metal_ore_matIndex'/>
<stl-vector type-name='int16_t' name='metal_ore_probability'/>
<stl-vector name='thread_metal_str' comment='only during parsing'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector type-name='int16_t' name='thread_metal_matIndex'/>
<stl-vector type-name='int16_t' name='thread_metal_probability'/>
<stl-vector type-name='int32_t' name='unk1'/>
<stl-vector name='environment_spec_str' comment='only during parsing'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector type-name='int16_t' name='environment_spec_matIndex'/>
<stl-vector type-name='int16_t' name='environment_spec_inclusion_type'/>
<stl-vector type-name='int8_t' name='environment_spec_probability'/>
<stl-vector type-name='int16_t' name='environment_location'/>
<stl-vector type-name='int16_t' name='environment_type'/>
<stl-vector type-name='int8_t' name='environment_probability'/>
<int32_t name='unk2'/>
<compound name='material' type-name='material'/>
</struct-type>
<enum-type type-name='organic_mat_category'>
<enum-item name='Meat'/>
<enum-item name='Fish'/>
<enum-item name='UnpreparedFish'/>
<enum-item name='Eggs'/>
<enum-item name='Plants'/>
<enum-item name='PlantDrink'/>
<enum-item name='CreatureDrink'/>
<enum-item name='PlantCheese'/>
<enum-item name='CreatureCheese'/>
<enum-item name='Seed'/>
<enum-item name='Leaf'/>
<enum-item name='PlantPowder'/>
<enum-item name='CreaturePowder'/>
<enum-item name='Glob'/>
<enum-item name='PlantLiquid'/>
<enum-item name='CreatureLiquid'/>
<enum-item name='MiscLiquid'/>
<enum-item name='Leather'/>
<enum-item name='Silk'/>
<enum-item name='PlantFiber'/>
<enum-item name='Bone'/>
<enum-item name='Shell'/>
<enum-item name='Wood'/>
<enum-item name='Horn'/>
<enum-item name='Pearl'/>
<enum-item name='Tooth'/>
<enum-item name='EdibleCheese'/>
<enum-item name='AnyDrink'/>
<enum-item name='EdiblePlant'/>
<enum-item name='CookableLiquid'/>
<enum-item name='CookablePowder'/>
<enum-item name='CookableSeed'/>
<enum-item name='CookableLeaf'/>
<enum-item name='Paste'/>
<enum-item name='Pressed'/>
<enum-item name='Yarn'/>
<enum-item name='MetalThread'/>
</enum-type>
<struct-type type-name='special_mat_table'>
<static-array name='organic_types' count='37' index-enum='organic_mat_category'>
<stl-vector type-name='int16_t' index-refers-to='(food-mat-by-idx $$._key $)'/>
</static-array>
<static-array name='organic_indexes' count='37' index-enum='organic_mat_category'>
<stl-vector type-name='int32_t'/>
</static-array>
<static-array name='organic_unknown' count='37' comment='everything 0'
index-enum='organic_mat_category'>
<stl-vector type-name='int32_t'/>
</static-array>
<static-array name='builtin' count='659'>
<pointer type-name='material'/>
</static-array>
<stl-vector name='extract_types'>
<int16_t ref-target='material' aux-value='$$._parent.extract_indexes[$._key]'/>
</stl-vector>
<stl-vector name='extract_indexes' type-name='int32_t'/>
<stl-vector name='extract_unknown' type-name='int32_t'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,238 @@
<data-definition>
<struct-type type-name='squad_uniform_spec'>
<int32_t name="item" ref-target='item'/>
<enum base-type='int16_t' name="item_type" type-name='item_type'/>
<int16_t name="item_subtype" refers-to='(item-subtype-target $$._parent.item_type $)'/>
<int16_t name="material_class"/>
<int16_t name='mattype' ref-target='material' aux-value='$$.matindex'/>
<int32_t name='matindex'/>
<int32_t name="color"/>
<stl-vector name="assigned">
<int32_t ref-target='item'/>
</stl-vector>
<int32_t name="indiv_choice" comment='1 weapon, 2 melee, 4 ranged'/>
</struct-type>
<struct-type type-name='squad_ammo_spec'>
<enum base-type='int16_t' name="item_type" type-name='item_type'/>
<int16_t name="item_subtype" refers-to='(item-subtype-target $$._parent.item_type $)'/>
<int16_t name="material_class"/>
<int16_t name='mattype' ref-target='material' aux-value='$$.matindex'/>
<int32_t name='matindex'/>
<int32_t name="amount"/>
<bitfield name='flags' base-type='uint32_t'>
<flag-bit name='use_combat'/>
<flag-bit name='use_training'/>
</bitfield>
<stl-vector name="assigned">
<int32_t ref-target='item'/>
</stl-vector>
</struct-type>
<bitfield-type type-name='squad_use_flags' base-type='uint32_t'>
<flag-bit name='sleep'/>
<flag-bit name='train'/>
<flag-bit name='indiv_eq'/>
<flag-bit name='squad_eq'/>
</bitfield-type>
<enum-type type-name='uniform_category'>
<enum-item name='body'/>
<enum-item name='head'/>
<enum-item name='pants'/>
<enum-item name='gloves'/>
<enum-item name='shoes'/>
<enum-item name='shield'/>
<enum-item name='weapon'/>
</enum-type>
<bitfield-type type-name='uniform_flags' base-type='uint32_t'>
<flag-bit name='replace_clothing'/>
<flag-bit name='exact_matches'/>
</bitfield-type>
<struct-type type-name='squad_position' key-field='occupant'>
<int32_t name='occupant' ref-target='historical_figure'/>
<stl-vector name="unk_4"/>
<compound name='preferences'>
<stl-vector name="bed">
<int32_t ref-target='building'/>
</stl-vector>
<stl-vector name="armor_stand">
<int32_t ref-target='building'/>
</stl-vector>
<stl-vector name="box">
<int32_t ref-target='building'/>
</stl-vector>
</compound>
<stl-vector name="unk_44"/>
<static-array name='uniform' count='7' index-enum='uniform_category'>
<stl-vector>
<pointer type-name='squad_uniform_spec'/>
</stl-vector>
</static-array>
<stl-string name="unk_c4"/>
<compound name='flags' type-name='uniform_flags'/>
<stl-vector name='assigned_items'>
<int32_t ref-target='item'/>
</stl-vector>
<int32_t name="quiver" ref-target='item'/>
<int32_t name="backpack" ref-target='item'/>
<int32_t name="flask" ref-target='item'/>
-- May be invalid:
<int32_t name="activity1" ref-target='activity_entry'/>
<int32_t name="activity2" ref-target='activity_entry'/>
<int32_t name="activity3" ref-target='activity_entry'/>
<int32_t name="unk_10c"/>
<int32_t name="unk_110"/>
<int32_t name="unk_114"/>
<int32_t name="unk_118"/>
<int32_t name="unk_11c"/>
</struct-type>
<struct-type type-name='squad' key-field='id'>
<int32_t name='id'/>
<code-helper name='find-instance'>(find-by-id $global.world.squads.all $id $)</code-helper>
<compound name='name' type-name='language_name'/>
<stl-string name='unk'/>
<code-helper name='describe'>
(describe-obj $.name)
</code-helper>
<stl-vector name='positions'>
<pointer type-name='squad_position'/>
</stl-vector>
<stl-vector name="unk_9c"/>
<stl-vector name="schedule">
<pointer>
<static-array count='12'>
<stl-string name='name'/>
<int16_t name='sleep_mode' comment='0 room, 1 barrack will, 2 barrack need'/>
<int16_t name='uniform_mode' comment='0 uniformed, 1 civ clothes'/>
<stl-vector name='orders'>
<pointer>
<pointer name="order"/>
<int32_t name="min_count"/>
<stl-vector name="unk_8">
<int32_t/>
</stl-vector>
<int32_t name="unk_18"/>
</pointer>
</stl-vector>
<stl-vector name='order_assignments'>
<int32_t refers-to='$$._parent._parent.orders[$]'/>
</stl-vector>
</static-array>
</pointer>
</stl-vector>
<int32_t name="cur_alert_idx"/>
<stl-vector name="rooms">
<pointer>
<int32_t name='building_id' ref-target='building'/>
<compound name='mode' type-name='squad_use_flags'/>
</pointer>
</stl-vector>
<stl-vector name="unk_d0"/>
<stl-vector name="unk_e0"/>
<int32_t name="uniform_priority"/>
<int32_t name="activity" ref-target='activity_entry'/>
<stl-vector name="ammunition">
<pointer type-name='squad_ammo_spec'/>
</stl-vector>
<stl-vector name="unk_108"/>
<stl-vector name="unk_118"/>
<stl-vector name="ammo_items">
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name="ammo_units">
<int32_t ref-target='unit'/>
</stl-vector>
<int16_t name="carry_food"/>
<int16_t name="carry_water"/>
</struct-type>
<struct-type type-name='entity_uniform' key-field='id'>
<int32_t name="id"/>
<int16_t name="unk_4"/>
<code-helper name='describe'>
(describe-obj $.name)
</code-helper>
<static-array name='uniform_item_types' count='7' index-enum='uniform_category'>
<stl-vector>
<enum base-type='int16_t' type-name='item_type'/>
</stl-vector>
</static-array>
<static-array name='uniform_item_subtypes' count='7' index-enum='uniform_category'>
<stl-vector>
<int16_t refers-to='(item-subtype-target $$._parent._parent._parent.uniform_item_types[$$._parent._key][$$._key] $)'/>
</stl-vector>
</static-array>
<static-array name='uniform_item_info' count='7' index-enum='uniform_category'>
<stl-vector name="unk_e8">
<pointer>
<int16_t name="unk_0"/>
<int16_t name="color"/>
<int32_t name="unk_4"/>
<int32_t name="unk_8"/>
<int32_t name="unk_c"/>
<int32_t name="indiv_choice"/>
<int16_t name="mattype" ref-target='material' aux-value='$$.matindex'/>
<int32_t name="matindex"/>
<int16_t name="material_class"/>
</pointer>
</stl-vector>
</static-array>
<stl-string name="name"/>
<compound name='flags' type-name='uniform_flags'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,62 @@
<data-definition>
<struct-type type-name='proj_list_link'>
<pointer name='item' type-name='projectile'/>
<pointer name='prev' type-name='proj_list_link'/>
<pointer name='next' type-name='proj_list_link'/>
</struct-type>
<class-type type-name='projectile' original-name='projst' key-field='id'>
<pointer name='link' type-name='proj_list_link'/>
<int32_t name='id'/>
<pointer name='firer' type-name='unit'/>
<int16_t name='origin_x'/>
<int16_t name='origin_y'/>
<int16_t name='origin_z'/>
<int16_t name='target_x'/>
<int16_t name='target_y'/>
<int16_t name='target_z'/>
<int16_t name='cur_x'/>
<int16_t name='cur_y'/>
<int16_t name='cur_z'/>
<int16_t name='prev_x'/>
<int16_t name='prev_y'/>
<int16_t name='prev_z'/>
<int32_t name='distance_flown'/>
<int32_t name='unk14'/>
<int32_t name='unk15'/>
<int32_t name='unk16'/>
<bool name='collided' comment='or falling?'/>
<int16_t name='fall_counter' comment='counts down from delay to 0, then it moves'/>
<int16_t name='fall_delay'/>
<int32_t name='unk20'/>
<int32_t name='unk21'/>
<int32_t name='unk22'/>
<int32_t name='unk23'/>
</class-type>
<class-type type-name='proj_itemst' inherits-from='projectile'>
<pointer name='item' type-name='item'/>
</class-type>
<class-type type-name='proj_unitst' inherits-from='projectile'>
<pointer name='unit' type-name='unit' comment='?'/>
</class-type>
<class-type type-name='proj_magicst' inherits-from='projectile'>
<pointer name='unk' comment='?'/>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,237 @@
<data-definition>
<struct-type type-name='world_raws'>
-- Materials
<stl-vector name='material_templates'>
<pointer type-name='material_template'/>
</stl-vector>
-- Inorganic
<stl-vector name='inorganics'>
<pointer type-name='material_inorganic'/>
</stl-vector>
<stl-vector name='inorganics_subset'>
<pointer type-name='material_inorganic'/>
</stl-vector>
-- Plants
<compound name='plants'>
dtor 852cc20
<stl-vector name='all'>
<pointer type-name='material_plant'/>
</stl-vector>
<stl-vector name='bushes'>
<pointer type-name='material_plant'/>
</stl-vector>
<stl-vector name='bushes_idx' index-refers-to='$$._parent.bushes[$]'>
<int32_t ref-target='material_plant'/>
</stl-vector>
<stl-vector name='trees'>
<pointer type-name='material_plant'/>
</stl-vector>
<stl-vector name='trees_idx' index-refers-to='$$._parent.trees[$]'>
<int32_t ref-target='material_plant'/>
</stl-vector>
<stl-vector name='grasses'>
<pointer type-name='material_plant'/>
</stl-vector>
<stl-vector name='grasses_idx' index-refers-to='$$._parent.grasses[$]'>
<int32_t ref-target='material_plant'/>
</stl-vector>
</compound>
-- Creature RAWs
<stl-vector name='tissue_templates' type-name='pointer'/>
dtor 89bab50
<stl-vector name='misc_templates' type-name='pointer'/>
dtor 8527e40
<stl-vector name='body_templates' type-name='pointer'/>
<stl-vector name='part_name_pairs'>
<pointer key-field='id'>
<stl-string name='id'/>
<stl-string name='human_singular'/>
<stl-string name='animal_singular'/>
<stl-string name='human_plural'/>
<stl-string name='animal_plural'/>
</pointer>
</stl-vector>
dtor 89ba980
<stl-vector name='mutant_templates' type-name='pointer'/>
-- Creatures
<compound name='creatures'>
dtor 81448c0
<stl-vector name='alphabetic'>
<pointer type-name='creature_raw'/>
</stl-vector>
<stl-vector name='all'>
<pointer type-name='creature_raw'/>
</stl-vector>
<int32_t name='unk1'/>
<stl-vector name='list_creature' type-name='int32_t'
comment='Together with list_caste, a list of all caste indexes in order.'/>
<stl-vector name='list_caste' type-name='int32_t'/>
</compound>
-- Item RAWs
<compound name='itemdefs'>
dtor 852e080
<stl-vector name='all'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='weapons'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='trapcomps'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='toys'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='tools'>
<pointer type-name='itemdef'/>
</stl-vector>
<static-array name='tools_by_type' count='14'>
<stl-vector>
<pointer type-name='itemdef'/>
</stl-vector>
</static-array>
<stl-vector name='instruments'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='armor'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='ammo'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='siege_ammo'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='gloves'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='shoes'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='shields'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='helms'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='pants'>
<pointer type-name='itemdef'/>
</stl-vector>
<stl-vector name='food'>
<pointer type-name='itemdef'/>
</stl-vector>
</compound>
-- Sapient species
<stl-vector name='species'>
<pointer/>
</stl-vector>
-- Language RAWs
dtor 852bc90
<stl-vector name='language_words'>
<pointer type-name='language_word'/>
</stl-vector>
<stl-vector name='language_symbols'>
<pointer type-name='language_symbol'/>
</stl-vector>
<stl-vector name='translations'>
<pointer type-name='language_translation'/>
</stl-vector>
<static-array name='unknown_54c88' count='2'>
<static-array count='58'>
<static-array count='12'>
<stl-vector type-name='int32_t'/>
</static-array>
</static-array>
</static-array>
-- Words
<stl-vector name='color_words'>
<pointer key-field='id'>
<stl-string name="id"/>
<stl-vector name="unk_1c"/>
<stl-vector name="unk_2c"/>
<stl-string name="name"/>
<int16_t name="unk_58"/>
<s-float name="unk_5c"/>
<s-float name="unk_60"/>
<s-float name="unk_64"/>
</pointer>
</stl-vector>
<stl-vector name='shape_words'>
<pointer key-field='id'>
<stl-string name="id"/>
<stl-vector name="unk_1c"/>
<stl-vector name="unk_2c"/>
<stl-string name="name"/>
<stl-string name="name_plural"/>
<stl-vector name="unk_74"/>
<int8_t name="unk_84"/>
</pointer>
</stl-vector>
<stl-vector name='all_color_words' type-name='pointer'/>
-- Reaction RAWs
<stl-vector name='reactions'>
<pointer/>
</stl-vector>
-- Workshops
<compound name='buildings'>
<stl-vector name='all'>
<pointer type-name='building_def'/>
</stl-vector>
<stl-vector name='workshops'>
<pointer type-name='building_def'/>
</stl-vector>
<stl-vector name='furnaces'>
<pointer type-name='building_def'/>
</stl-vector>
<int32_t name='unk3'/>
</compound>
-- Material index
<compound name='mat_table' type-name='special_mat_table'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,109 @@
<data-definition>
<class-type type-name='general_ref' original-name='general_refst'/>
<class-type type-name='general_ref_artifact' inherits-from='general_ref'
original-name='general_ref_artifactst'>
<int32_t name='artifact_id' ref-target='artifact_record'/>
</class-type>
<class-type type-name='general_ref_nemesis' inherits-from='general_ref'
original-name='general_ref_nemesisst'>
<int32_t name='nemesis_id' ref-target='nemesis_record'/>
</class-type>
<class-type type-name='general_ref_item' inherits-from='general_ref'
original-name='general_ref_itemst'>
<int32_t name='item_id' ref-target='item'/>
</class-type>
<class-type type-name='general_ref_item_type' inherits-from='general_ref'
original-name='general_ref_item_typest'>
<enum base-type='int32_t' name='type' type-name='item_type'/>
<int32_t name='subtype' refers-to='(item-subtype-target $$._parent.type $)'/>
<int16_t name='unk1'/>
<int16_t name='unk2'/>
</class-type>
<class-type type-name='general_ref_coinbatch' inherits-from='general_ref'
original-name='general_ref_coinbatchst'>
<int32_t name='batch'/>
</class-type>
<class-type type-name='general_ref_mapsquare' inherits-from='general_ref'
original-name='general_ref_mapsquarest'>
<int16_t name='unk1'/>
<int16_t name='unk2'/>
<int32_t name='unk3'/>
</class-type>
<class-type type-name='general_ref_projectile' inherits-from='general_ref'
original-name='general_ref_projectilest'>
<int32_t name='projectile_id'/>
</class-type>
<class-type type-name='general_ref_unit' inherits-from='general_ref'
original-name='general_ref_unitst'>
<int32_t name='unit_id' ref-target='unit'/>
</class-type>
<class-type type-name='general_ref_building' inherits-from='general_ref'
original-name='general_ref_buildingst'>
<int32_t name='building_id' ref-target='building'/>
</class-type>
<class-type type-name='general_ref_building_well_tag' inherits-from='general_ref_building'
original-name='general_ref_building_well_tagst'>
<bool name='unk'/>
</class-type>
<class-type type-name='general_ref_entity' inherits-from='general_ref'
original-name='general_ref_entityst'>
<int32_t name='entity_id' ref-target='historical_entity'/>
</class-type>
<class-type type-name='general_ref_entity_art_image' inherits-from='general_ref'
original-name='general_ref_entity_art_imagest'>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
</class-type>
<class-type type-name='general_ref_is_artifactst' inherits-from='general_ref_artifact'/>
<class-type type-name='general_ref_is_nemesisst' inherits-from='general_ref_nemesis'/>
<class-type type-name='general_ref_contains_unitst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_contains_itemst' inherits-from='general_ref_item'/>
<class-type type-name='general_ref_contained_in_itemst' inherits-from='general_ref_item'/>
<class-type type-name='general_ref_unit_milkeest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_traineest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_itemownerst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_tradebringerst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_holderst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_workerst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_cageest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_beateest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_foodreceiverst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_kidnapeest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_patientst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_infantst' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_slaughtereest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_unit_sheareest' inherits-from='general_ref_unit'/>
<class-type type-name='general_ref_building_civzone_assignedst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_triggerst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_triggertargetst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_chainst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_cagedst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_holderst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_use_target_1st' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_use_target_2st' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_destinationst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_building_nest_boxst' inherits-from='general_ref_building'/>
<class-type type-name='general_ref_entity_stolenst' inherits-from='general_ref_entity'/>
<class-type type-name='general_ref_entity_offeredst' inherits-from='general_ref_entity'/>
<class-type type-name='general_ref_entity_itemownerst' inherits-from='general_ref_entity'/>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,254 @@
<data-definition>
<struct-type type-name='stockpile_settings_food'>
<stl-vector type-name='bool' name='meat'
index-refers-to='(food-mat-by-idx $Meat $)'/>
<stl-vector type-name='bool' name='fish'
index-refers-to='(food-mat-by-idx $Fish $)'/>
<stl-vector type-name='bool' name='unprepared_fish'
index-refers-to='(food-mat-by-idx $UnpreparedFish $)'/>
<stl-vector type-name='bool' name='egg'
index-refers-to='(food-mat-by-idx $Eggs $)'/>
<stl-vector type-name='bool' name='plants'
index-refers-to='(food-mat-by-idx $Plants $)'/>
<stl-vector type-name='bool' name='drink_plant'
index-refers-to='(food-mat-by-idx $PlantDrink $)'/>
<stl-vector type-name='bool' name='drink_animal'
index-refers-to='(food-mat-by-idx $CreatureDrink $)'/>
<stl-vector type-name='bool' name='cheese_plant'
index-refers-to='(food-mat-by-idx $PlantCheese $)'/>
<stl-vector type-name='bool' name='cheese_animal'
index-refers-to='(food-mat-by-idx $CreatureCheese $)'/> also 26
<stl-vector type-name='bool' name='seeds'
index-refers-to='(food-mat-by-idx $Seed $)'/> also 31
<stl-vector type-name='bool' name='leaves'
index-refers-to='(food-mat-by-idx $Leaf $)'/> also 32
<stl-vector type-name='bool' name='powder_plant'
index-refers-to='(food-mat-by-idx $PlantPowder $)'/>
<stl-vector type-name='bool' name='powder_creature'
index-refers-to='(food-mat-by-idx $CreaturePowder $)'/>
<stl-vector type-name='bool' name='glob'
index-refers-to='(food-mat-by-idx $Glob $)'/>
<stl-vector type-name='bool' name='glob_paste'
index-refers-to='(food-mat-by-idx $Paste $)'/>
<stl-vector type-name='bool' name='glob_pressed'
index-refers-to='(food-mat-by-idx $Pressed $)'/>
<stl-vector type-name='bool' name='liquid_plant'
index-refers-to='(food-mat-by-idx $PlantLiquid $)'/>
<stl-vector type-name='bool' name='liquid_animal'
index-refers-to='(food-mat-by-idx $CreatureLiquid $)'/>
<stl-vector type-name='bool' name='liquid_misc'
index-refers-to='(food-mat-by-idx $MiscLiquid $)'/>
</struct-type>
<struct-type type-name='stockpile_settings_refuse'>
<stl-vector type-name='bool' name='type' index-enum='item_type'/>
<stl-vector type-name='bool' name='corpses'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='body_parts'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='skulls'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='bones'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='hair'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='shells'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='teeth'
index-refers-to='(find-creature $)'/>
<stl-vector type-name='bool' name='horns'
index-refers-to='(find-creature $)'/>
</struct-type>
<enum-type type-name='stockpile_category'>
<enum-item name='Animals'/>
<enum-item name='Food'/>
<enum-item name='Furniture'/>
<enum-item name='Corpses'/>
<enum-item name='Refuse'/>
<enum-item name='Stone'/>
<enum-item name='Unused6'/>
<enum-item name='Ammo'/>
<enum-item name='Coins'/>
<enum-item name='Bars'/>
<enum-item name='Gems'/>
<enum-item name='Goods'/>
<enum-item name='Leather'/>
<enum-item name='Cloth'/>
<enum-item name='Wood'/>
<enum-item name='Weapons'/>
<enum-item name='Armor'/>
<enum-item name='Custom'/>
</enum-type>
<struct-type type-name='stockpile_settings'>
<bitfield name='flags' base-type='uint32_t'>
<flag-bit name='animals'/>
<flag-bit name='food'/>
<flag-bit name='furniture'/>
<flag-bit name='corpses'/>
<flag-bit name='refuse'/>
<flag-bit name='stone'/>
<flag-bit name='ammo'/>
<flag-bit name='coins'/>
<flag-bit name='bars'/>
<flag-bit name='gems'/>
<flag-bit name='goods'/>
<flag-bit name='leather'/>
<flag-bit name='cloth'/>
<flag-bit name='wood'/>
<flag-bit name='weapons'/>
<flag-bit name='armor'/>
</bitfield>
<compound name='animals'>
<bool name='animals_empty_cages'/>
<bool name='animals_empty_traps'/>
<stl-vector type-name='bool' name='enabled'
index-refers-to='(find-creature $)'/>
</compound>
<compound name='food'>
<compound type-name='stockpile_settings_food' name='type'/>
<bool name='prepared_meals'/>
</compound>
<compound name='furniture'>
<stl-vector type-name='bool' name='type' index-enum='item_type'/>
<stl-vector type-name='bool' name='other_mats'/> 16
<stl-vector type-name='bool' name='mats'
index-refers-to='(material-by-id 0 $)'/>
<static-array type-name='bool' name='quality_core' count='7' index-enum='item_quality'/>
<static-array type-name='bool' name='quality_total' count='7' index-enum='item_quality'/>
<bool name='sand_bags'/>
</compound>
<int32_t name='unk1'/>
<compound name='refuse'>
<compound type-name='stockpile_settings_refuse' name='type'/>
<bool name='fresh_raw_hide'/>
<bool name='rotten_raw_hide'/>
</compound>
<stl-vector type-name='bool' name='stone'
index-refers-to='(material-by-id 0 $)'/>
<stl-vector type-name='bool' name='unk2'/>
<compound name='ammo'>
<stl-vector type-name='bool' name='type'
index-refers-to='$global.world.raws.itemdefs.ammo[$]'/>
<stl-vector type-name='bool' name='other_mats'/> 2
<stl-vector type-name='bool' name='mats'
index-refers-to='(material-by-id 0 $)'/>
<static-array type-name='bool' name='quality_core' count='7' index-enum='item_quality'/>
<static-array type-name='bool' name='quality_total' count='7' index-enum='item_quality'/>
</compound>
<stl-vector type-name='bool' name='coins'
index-refers-to='(material-by-id 0 $)'/>
<stl-vector type-name='bool' name='bars_other_mats'/> 5
<stl-vector type-name='bool' name='blocks_other_mats'/> 5
<stl-vector type-name='bool' name='bars_mats'
index-refers-to='(material-by-id 0 $)'/>
<stl-vector type-name='bool' name='blocks_mats'
index-refers-to='(material-by-id 0 $)'/>
<compound name='gems'>
<stl-vector type-name='bool' name='rough_other_mats'
index-refers-to='(material-by-id $ -1)'/> 659
<stl-vector type-name='bool' name='cut_other_mats'
index-refers-to='(material-by-id $ -1)'/>
<stl-vector type-name='bool' name='rough_mats'
index-refers-to='(material-by-id 0 $)'/>
<stl-vector type-name='bool' name='cut_mats'
index-refers-to='(material-by-id 0 $)'/>
</compound>
<compound name='finished_goods'>
<stl-vector type-name='bool' name='type' index-enum='item_type'/>
<stl-vector type-name='bool' name='other_mats'/> 17
<stl-vector type-name='bool' name='mats'
index-refers-to='(material-by-id 0 $)'/>
<static-array type-name='bool' name='quality_core' count='7' index-enum='item_quality'/>
<static-array type-name='bool' name='quality_total' count='7' index-enum='item_quality'/>
</compound>
<stl-vector type-name='bool' name='leather'
index-refers-to='(food-mat-by-idx $Leather $)'/>
<compound name='cloth'>
<stl-vector type-name='bool' name='thread_silk'
index-refers-to='(food-mat-by-idx $Silk $)'/>
<stl-vector type-name='bool' name='thread_plant'
index-refers-to='(food-mat-by-idx $PlantFiber $)'/>
<stl-vector type-name='bool' name='thread_yarn'
index-refers-to='(food-mat-by-idx $Yarn $)'/>
<stl-vector type-name='bool' name='thread_metal'
index-refers-to='(food-mat-by-idx $MetalThread $)'/>
<stl-vector type-name='bool' name='cloth_silk'
index-refers-to='(food-mat-by-idx $Silk $)'/>
<stl-vector type-name='bool' name='cloth_plant'
index-refers-to='(food-mat-by-idx $PlantFiber $)'/>
<stl-vector type-name='bool' name='cloth_yarn'
index-refers-to='(food-mat-by-idx $Yarn $)'/>
<stl-vector type-name='bool' name='cloth_metal'
index-refers-to='(food-mat-by-idx $MetalThread $)'/>
</compound>
<stl-vector type-name='bool' name='wood'
index-refers-to='(find-plant-raw $)'/>
<compound name='weapons'>
<stl-vector type-name='bool' name='weapon_type'
index-refers-to='$global.world.raws.itemdefs.weapons[$]'/>
<stl-vector type-name='bool' name='trapcomp_type'
index-refers-to='$global.world.raws.itemdefs.trapcomps[$]'/>
<stl-vector type-name='bool' name='other_mats'/> 11
<stl-vector type-name='bool' name='mats'
index-refers-to='(material-by-id 0 $)'/>
<static-array type-name='bool' name='quality_core' count='7' index-enum='item_quality'/>
<static-array type-name='bool' name='quality_total' count='7' index-enum='item_quality'/>
<bool name='usable'/>
<bool name='unusable'/>
</compound>
<compound name='armor'>
<stl-vector type-name='bool' name='body'
index-refers-to='$global.world.raws.itemdefs.armor[$]'/>
<stl-vector type-name='bool' name='head'
index-refers-to='$global.world.raws.itemdefs.helms[$]'/>
<stl-vector type-name='bool' name='feet'
index-refers-to='$global.world.raws.itemdefs.shoes[$]'/>
<stl-vector type-name='bool' name='hands'
index-refers-to='$global.world.raws.itemdefs.gloves[$]'/>
<stl-vector type-name='bool' name='legs'
index-refers-to='$global.world.raws.itemdefs.pants[$]'/>
<stl-vector type-name='bool' name='shield'
index-refers-to='$global.world.raws.itemdefs.shields[$]'/>
<stl-vector type-name='bool' name='other_mats'/> 11
<stl-vector type-name='bool' name='mats'
index-refers-to='(material-by-id 0 $)'/>
<static-array type-name='bool' name='quality_core' count='7' index-enum='item_quality'/>
<static-array type-name='bool' name='quality_total' count='7' index-enum='item_quality'/>
<bool name='usable'/>
<bool name='unusable'/>
</compound>
<bool name='allow_organic'/>
<bool name='allow_inorganic'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,604 @@
<data-definition>
<struct-type type-name='dipscript_info' key-field='code'>
<int32_t name='unk1' comment='uninit'/>
<stl-string name='script_file' comment='data/dipscript/dwarf_liaison'/>
<stl-vector name='script_steps' type-name='pointer'/>
<stl-vector name='unknown' comment='null'/>
<stl-string name='code' comment='DWARF_LIAISON etc'/>
</struct-type>
<struct-type type-name='burrow' key-field='id'>
<int32_t name='id'/>
<stl-string name='name'/>
<code-helper name='find-instance'>(find-by-id $global.ui.burrows.list $id $)</code-helper>
<code-helper name='describe'>
(describe-obj $.name)
</code-helper>
<uint8_t name='tile'/>
<int16_t name='fg_color'/>
<int16_t name='bg_color'/>
<stl-vector name='unk1' type-name='int32_t'/>
<stl-vector name='unk2' type-name='int32_t'/>
<stl-vector name='unk3' type-name='int32_t'/>
<stl-vector name='units'>
<int32_t ref-target='unit'/>
</stl-vector>
</struct-type>
<enum-type type-name='ui_sidebar_mode'>
<enum-item name='Default'/>
<enum-item name='Squads'/>
-- 2
<enum-item name='DesignateMine'/>
<enum-item name='DesignateRemoveRamps'/>
<enum-item name='DesignateUpStair'/>
<enum-item name='DesignateDownStair'/>
<enum-item name='DesignateUpDownStair'/>
<enum-item name='DesignateUpRamp'/>
<enum-item name='DesignateChannel'/>
<enum-item name='DesignateGatherPlants'/>
<enum-item name='DesignateRemoveDesignation'/>
<enum-item name='DesignateSmooth'/>
<enum-item name='DesignateEngrave'/>
<enum-item name='DesignateCarveFortification'/>
-- 14
<enum-item name='Stockpiles'/>
<enum-item name='Build'/>
<enum-item name='QueryBuilding'/>
-- 17
<enum-item name='Orders'/>
<enum-item name='OrdersForbid'/>
<enum-item name='OrdersRefuse'/>
<enum-item name='OrdersWorkshop'/>
<enum-item name='OrdersZone'/>
-- 22
<enum-item name='BuildingItems'/>
<enum-item name='ViewUnits'/>
<enum-item name='LookAround'/>
-- 25
<enum-item name='DesignateItemsClaim'/>
<enum-item name='DesignateItemsForbid'/>
<enum-item name='DesignateItemsMelt'/>
<enum-item name='DesignateItemsUnmelt'/>
<enum-item name='DesignateItemsDump'/>
<enum-item name='DesignateItemsUndump'/>
<enum-item name='DesignateItemsHide'/>
<enum-item name='DesignateItemsUnhide'/>
-- 33
<enum-item name='DesignateChopTrees'/>
<enum-item name='DesignateToggleEngravings'/>
-- 35
<enum-item name='Hotkeys'/>
-- 36
<enum-item name='DesignateTrafficHigh'/>
<enum-item name='DesignateTrafficNormal'/>
<enum-item name='DesignateTrafficLow'/>
<enum-item name='DesignateTrafficRestricted'/>
-- 40
<enum-item name='Zones'/>
<enum-item name='ZonesPenInfo'/>
<enum-item name='ZonesPitInfo'/>
<enum-item name='ZonesHospitalInfo'/>
-- 44
<enum-item name='DesignateRemoveConstruction'/>
<enum-item name='DepotAccess'/>
<enum-item name='NotesPoints'/>
<enum-item name='NotesRoutes'/>
<enum-item name='Burrows'/>
</enum-type>
<struct-type type-name='cursor'>
<int32_t name='x'/>
<int32_t name='y'/>
<int32_t name='z'/>
</struct-type>
<struct-type type-name='selection_rect'>
<int32_t name='start_x'/>
<int32_t name='start_y'/>
<int32_t name='start_z'/>
<int32_t name='end_x'
comment='only valid for an instant while its being completed'/>
<int32_t name='end_y'/>
<int32_t name='end_z'/>
</struct-type>
<struct-type type-name='ui'>
ctor 86e33c0 x
dtor 8534190
<padding size='16'/>
<stl-vector name='unk10'/>
<padding size='76'/>
<stl-vector name='unk68' type-name='pointer'/>
<padding size='388'/>
<stl-vector name='currency_value' type-name='int32_t'
index-refers-to='(material-by-id 0 $)'/>
<padding size='812'/>
<stl-vector name='unk530' type-name='int32_t'/>
<padding size='7516'/>
<stl-vector name='unk2298' type-name='bool'
index-refers-to='(find-creature $)'/>
<stl-vector name='unk22a4' type-name='bool'
index-refers-to='(find-creature $)'/>
<stl-vector name='unk22b0' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<stl-vector name='unk22bc' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<padding size='16'/>
<stl-vector name='unk22d8' type-name='int32_t'/>
<padding size='4'/>
<stl-vector name='unk22e8'/>
<stl-vector name='dip_meeting_vec'>
<pointer type-name='meeting_diplomat'/>
</stl-vector>
<stl-vector name='dip_meeting_info'>
<pointer>
<int32_t name='civ_id' ref-target='historical_entity'/>
<int16_t name='unk1'/>
<int32_t name='diplomat_id' ref-target='historical_figure'/>
<int32_t name='unk2' comment='-1'/>
<padding size='32' comment='0'/>
<pointer name='dipscript' type-name='dipscript_info'/>
<padding size='16' comment='0'/>
<stl-string name='unk3'/>
<stl-string name='unk4'/>
<padding size='112' comment='0'/>
</pointer>
</stl-vector>
<stl-vector name='unk230c' comment='really a wild guess'>
<int32_t ref-target='unit'/>
</stl-vector>
<padding size='4'/>
<stl-vector name='invasions' comment='goblins...'>
<pointer>
<int32_t name='id'/>
<int32_t name='civ_id' ref-target='historical_entity'/>
<int32_t name='is_active1' comment='0 unless active'/>
<int32_t name='is_active2'/>
<int32_t name='size' comment='just a guess'/>
<int32_t name='duration_counter'/>
<int16_t name='unk4a'/>
<int16_t name='unk4b'/>
</pointer>
</stl-vector>
<int32_t name='next_invasion_id'/>
<stl-vector name='crimes'>
<pointer>
<enum name='mode' base-type='int16_t'>
<enum-item name='ProductionOrderViolation'/>
<enum-item name='ExportViolation'/>
<enum-item name='JobOrderViolation'/>
<enum-item name='ConspiracyToSlowLabor'/>
<enum-item name='Murder'/>
<enum-item name='DisorderlyBehavior'/>
<enum-item name='BuildingDestruction'/>
<enum-item name='Vandalism'/>
</enum>
<int16_t name='unk2' comment='uninit'/>
<int16_t name='unk3'/>
<int16_t name='unk4'/>
<int32_t name='unk5'/>
<pointer name='criminal' type-name='unit'/>
<pointer name='victim' type-name='unit'/>
<int32_t name='punishment_assigned'/>
</pointer>
</stl-vector>
<stl-vector name='punishments'>
<pointer>
<pointer name="criminal" type-name='unit'/>
<pointer name="officer" type-name='unit'/>
<int16_t name="beating"/>
<int16_t name="hammer_strikes"/>
<int32_t name="prison_counter"/>
<int16_t name="unk_10" comment='10080'/>
<pointer name="chain" type-name='building'/>
<stl-vector name="victims">
<pointer type-name="unit"/>
</stl-vector>
</pointer>
</stl-vector>
<stl-vector name='pet_meeting_vec'>
<pointer type-name='meeting_pet'/>
</stl-vector>
<stl-vector name='unk2350' type-name='pointer'/>
<stl-vector name='unk235c' type-name='pointer'/>
<stl-vector name='dipscripts'>
<pointer type-name='dipscript_info'/>
</stl-vector>
<stl-vector name='unk2374' type-name='pointer'/>
<compound name='kitchen'>
<stl-vector name='item_types' type-name='int16_t'/>
<stl-vector name='item_subtypes' type-name='int16_t'/>
<stl-vector name='mat_types'>
<int16_t ref-target='material' aux-value='$$._parent.mat_indices[$._key]'/>
</stl-vector>
<stl-vector name='mat_indices' type-name='int32_t'/>
<stl-vector name='exc_types' type-name='int8_t'/>
</compound>
<stl-vector name='economic_stone' type-name='bool'
index-refers-to='(material-by-id 0 $)'/>
<padding size='4'/>
<int16_t name='unk23cc'/>
<int16_t name='unk23ce'/>
<int32_t name='unk23d0'/>
<int32_t name='unk23d4'/>
<int32_t name='group_id' ref-target='historical_entity'/>
<int32_t name='race_id' ref-target='creature_raw'/>
<stl-vector name='unk23e0' type-name='int16_t'/>
<stl-vector name='unk23ec' type-name='int8_t'/>
<static-array name='unk23f8' count='2'>
<static-array count='30'>
<stl-vector type-name='int32_t'/>
</static-array>
</static-array>
<compound name='stockpile'>
<int32_t name='reserved_bins'/>
<int32_t name='reserved_barrels'/>
<compound name='custom_settings' type-name='stockpile_settings'/>
</compound>
<static-array name='unk2a8c' count='4'>
<static-array count='768'>
<int16_t name='unk1'/>
<int16_t name='unk2'/>
</static-array>
</static-array>
<stl-vector name='unk5a8c' type-name='int16_t'/>
<stl-vector name='unk5a98' type-name='int16_t'/>
<stl-vector name='unk5aa4' type-name='int16_t'/>
<static-array name='unk5ab0' count='5'>
<stl-vector type-name='int16_t'/>
</static-array>
<stl-vector name='unk5aec' type-name='int16_t'/>
<static-array name='unk5af8' count='5'>
<stl-vector type-name='int16_t'/>
</static-array>
<stl-vector name='unk5b34' type-name='int16_t'/>
<static-array name='unk5b40' count='5'>
<stl-vector type-name='int16_t'/>
</static-array>
<stl-vector name='unk5b7c' type-name='int16_t'/>
<static-array name='unk5b88' count='7'>
<stl-vector/>
</static-array>
<compound name='waypoints'>
<stl-vector name='points'>
<pointer key-field='name'>
<int32_t name='id'/>
<uint8_t name='tile'/>
<int16_t name='fg_color'/>
<int16_t name='bg_color'/>
<stl-string name='name'/>
<stl-string name='comment'/>
<int16_t name='x'/>
<int16_t name='y'/>
<int16_t name='z'/>
</pointer>
</stl-vector>
<stl-vector name='routes'>
<pointer key-field='name'>
<int32_t name='id'/>
<stl-string name='name'/>
<stl-vector name='points'>
<int32_t/>
</stl-vector>
</pointer>
</stl-vector>
<int16_t name='sym_selector'/>
<int16_t/>
<int32_t name='cur_point_index'/>
<bool name='in_edit_name_mode'/>
<int8_t/>
<uint8_t name='sym_tile'/>
<int16_t name='sym_fg_color'/>
<int16_t name='sym_bg_color'/>
<stl-vector name='unk5c04'>
<pointer type-name='stl-string'/>
</stl-vector>
<int32_t name='next_point_id'/>
<int32_t name='next_route_id'/>
<int32_t name='sel_route_idx'/>
<int32_t name='sel_route_waypt_idx'/>
<bool name='in_edit_waypts_mode'/>
</compound>
<compound name='burrows'>
<stl-vector name='list'>
<pointer type-name='burrow'/>
</stl-vector>
<int32_t name='next_id'/>
<int32_t name='sel_index1'/>
<int32_t name='sel_index2'/>
<bool name='in_add_units_mode'/>
<stl-vector name='list_units'>
<pointer type-name='unit'/>
</stl-vector>
<stl-bit-vector name='sel_units' index-refers-to='$$._parent.list_units[$]'/>
<int32_t name='unit_cursor_pos'/>
<bool name='in_define_mode'/>
<int16_t name='rect_start_x'/>
<int16_t name='rect_start_y'/>
<int16_t name='rect_start_z'/>
<int32_t name='brush_mode'/>
<int16_t name='sym_selector'/>
<int16_t name='sym_tile'/>
<int16_t name='sym_fg_color'/>
<int16_t name='sym_bg_color'/>
</compound>
<compound name='alerts'>
<stl-vector name='list'>
<pointer key-field='name'>
<int32_t name='id'/>
<stl-string name='name'/>
<stl-vector/>
</pointer>
</stl-vector>
<int32_t name='next_id'/>
<int32_t name='civ_alert_idx' refers-to='$$._parent.list[$]'/>
</compound>
<compound name='equipment'>
<static-array name='items_by_type1' count='112' index-enum='item_type'>
<stl-vector>
<pointer type-name='item'/>
</stl-vector>
</static-array>
<static-array name='items_unassigned' count='112' index-enum='item_type'>
<stl-vector>
<pointer type-name='item'/>
</stl-vector>
</static-array>
<static-array name='items_assigned' count='112' index-enum='item_type'>
<stl-vector>
<pointer type-name='item'/>
</stl-vector>
</static-array>
<int32_t name='unk6c4c'/>
<stl-vector name='work_weapons' comment='i.e. woodcutter axes, and miner picks'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='work_units'>
<int32_t ref-target='unit'/>
</stl-vector>
<stl-vector name='hunter_ammunition'>
<pointer type-name='squad_ammo_spec'/>
</stl-vector>
<stl-vector name='unk6c74'/>
<stl-vector name='unk6c80'/>
</compound>
<compound name='main'>
<static-array name='hotkeys' count='16'>
<stl-string name='name'/>
<int16_t name='cmd'/>
<int32_t name='x'/>
<int32_t name='y'/>
<int32_t name='z'/>
</static-array>
<int32_t name='traffic_cost_high'/>
<int32_t name='traffic_cost_normal'/>
<int32_t name='traffic_cost_low'/>
<int32_t name='traffic_cost_restricted'/>
<stl-vector name='unk6ddc'>
<pointer>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
<int32_t name='unk3'/>
<int32_t name='unk4'/>
<int32_t name='unk5'/>
<int16_t name='unk6'/>
<int32_t name='unk7'/>
</pointer>
</stl-vector>
<pointer name='unk6de8' type-name='historical_entity'/>
<enum base-type='int32_t' name='mode' type-name='ui_sidebar_mode'/>
<int32_t name='selected_traffic_cost'
comment='For changing the above costs.'/>
<int32_t name='unk6df4'/>
<int16_t name='selected_hotkey'/>
<bool name='in_rename_hotkey'/>
</compound>
<compound name='squads'>
<stl-vector name='list' has-bad-pointers='true'
comment='valid only when ui is displayed'>
<pointer type-name='squad'/>
</stl-vector>
<stl-vector name='unk6e08'/>
<stl-bit-vector name='sel_squads' index-refers-to='$$._parent.list[$]'/>
<stl-vector name='indiv_selected'>
<int32_t ref-target='historical_figure'/>
</stl-vector>
<bool name='in_select_indiv'/>
<int32_t name='sel_indiv_squad' refers-to='$$._parent.list[$]'/>
<padding size='8'/>
<int32_t name='unk48'/>
<pointer name='unk4c' type-name='squad'/>
<bool name='in_move_order'/>
<int32_t name='point_list_scroll'/>
<bool name='in_kill_order'/>
<stl-vector name='kill_rect_targets'>
<pointer type-name='unit'/>
</stl-vector>
<padding size='4'/>
<bool name='in_kill_list'/>
<stl-vector name='kill_targets'>
<pointer type-name='unit'/>
</stl-vector>
<stl-bit-vector name='sel_kill_targets' index-refers-to='$$._parent.kill_target[$]'/>
<padding size='4'/>
<bool name='in_kill_rect'/>
<int16_t name='rect_start_x'/>
<int16_t name='rect_start_y'/>
<int16_t name='rect_start_z'/>
</compound>
<padding size='4'/>
</struct-type>
<struct-type type-name='build_item_selector'>
<stl-vector name='requirement'>
<pointer>
<enum base-type='int16_t' name="item_type" type-name='item_type'/>
<int16_t name="unk_2"/>
<int16_t name="unk_4"/>
<int32_t name="unk_8"/>
<int32_t name="unk_c"/>
<pointer name="item_vector">
<stl-vector>
<pointer type-name='item'/>
</stl-vector>
</pointer>
<int8_t name="unk_14"/>
<int32_t name="unk_18"/>
<int8_t name="unk_1c"/>
<int32_t name="unk_20"/>
<int8_t name="unk_24"/>
<int32_t name="unk_28"/>
<int8_t name="unk_2c"/>
<int32_t name="unk_30"/>
<int8_t name="unk_34"/>
<stl-string name='unk38'/>
<stl-string name='unk3c'/>
<int32_t name="unk_40"/>
<int16_t name="unk_44"/>
<int8_t name="unk_46"/>
<int32_t name="unk_48"/>
<int32_t name="unk_4c"/>
<stl-vector name='unk50'/>
<int8_t name="unk_5c"/>
<int16_t name="unk_5e"/>
<int16_t name="unk_60"/>
<int16_t name="unk_62"/>
<int16_t name="unk_64"/>
<int32_t name="unk_68"/>
<int32_t name="unk_6c"/>
<int32_t name="unk_70"/>
<int32_t name="unk_74"/>
<stl-vector name='unk78'/>
<int8_t name="unk_84"/>
<stl-vector name='candidates'>
<pointer type-name='item'/>
</stl-vector>
<stl-vector name='unk_94' type-name='int8_t'/>
<stl-vector name='unk_a0' type-name='int16_t'/>
<stl-vector name='unk_ac' type-name='int8_t'/>
<int32_t name="unk_b8"/>
<int16_t name="unk_bc"/>
</pointer>
</stl-vector>
<stl-vector name='choices' type-name='pointer'/>
<int32_t name="unk_18"/>
<int16_t name="unk_1c"/>
<int16_t name="unk_1e"/>
<int32_t name="unk_20"/>
<int32_t name="unk_24"/>
<int16_t name="unk_28"/>
<int16_t name="sel_index"/>
<int32_t name="unk_2c"/>
<stl-vector name='unk3'>
<pointer type-name='stl-string'/>
</stl-vector>
<stl-vector name='unk4'>
<pointer type-name='stl-string'/>
</stl-vector>
<padding size='3848'/>
<int32_t name='unk5_1'/>
<int32_t name='unk5_2'/>
<int8_t name='unk5_3a'/>
<int8_t name='unk5_3b'/>
<int8_t name='unk5_3c'/>
<int8_t name='unk5_3d'/>
<int32_t name='unk5_4'/>
<stl-vector name='unk6'/>
<stl-vector name='unk7'/>
dtor: 0x85272c0
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,703 @@
<data-definition>
<bitfield-type type-name='unit_flags1' base-type='uint32_t'>
<flag-bit name='move_state'
comment='Can the dwarf move or are they waiting for their movement timer'/>
<flag-bit name='dead'
comment='Dead (might also be set for incoming/leaving critters that are alive)'/>
<flag-bit name='has_mood' comment='Currently in mood'/>
<flag-bit name='had_mood' comment='Had a mood already'/>
<flag-bit name='marauder' comment='wide class of invader/inside creature attackers'/>
<flag-bit name='drowning' comment='Is currently drowning'/>
<flag-bit name='merchant' comment='An active merchant'/>
<flag-bit name='forest'
comment='used for units no longer linked to merchant/diplomacy, they just try to leave mostly'/>
<flag-bit name='left' comment='left the map'/>
<flag-bit name='rider' comment='Is riding an another creature'/>
<flag-bit name='incoming'/>
<flag-bit name='diplomat'/>
<flag-bit name='zombie'/>
<flag-bit name='skeleton'/>
<flag-bit name='can_swap' comment='Can swap tiles during movement (prevents multiple swaps)'/>
<flag-bit name='on_ground' comment='The creature is laying on the floor, can be conscious'/>
<flag-bit name='projectile' comment='Launched into the air? Funny.'/>
<flag-bit name='active_invader' comment='Active invader (for organized ones)'/>
<flag-bit name='hidden_in_ambush'/>
<flag-bit name='invader_origin' comment='Invader origin (could be inactive and fleeing)'/>
<flag-bit name='coward' comment='Will flee if invasion turns around'/>
<flag-bit name='hidden_ambusher' comment='Active marauder/invader moving inward?'/>
<flag-bit name='invades' comment='Marauder resident/invader moving in all the way'/>
<flag-bit name='check_flows' comment='Check against flows next time you get a chance'/>
<flag-bit name='ridden'/>
<flag-bit name='caged'/>
<flag-bit name='tame'/>
<flag-bit name='chained'/>
<flag-bit name='royal_guard'/>
<flag-bit name='fortress_guard'/>
<flag-bit name='suppress_wield'/>
<flag-bit name='important_historical_figure' comment='Is an important historical figure'/>
</bitfield-type>
<bitfield-type type-name='unit_flags2' base-type='uint32_t'>
<flag-bit name='swimming'/>
<flag-bit name='sparring'/>
<flag-bit name='no_notify' comment='Do not notify about level gains (for embark etc)'/>
<flag-bit name='unused'/>
<flag-bit name='calculated_nerves'/>
<flag-bit name='calculated_bodyparts'/>
<flag-bit name='important_historical_figure'
comment='Is important historical figure (slight variation)'/>
<flag-bit name='killed'
comment='Has been killed by kill function (slightly different from dead, not necessarily violent death)'/>
<flag-bit name='cleanup_1' comment='Must be forgotten by forget function (just cleanup)'/>
<flag-bit name='cleanup_2' comment='Must be deleted (cleanup)'/>
<flag-bit name='cleanup_3' comment='Recently forgotten (cleanup)'/>
<flag-bit name='for_trade' comment='Offered for trade'/>
<flag-bit name='trade_resolved'/>
<flag-bit name='has_breaks'/>
<flag-bit name='gutted'/>
<flag-bit name='circulatory_spray'/>
<flag-bit name='locked_in_for_trading'
comment="Locked in for trading (it's a projectile on the other set of flags, might be what the flying was)"/>
<flag-bit name='slaughter' comment='marked for slaughter'/>
<flag-bit name='underworld' comment='Underworld creature'/>
<flag-bit name='resident' comment='Current resident'/>
<flag-bit name='cleanup_4'
comment='Marked for special cleanup as unused load from unit block on disk'/>
<flag-bit name='calculated_insulation' comment='Insulation from clothing calculated'/>
<flag-bit name='visitor_uninvited' comment='Uninvited guest'/>
<flag-bit name='visitor'/>
<flag-bit name='calculated_inventory' comment='Inventory order calculated'/>
<flag-bit name='vision_good' comment='Vision -- have good part'/>
<flag-bit name='vision_damaged' comment='Vision -- have damaged part'/>
<flag-bit name='vision_missing' comment='Vision -- have missing part'/>
<flag-bit name='breathing_good' comment='Breathing -- have good part'/>
<flag-bit name='breathing_problem' comment='Breathing -- having a problem'/>
<flag-bit name='roaming_wilderness_population_source'/>
<flag-bit name='roaming_wilderness_population_source_not_a_map_feature'/>
</bitfield-type>
<bitfield-type type-name='unit_flags3' base-type='uint32_t'>
<flag-bit name='unk0' comment='Is 1 for new and dead creatures, periodicaly set to 0 for non-dead creatures.'/>
<flag-bit name='unk1' comment='Is 1 for new creatures, periodically set to 0 for non-dead creatures.'/>
<flag-bit name='unk2' comment='Is set to 1 every tick for non-dead creatures.'/>
<flag-bit name='unk3' comment='Is periodically set to 0 for non-dead creatures.'/>
<flag-bit name='announce_titan' comment='Announces creature like an FB or titan.'/>
<flag-bit name='unk5'/>
<flag-bit name='unk6'/>
<flag-bit name='unk7'/>
<flag-bit name='unk8' comment='Is set to 1 every tick for non-dead creatures.'/>
<flag-bit name='unk9' comment='Is set to 0 every tick for non-dead creatures.'/>
<flag-bit name='scuttle'>
<comment>
Scuttle creature: causes creature to be killed, leaving a behind
corpse and generating negative thoughts like a real kill.
</comment>
</flag-bit>
<flag-bit name='unk11'/>
<flag-bit name='ghostly'/>
</bitfield-type>
<struct-type type-name='unit' key-field='id'>
<compound type-name='language_name' name='name'/>
<code-helper name='find-instance'>(find-by-id $global.world.units.all $id $)</code-helper>
<code-helper name='describe'>
(describe-obj $.name)
(awhen (find-creature $.race)
(fmt "~:(~A ~A~)" $it.caste[$.caste].caste_id $it.creature_id))
</code-helper>
<stl-string name='custom_profession'/>
<enum base-type='int16_t' name='profession' type-name='profession'/>
<enum base-type='int16_t' name='profession2' type-name='profession'/>
<uint32_t name='race' ref-target='creature_raw'/>
<int16_t name='x'/>
<int16_t name='y'/>
<int16_t name='z'/>
<int16_t name='old_x'>
<comment>
E.g. for a dead miner, holds the place where he
was likely hanging around when he got the command
to mine in an aquifer.
</comment>
</int16_t>
<int16_t name='old_y'/>
<int16_t name='old_z'/>
<compound name='unknown1'>
<uint32_t name='unk_9c'/>
<int16_t name='unk_a0'/>
<padding size='2'/>
<int16_t name='unk_a4a'/>
<int16_t name='unk_a4b'/>
</compound>
<compound name='path'>
<int16_t name='dest_x'/>
<int16_t name='dest_y'/>
<int16_t name='dest_z'/>
<int16_t name='unk_ae' comment='-1 unless dest valid'/>
<stl-vector name='path_x' type-name='int16_t'/>
<stl-vector name='path_y' type-name='int16_t'/>
<stl-vector name='path_z' type-name='int16_t'/>
</compound>
<compound name='flags1' type-name='unit_flags1'/>
<compound name='flags2' type-name='unit_flags2'/>
<compound name='flags3' type-name='unit_flags3'/>
<compound name='unknown2'>
<int8_t name='unk_ec'/>
<int32_t name='unk_f0'/>
<int16_t name='unk_f4'/>
<int16_t name='unused_f6'/>
</compound>
<uint16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<uint8_t name='sex'/>
<int32_t name='id'/>
<int16_t name='unk_100'/>
<int32_t name='unk_104'/>
<int32_t name='civ_id' ref-target='historical_entity'/>
<int32_t name='population_id' ref-target='entity_population'/>
<compound name='unknown3'>
<int32_t name='unk_110'/>
<stl-vector name='unk_114'/>
<stl-vector name='unk_124'/>
<stl-vector name='unk_134'/>
<uint32_t name='unk_144'/>
</compound>
<stl-vector name='meetings'>
<pointer type-name='meeting_ref'/>
</stl-vector>
<stl-vector name='refs'>
<pointer type-name='general_ref'/>
</stl-vector>
<compound name='military'>
<int32_t name='squad_index' ref-target='squad'/>
<int32_t name='squad_position'/>
<int32_t name='unk_170'/>
<int32_t name='draft_timer'/>
<int16_t name='is_military'
comment='if dead, may be military, but not in squad'/>
<stl-vector name='uniform_civilian'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='uniform_military'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='uniform_unk1'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='uniform_unk2'>
<int32_t ref-target='item'/>
</stl-vector>
<int32_t name='pickup_equipment_bit'/>
<stl-vector name='uniform_unk3'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='uniform_alien' comment='for goblins, elves'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='individual_drills'>
<int32_t ref-target='activity_entry'/>
</stl-vector>
</compound>
<compound name='unknown4'>
<int16_t name='unk_1f0_a'/>
<int16_t name='unk_1f0_b'/>
<int16_t name='unk_1f4'/>
<int32_t name='unk_1f8'/>
<int32_t name='unk_1fc'/>
<int32_t name='unk_200'/>
<int16_t name='unk_204'/>
<uint32_t name='animal_leave_countdown'
comment='once 0, it heads for the edge and leaves'/>
<uint32_t name='unk_20c'/>
</compound>
<int16_t name='mood'/>
<int16_t name='unk_18e'/>
<compound name='relations'>
<uint32_t name='pregnancy_timer'/>
<pointer name='pregnancy_ptr'/>
<int16_t name='unk_21c_a'/>
<int16_t name='unk_21c_b'/>
<uint32_t name='unk_220'/>
<int32_t name='birth_year'/>
<int32_t name='birth_time'/>
<int32_t name='old_year' comment='could there be a death of old age time??'/>
<int32_t name='old_time'/>
<pointer type-name='unit' name='following'/>
<uint16_t name='unk_238'/>
<int32_t name='pet_owner_id' ref-target='unit'/>
<int32_t name='married_id' ref-target='unit'
comment='not used in relationship screen..'/>
<int32_t name='mother_id' ref-target='unit'/>
<int32_t name='father_id' ref-target='unit'/>
<int32_t name='last_attacker_id' ref-target='unit'/>
<int32_t name='enemy_group_leader_id' ref-target='unit'/>
<int32_t name='unk_254'/>
<int32_t name='unk_258'/>
<int32_t name='unk_25c_mother'/>
<int32_t name='lover_id' ref-target='unit'/>
<int16_t name='unk_264'/>
</compound>
<compound name='last_hit'>
<int32_t name='item' ref-target='item'/>
<enum base-type='int16_t' name='item_type' type-name='item_type'/>
<int16_t name='item_subtype' refers-to='(item-subtype-target $$._parent.item_type $)'/>
<int16_t name='mattype' ref-target='material' aux-value='$$.matindex'/>
<int32_t name='matindex'/>
-- If shot by a ranged weapon:
<int32_t name='bow_item' ref-target='item'/>
<enum base-type='int16_t' name='bow_item_type' type-name='item_type'/>
<int16_t name='bow_item_subtype' refers-to='(item-subtype-target $$._parent.bow_item_type $)'/>
<int16_t name='bow_mattype' ref-target='material' aux-value='$$.bow_matindex'/>
<int32_t name='bow_matindex'/>
</compound>
<stl-vector name='inventory'>
<pointer key-field='item'>
<pointer name='item' type-name='item'/>
<int16_t name='mode' comment='0 carried, 1 weapon, 2 worn, 9 sewn'/>
<int16_t name='body_part_id'/>
</pointer>
</stl-vector>
<stl-vector name='owned_items'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='traded_items' comment='items brought to trade depot'>
<int32_t ref-target='item'/>
</stl-vector>
<stl-vector name='owned_buildings'>
<pointer type-name='building'/>
</stl-vector>
<stl-vector name='corpse_parts' comment='entries remain even when items are destroyed'>
<int32_t ref-target='item'/>
</stl-vector>
<compound name='job'>
<uint32_t name='unk_2d8'/>
<uint32_t name='unk_2dc'/>
<pointer type-name='unit' name='hunt_target'/>
<pointer type-name='building' name='destroy_target'/>
<int16_t name='unk_2e8'/> // fight related
<int16_t name='unk_2ea'/> // fight related
<uint16_t name='unk_2ec'/>
<uint16_t name='unk_2ee'/>
<uint16_t name='unk_2f0_cntr'/> // increments every tick
<pointer comment='df_job' name='current_job' type-name='job'/>
<uint16_t name='unk_2f8'/>
<uint32_t name='unk_2fc'/>
<uint32_t name='unk_300'/>
<uint32_t name='unk_304'/>
</compound>
<compound name='body'>
<stl-vector name='body_part_308' type-name='uint32_t'/> // 87*0 ?
<stl-vector name='unk_318'/>
<stl-vector name='body_layer_328' type-name='uint32_t'/>
<stl-vector name='body_layer_338' type-name='uint32_t'/> // 238*0
<stl-vector name='body_layer_348' type-name='uint32_t'/> // 238*0
<stl-vector name='body_layer_358' type-name='uint32_t'/> // 238*0
<stl-vector name='body_layer_368' type-name='uint32_t'/> // 238*0
<stl-vector name='body_layer_378' type-name='uint32_t'/> // 238*0
<stl-vector name='body_layer_388' type-name='pointer'/>
<uint32_t name='unk_398'/>
<int32_t name='unk_39c'/>
<int32_t name='unk_3a0'/>
<int32_t name='unk_3a4'/>
<int32_t name='unk_3a8'/>
<int32_t name='unk_3ac'/>
<int32_t name='unk_3b0'/>
<int32_t name='unk_3b4'/>
<int32_t name='unk_3b8'/>
<int32_t name='unk_3bc'/>
<int32_t name='unk_3c0'/>
<pointer name='body_plan' comment='points to the body_parts field of caste_raw'>
<stl-vector name='body_parts'>
<pointer type-name='body_part_raw'/>
</stl-vector>
</pointer>
<uint16_t name='unk_3c8'/>
<static-array type-name='unit_attribute' name='physical_attrs' count='6'/>
<uint32_t name='unk_474'/>
<uint32_t name='unk_478'/>
<uint32_t name='unk_47c'/>
<uint32_t name='unk_480'/>
<uint32_t name='unk_484'/>
<uint32_t name='unk_488'/>
<uint32_t name='blood_max'/>
<uint32_t name='blood_count'/> // 490
<uint32_t name='unk_494'/>
<stl-vector name='spatters'/>
</compound>
<compound name='unknown6'>
<stl-vector type-name='uint16_t' name='unk_4a8'/>
<stl-vector type-name='uint16_t' name='unk_4b8'/>
<uint32_t name='unk_4c8'/>
<stl-vector type-name='int16_t' name='unk_4cc'/>
<stl-vector type-name='int32_t' name='unk_4dc'/>
<stl-vector type-name='int32_t' name='unk_4ec'/>
<stl-vector type-name='int32_t' name='unk_4fc'/>
<stl-vector type-name='int16_t' name='unk_50c'/>
<pointer name='unk_51c'/>
<uint16_t name='unk_520'/>
<pointer name='unk_524'/>
<uint16_t name='unk_528'/>
</compound>
<stl-vector type-name='uint32_t' name='appearance'/>
<compound name='counters'>
<int32_t name='think_counter'/> // 53c decrements every job_counter reroll, set when changing jobs
<int32_t name='job_counter'/> // 540 current_job unit/walk done when reach -1, decremented every tick
<int32_t name='unk_544'/> // if set, decrements every job_counter reroll
<int16_t name='unk_548'/>
<int16_t name='winded'/>
<int16_t name='stunned'/> // 54c decrements every tick, unstun at 0
<int16_t name='unconscious'/>
<int16_t name='unk_550'/>
<int16_t name='webbed'/>
<int16_t name='unk_x554'/> // coords ? (-30.000x3)
<int16_t name='unk_y556'/>
<int16_t name='unk_z558'/>
<int16_t name='unk_x55a'/> // coords again
<int16_t name='unk_y55c'/>
<int16_t name='unk_z55e'/>
<int16_t name='soldier_mood_countdown'/>
<enum name='soldier_mood' base-type='int16_t'>
<enum-item name='None' value='-1'/>
<enum-item name='MartialTrance'/>
<enum-item name='Enranged'/>
<enum-item name='Tantrum'/>
</enum>
<uint32_t name='unk_564'/>
<uint32_t name='unk_568'/>
<uint32_t name='unk_56c'/>
<uint32_t name='unk_570'/>
<uint32_t name='unk_574'/>
<uint32_t name='unk_578'/>
<uint32_t name='unk_57c'/>
<uint32_t name='hunger_timer'/>
<uint32_t name='thirst_timer'/>
<uint32_t name='sleepiness_timer'/>
<uint32_t name='unk_58c'/> // counter, decrement to 0
<uint32_t name='unk_590'/> // same as 58c
<uint32_t name='unk_594'/>
<uint32_t name='unk_cntdn_598'/> // fluctuate
<uint32_t name='unk_59c'/>
</compound>
<compound name='status'>
<stl-vector name='misc_traits'>
<pointer type-name='unit_misc_trait'/>
</stl-vector>
<pointer name='unk_5b0'>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
<stl-vector type-name='int32_t'/>
</pointer>
<uint32_t name='unk_5b4'/> // 0x3e8 (1000)
<uint32_t name='unk_5b8'/> // 0x3e8 (1000)
<stl-vector name='unk_5bc'/>
<stl-vector name='unk_5cc'/>
<int8_t name='unk_5dc'/>
<compound type-name='language_name' name='artifact_name'/>
<stl-vector name='souls'>
<pointer type-name='unit_soul'/>
</stl-vector>
<pointer name='current_soul' type-name='unit_soul'/>
<stl-vector name='unk_660'/>
<static-array type-name='bool' name='labors' index-enum='unit_labor' count='94'/>
<stl-vector name='unk_6d0'/>
<stl-vector name='unk_6e0'/> // item ids?
<stl-vector name='recent_events'/> // 6f0: dined in a legendary dinning room, etc
<stl-vector name='unk_700'/>
<uint32_t name='happiness'/> // 710
<uint16_t name='unk_714'/>
<stl-vector name='unk_718'/>
<stl-vector name='unk_728'/>
<stl-vector name='relationships'/> // 738
<stl-vector name='unk_748'/>
<uint16_t name='unk_758'/>
<int16_t name='unk_x75a'/> // coords (-30000*3)
<int16_t name='unk_y75c'/>
<int16_t name='unk_z75e'/>
<stl-vector type-name='uint16_t' name='unk_760'/>
<stl-vector type-name='uint16_t' name='unk_770'/>
<stl-vector type-name='uint16_t' name='unk_780'/>
</compound>
<int32_t name='hist_figure_id' ref-target='historical_figure'/>
<compound name='status2'>
<uint16_t name='able_stand'/> // 794
<uint16_t name='able_stand_impair'/> // 796
<uint16_t name='able_grasp'/> // 798
<uint16_t name='able_grasp_impair'/> // 79a
<uint32_t name='unk_79c'/>
<uint32_t name='unk_7a0'/>
<stl-vector name='body_part_temperature'>
<pointer>
<uint16_t name='whole'/>
<uint16_t name='fraction' comment='the unit is 1/temp_factor in body part'/>
</pointer>
</stl-vector>
<uint32_t name='unk_7b4'/>
<uint32_t name='unk_7b8'/>
<uint8_t name='unk_7bc'/>
<int32_t name='unk_7c0'/>
</compound>
<compound name='unknown8'>
<stl-vector name='unk_7c4'/>
<stl-vector name='unk_7d4' type-name='int32_t'/>
<stl-vector name='unk_7e4' type-name='int16_t'/>
<stl-vector name='unk_7f4' type-name='int32_t'/> // combat log?
<stl-vector name='unk_804' type-name='int32_t'/>
<stl-vector name='unk_814' type-name='int32_t'/>
<uint32_t name='unk_824'/>
<uint32_t name='unk_828'/>
<uint32_t name='unk_82c'/>
<uint32_t name='unk_830'/>
<uint32_t name='unk_834'/>
<uint32_t name='unk_838'/>
<pointer name='unk_83c'/>
<stl-vector name='unk_840' type-name='pointer'/> // item related
<stl-vector name='unk_850'/>
<stl-vector name='unk_860' type-name='int32_t'/>
<int32_t name='unk_870'/>
<int32_t name='unk_874_cntr'/> // age ? incremented every tick
<stl-vector name='body_part_878' type-name='uint8_t'/>
<stl-vector name='body_part_888' type-name='uint8_t'/>
<stl-vector name='body_part_898' type-name='uint32_t'/>
<stl-vector name='body_part_8a8' type-name='uint8_t'/>
<stl-vector name='body_part_8b8' type-name='uint16_t'/>
<stl-vector name='body_part_8c8' type-name='uint16_t'/>
<stl-vector name='body_part_8d8' type-name='uint16_t'/>
<stl-vector name='unk_8e8'/> // items ids?
<stl-vector type-name='uint16_t' name='unk_8f8'/> // same size as 8e8, soldier related?
<stl-vector name='body_layer_908' type-name='uint32_t'/>
<int32_t name='unk_918'/>
<int32_t name='unk_91c'/>
<int32_t name='unk_920'/>
<uint32_t name='unk_924'/>
<uint32_t name='unk_928'/>
</compound>
<stl-vector name='burrows'>
<int32_t ref-target='burrow'/>
</stl-vector>
<uint32_t name='unk_93c'/>
</struct-type>
<struct-type type-name='unit_attribute'>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
<int32_t name='unk3'/>
<int32_t name='unk4'/>
<int32_t name='unk5'/>
<int32_t name='unk6'/>
<int32_t name='unk7'/>
</struct-type>
<struct-type type-name='unit_misc_trait' key-field='id'>
<enum base-type='int16_t' name='id'>
<enum-item name='ClaimedRecently' value='12'/>
<enum-item name='WantsDrink'/>
<enum-item name='LikesOutdoors'/>
<enum-item name='Hardened'/>
</enum>
<code-helper name='describe'>(fmt "value=~A" $.value)</code-helper>
<int32_t name='value'/>
</struct-type>
<struct-type type-name='unit_soul'>
<int32_t name='unit_id' ref-target='unit'/>
<compound name='name' type-name='language_name'/>
<uint32_t name='race' ref-target='creature_raw'/>
<uint8_t name='sex'/>
<uint16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<code-helper name='describe'>
(describe-obj $.name)
(awhen (find-creature $.race)
(fmt "~:(~A ~A~)" $it.caste[$.caste].caste_id $it.creature_id))
</code-helper>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
<int32_t name='unk3'/>
<int32_t name='unk4'/>
<static-array type-name='unit_attribute' name='mental_attrs' count='13'/>
<stl-vector name='skills'>
<pointer type-name='unit_skill'/>
</stl-vector>
<stl-vector name='preferences'>
<pointer type-name='unit_preference'/>
</stl-vector>
<static-array type-name='uint16_t' name='traits' count='30'/>
<stl-vector name='unk5'>
<pointer>
<int16_t name='unk1'/>
<int16_t name='unk2'/>
</pointer>
</stl-vector>
<stl-vector name='unk6'/>
</struct-type>
<struct-type type-name='unit_skill' key-field='id'>
<enum base-type='int16_t' name="id" type-name='job_skill'/>
<int32_t name="rating"/>
<uint32_t name="experience"/>
<int32_t name="unk_c"/>
<int32_t name="rusty"/>
<int32_t name="unk_14"/>
<int32_t name="unk_18"/>
<int32_t name="unk_1c"/>
</struct-type>
<struct-type type-name='unit_preference' key-field='type'>
<enum base-type='int16_t' name="type">
<enum-item name='LikeMaterial'/>
<enum-item name='LikeCreature'/>
<enum-item name='LikeFood'/>
<enum-item name='HateCreature'/>
<enum-item name='LikeItem'/>
<enum-item name='LikePlant'/>
<enum-item name='LikePlant2' comment='likely 2nd prefstring'/>
<enum-item name='LikeColor'/>
<enum-item name='LikeShape'/>
</enum>
<compound is-union='true'>
<enum base-type='int16_t' name="item_type" type-name='item_type'/>
<int16_t name='creature_id' ref-target='creature_raw'/>
<int16_t name='color_id' refers-to='$global.world.raws.color_words[$]'/>
<int16_t name='shape_id' refers-to='$global.world.raws.shape_words[$]'/>
<int16_t name='plant_id' ref-target='material_plant'/>
</compound>
<int16_t name="item_subtype" refers-to='(item-subtype-target $$._parent.item_type $)'/>
<int16_t name='mattype' ref-target='material' aux-value='$$.matindex'/>
<int32_t name='matindex'/>
<bool name='active'/>
<uint32_t name='unk'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,88 @@
<data-definition>
<enum-type type-name='interface_breakdown_types'>
<enum-item name='NONE'/>
<enum-item name='QUIT'/>
<enum-item name='STOPSCREEN'/>
<enum-item name='TOFIRST'/>
</enum-type>
<class-type type-name='viewscreen' original-name='viewscreenst'>
<pointer name='child' type-name='viewscreen'/>
<pointer name='parent' type-name='viewscreen'/>
<enum base-type='int8_t' name='breakdown_level' type-name='interface_breakdown_types'/>
<int8_t name='option_key_pressed'/>
</class-type>
<struct-type type-name='interface'>
<int32_t name='original_fps'/>
<compound name='view' type-name='viewscreen'/>
<uint32_t name='flag'/>
<int32_t name='shutdown_interface_tickcount'/>
<int32_t name='shutdown_interface_for_ms'/>
<int8_t name='supermovie_on'/>
<int32_t name='supermovie_pos'/>
<int32_t name='supermovie_delayrate'/>
<int32_t name='supermovie_delaystep'/>
<stl-vector name='supermovie_sound'>
<pointer type-name='stl-string'/>
</stl-vector>
<static-array name='supermovie_sound_time' count='16' comment='SOUND_CHANNELNUM'>
<static-array count='200' type-name='int32_t'/>
</static-array>
<padding name='supermoviebuffer' size='800000'/>
<padding name='supermoviebuffer_comp' size='1000000'/>
<int32_t name='currentblocksize'/>
<int32_t name='nextfilepos'/>
<int8_t name='first_movie_write'/>
<stl-string name='movie_file'/>
</struct-type>
<class-type type-name='viewscreen_titlest' inherits-from='viewscreen'>
<static-string name='str_histories' size='256'/>
<static-string name='menu_items' size='256'/>
<enum base-type='int16_t' name="sel_subpage">
<enum-item name='None'/>
<enum-item name='StartGame'/>
<enum-item name='Unk2'/>
<enum-item name='Arena'/>
<enum-item name='About'/>
</enum>
<int32_t name="sel_menu_line"/>
<int32_t name="sel_submenu_line"/>
<int8_t name="unk_218"/>
<stl-vector name="unk_21c">
<int32_t/>
</stl-vector>
<stl-vector name="unk_228"/>
<stl-vector name="unk_234"/>
<stl-vector name="start_savegames">
<pointer/>
</stl-vector>
<stl-vector name="continue_savegames">
<pointer/>
</stl-vector>
<stl-string name="str_slaves"/>
<stl-string name="str_chapter"/>
<stl-string name="str_copyright"/>
<stl-string name="str_version"/>
<stl-string name="str_unk"/>
<stl-string name="str_programmed"/>
<stl-string name="str_designed"/>
<stl-string name="str_visit"/>
<stl-string name="str_site"/>
</class-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,374 @@
<data-definition>
<struct-type type-name='world_site_unk130'>
<int32_t name="index"/>
<stl-vector name="unk_4">
<pointer>
<int32_t name="unk_0"/>
<int32_t name="index"/>
<int32_t name="unk_8"/>
<stl-vector name="unk_c">
<int32_t/>
</stl-vector>
</pointer>
</stl-vector>
</struct-type>
<struct-type type-name='world_site' key-field='id'
instance-vector='$global.world.world_data.sites'>
<compound name='name' type-name='language_name'/>
<code-helper name='describe'>(describe-obj $.name)</code-helper>
<int32_t name="civ_id" ref-target='historical_entity'/>
<int32_t name="owner1" ref-target='historical_entity'/>
<int32_t name="owner2" ref-target='historical_entity'/>
<int16_t name="unk_78"/>
<int16_t name="unk_7a"/>
<int16_t name="unk_7c"/>
<int32_t name="id"/>
<stl-vector name="unk_84">
<int32_t/>
</stl-vector>
<stl-vector name="unk_94"/>
<stl-vector name="animals">
<pointer>
<int16_t name="unk_0"/>
<int16_t name="race" ref-target='creature_raw'/>
<int32_t name="count"/>
<int32_t name="unk_8"/>
<int32_t name="owner" ref-target='historical_entity'/>
<int32_t name="unk_10"/>
<int32_t name="unk_14"/>
</pointer>
</stl-vector>
<stl-vector name="inhabitants">
<pointer>
<int32_t name="count"/>
<int32_t name="race" ref-target='creature_raw'/>
<int32_t name="unk_8"/>
</pointer>
</stl-vector>
<stl-vector name="unk_c4"/>
<stl-vector name="unk_d4"/>
<int32_t name="index"/>
<int16_t name="unk_e8"/>
<int16_t name="unk_ea"/>
<int16_t name="unk_ec"/>
<int16_t name="unk_ee"/>
<int32_t name="unk_f0"/>
<int32_t name="unk_f4"/>
<int32_t name="unk_f8"/>
<int32_t name="unk_fc"/>
<int32_t name="unk_100"/>
<uint32_t name="unk_104"/>
<uint32_t name="unk_108"/>
<int32_t name="unk_10c"/>
<int32_t name="unk_110"/>
<int32_t name="unk_114"/>
<int32_t name="unk_118"/>
<int32_t name="unk_11c"/>
<int32_t name="unk_120"/>
<int32_t name="unk_124"/>
<int32_t name="unk_128"/>
<int32_t name="unk_12c"/>
<int32_t name="unk_130"/>
<int32_t name="unk_134"/>
<int32_t name="unk_138"/>
<stl-vector name="unk_13c">
<pointer>
<int32_t name="unk_0"/>
<int32_t name="unk_4"/>
<int32_t name="unk_8"/>
<int32_t name="unk_c"/>
</pointer>
</stl-vector>
<df-flagarray name='flags'/>
<stl-vector name="unk_154"/>
<int32_t name="unk_164"/>
<int32_t name="unk_168"/>
<int32_t name="unk_16c"/>
<int32_t name="unk_170"/>
<int32_t name="unk_174"/>
<int16_t name="unk_178"/>
<int16_t name="unk_17a"/>
<int16_t name="unk_17c"/>
<int32_t name="unk_180"/>
<pointer name="unk_184">
<int16_t name="unk_0"/>
<stl-vector name="unk_4"/>
<int32_t name="unk_14"/>
<int32_t name="unk_18"/>
<int32_t name="unk_1c"/>
</pointer>
<pointer name="unk_188" type-name='world_site_unk130'/>
<stl-vector name="unk_18c"/>
<stl-vector name="unk_19c"/>
</struct-type>
<struct-type type-name='world_data'>
<compound name='name' type-name='language_name' comment='name of the world'/>
<static-array name='unk1' count='15' type-name='int8_t'/>
<int32_t name='num_sites'/>
<int32_t name='cur_site_id'/>
<int32_t/>
<int32_t/>
<int16_t name='world_width'/>
<int16_t name='world_height'/>
<stl-vector name='unk2'>
<pointer>
<int16_t name="unk_0"/>
<int16_t name="unk_2"/>
<int16_t name="unk_4"/>
<int16_t name="unk_6"/>
<int16_t name="unk_8"/>
<int32_t name="unk_c"/>
<int32_t name="unk_10"/>
<stl-vector name="unk_14">
<pointer/>
</stl-vector>
<int32_t name="unk_24"/>
<df-flagarray name='flags'/>
<stl-vector name="unk_30"/>
<stl-vector name="unk_40"/>
<stl-vector name="unk_50"/>
<stl-vector name="unk_60"/>
<int16_t name="unk_70"/>
<int16_t name="unk_72"/>
<int16_t name="unk_74"/>
<int16_t name="unk_76"/>
<int16_t name="unk_78"/>
<int32_t name="unk_7c"/>
<int32_t name="unk_80"/>
<int32_t name="unk_84"/>
</pointer>
</stl-vector>
<int32_t/>
<int32_t/>
<int16_t/>
<int16_t/>
<int16_t/>
<int16_t/>
<int16_t/>
<int16_t/>
<int32_t name='world_width2'/>
<int32_t name='world_height2'/>
<pointer type-name='uint32_t' is-array='true'/>
<pointer type-name='uint32_t' is-array='true'/>
<pointer type-name='uint32_t' is-array='true'/>
<pointer type-name='uint8_t' is-array='true'/>
<stl-vector name='unk4' type-name='pointer'/>
<int32_t name="unk_dc"/>
<int32_t name="unk_e0"/>
<int32_t name="unk_e4"/>
<int32_t name="unk_e8"/>
<int32_t name="unk_ec"/>
<int32_t name="unk_f0"/>
<compound name='construction_squares'>
<int16_t name="width"/>
<int16_t name="height"/>
<pointer name="table" is-array='true'>
<pointer is-array='true'>
<stl-vector>
<pointer/>
</stl-vector>
</pointer>
</pointer>
</compound>
<stl-vector name="constructions">
<pointer/>
</stl-vector>
<int32_t name="next_construction_id"/>
<static-array name="unk_110" count='2'>
<pointer name="table" is-array='true'>
<pointer is-array='true'>
<stl-vector name='unk1'>
<int32_t/>
</stl-vector>
<stl-vector name='unk2'>
<pointer type-name='int8_t' is-array='true'/>
</stl-vector>
</pointer>
</pointer>
<int16_t name="width"/>
<int16_t name="height"/>
</static-array>
<stl-vector name="sites">
<pointer type-name='world_site'/>
</stl-vector>
<stl-vector name="site_unk130">
<pointer type-name='world_site_unk130'/>
</stl-vector>
<stl-vector name="unk_140">
<pointer>
<int32_t name='index'/>
<static-array name='resource_allotments' count='100'>
<stl-vector>
<pointer/>
</stl-vector>
</static-array>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
<int32_t name='unk3'/>
</pointer>
</stl-vector>
<stl-vector name="unk_150">
<pointer>
<int32_t name="index"/>
<int32_t name="unk_4"/>
<stl-vector name="unk_8">
<pointer>
<int32_t name="index"/>
<int32_t name="unk_4"/>
<int32_t name="unk_8"/>
</pointer>
</stl-vector>
<stl-vector name="unk_18">
<pointer>
<int32_t name="index"/>
<int32_t name="unk_4"/>
<int32_t name="unk_8"/>
</pointer>
</stl-vector>
<stl-vector name="unk_28">
<pointer>
<int32_t name="unk_0"/>
<int32_t name="unk_4"/>
</pointer>
</stl-vector>
</pointer>
</stl-vector>
<stl-vector name="unk_160">
<pointer>
<compound name='name' type-name='language_name'/>
</pointer>
</stl-vector>
<stl-vector name="unk_170">
<pointer>
<compound name='name' type-name='language_name'/>
</pointer>
</stl-vector>
<stl-vector name="unk_180">
<pointer>
<int16_t name='unk1'/>
<compound name='name' type-name='language_name'/>
</pointer>
</stl-vector>
<stl-vector name="unk_190">
<pointer>
<int16_t name='unk1'/>
<int16_t name='index'/>
<stl-vector name="unk_4">
<pointer>
<int16_t name="unk_0"/>
<int32_t name="unk_4"/>
<stl-vector name="unk_8">
<int32_t/>
</stl-vector>
<stl-vector name="unk_18">
<int16_t/>
</stl-vector>
<stl-vector name="unk_28">
<int8_t/>
</stl-vector>
<stl-vector name="unk_38">
<int8_t/>
</stl-vector>
<int32_t name="index"/>
</pointer>
</stl-vector>
</pointer>
</stl-vector>
<stl-vector name="unk_1a0">
<pointer>
<compound name='name' type-name='language_name'/>
</pointer>
</stl-vector>
<stl-vector name="unk_1b0">
<pointer>
<compound name='name' type-name='language_name'/>
</pointer>
</stl-vector>
<pointer name="unk_1c0"/>
<pointer name="unk_1c4"/>
<padding name="unk_1c8" size="4"/>
<stl-vector name="unk_1cc"/>
<pointer name="unk_1dc"/>
<pointer name="unk_1e0"/>
<pointer name="unk_1e4"/>
<pointer name="unk_1e8"/>
<pointer name="unk_1ec"/>
<pointer name="unk_1f0"/>
<stl-vector name="active_site">
<pointer type-name='world_site'/>
</stl-vector>
<pointer name="unk_204"/>
<pointer name="unk_208"/>
<int32_t name="unk_20c"/>
<stl-vector name="unk_210"/>
<stl-vector name="unk_220"/>
<stl-vector name="unk_230"/>
<stl-vector name="unk_240">
<int16_t/>
</stl-vector>
<stl-vector name="unk_250">
<int16_t/>
</stl-vector>
<padding name="unk_260" size="4"/>
<int8_t name="unk_264"/>
<padding name="unk_265" size="3"/>
<padding name="unk_268" size="4"/>
<int8_t name="unk_26c"/>
<padding name="unk_26d" size="3"/>
<padding name="unk_270" size="4"/>
<stl-vector name="unk_274"/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,503 @@
<data-definition>
<struct-type type-name='world'>
dtor 89fff80
<static-array name='unk0' count='21'>
dtor 8532540
<stl-vector>
<pointer/>
</stl-vector>
</static-array>
<stl-vector name='unk_fc'>
<pointer/>
</stl-vector>
<stl-vector name='unk_108'>
<pointer/>
</stl-vector>
<stl-vector name='unk_114'>
<pointer/>
</stl-vector>
--
<stl-vector name='manager_orders'>
<pointer type-name='manager_order'/>
</stl-vector>
<stl-vector name='mandates'>
<pointer type-name='mandate'/>
</stl-vector>
-- Entities
<compound name='entities'>
<stl-vector name='all'>
<pointer type-name='historical_entity'/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='historical_entity'/>
</stl-vector>
</compound>
-- Unknown
<padding size='80004' comment='0 bytes; same size on Windows'/>
-- Units
<compound name='units'>
<stl-vector name='all'>
<pointer type-name='unit'/>
</stl-vector>
<static-array name='other' count='4'>
<stl-vector>
<pointer type-name='unit'/>
</stl-vector>
</static-array>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='unit'/>
</stl-vector>
</compound>
-- Unknown
<stl-vector name='unk_13a1c'>
<pointer/>
</stl-vector>
<stl-vector name='unk_13a28'>
<pointer/>
</stl-vector>
-- Nemesis
<compound name='nemesis'>
<stl-vector name='all'>
<pointer type-name='nemesis_record'/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='nemesis_record'/>
</stl-vector>
</compound>
<bool name='unk4'/>
-- Items
<compound name='items'>
dtor 852f4b0
<stl-vector name='all'>
<pointer type-name='item'/>
</stl-vector>
<static-array name='other' count='127'>
<stl-vector>
<pointer type-name='item'/>
</stl-vector>
</static-array>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='item'/>
</stl-vector>
<stl-vector name='bad_tag' type-name='int32_t'/>
</compound>
-- Artifacts
<compound name='artifacts'>
<stl-vector name='all'>
<pointer type-name='artifact_record'/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='artifact_record'/>
</stl-vector>
</compound>
-- Jobs and projectiles
<compound name='job_list' type-name='job_list_link'/>
<compound name='proj_list' type-name='proj_list_link'/>
-- Buildings
<compound name='buildings'>
dtor 85316f0
<stl-vector name='all'>
<pointer type-name='building'/>
</stl-vector>
<static-array name='other' count='86'>
<stl-vector>
<pointer type-name='building'/>
</stl-vector>
</static-array>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='building'/>
</stl-vector>
</compound>
<bool name='unk5a'/>
<bool name='unk5b'/>
-- Machines (connected groups of gears and so on)
<compound name='machines'>
<stl-vector name='all'>
<pointer type-name='machine'/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='machine'/>
</stl-vector>
</compound>
-- Unknown
<compound name='unk_144d4'>
<stl-vector name='all' type-name='pointer'/>
<stl-vector name='bad' has-bad-pointers='true' type-name='pointer'/>
</compound>
<padding size='84'/>
<compound name='unk_material_info_14540'>
<stl-vector name='unk_plant_1' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<stl-vector name='unk_plant_2' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<stl-vector name='unk_creature_1' type-name='bool'
index-refers-to='(find-creature $)'/>
<stl-vector name='unk_creature_2' type-name='bool'
index-refers-to='(find-creature $)'/>
<stl-vector name='unk_creature_3' type-name='bool'
index-refers-to='(find-creature $)'/>
<stl-vector name='unk_plant_3' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<stl-vector name='unk_plant_4' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<padding size='8' comment='0'/>
<stl-vector name='unk_plant_5' type-name='bool'
index-refers-to='(find-plant-raw $)'/>
<stl-vector name='unk_creature_4' type-name='bool'
index-refers-to='(find-creature $)'/>
<stl-vector name='unk_builtin' type-name='bool'
index-refers-to='(material-by-id $ -1)'/>
<padding size='16' comment='0'/>
</compound>
-- Plants
<compound name='plants'>
<stl-vector name='all' type-name='pointer'/>
<static-array name='other' count='5'>
<stl-vector type-name='pointer'/>
</static-array>
</compound>
-- Unknown
<padding name='unk_14618' size='12' comment='linked list'/>
-- Unknown
<padding size='500' comment='bool array?'/>
<static-array name='unk_14818' type-name='int8_t' count='250000'/>
<int32_t name='unk_518a8'/>
<compound name='unk_518ac'>
<stl-vector name='all'>
<pointer/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer/>
</stl-vector>
</compound>
<compound name='squads'>
<stl-vector name='all'>
<pointer type-name='squad'/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='squad'/>
</stl-vector>
</compound>
<compound name='unk_518dc'>
<stl-vector name='all'>
<pointer/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer/>
</stl-vector>
</compound>
-- Drills
<compound name='activities'>
<stl-vector name='all'>
<pointer type-name='activity_entry'/>
</stl-vector>
<stl-vector name='bad' has-bad-pointers='true'>
<pointer type-name='activity_entry'/>
</stl-vector>
</compound>
-- Reports and announcements
<compound name='status'>
dtor 85356e0
<stl-vector name='reports' type-name='pointer'/>
<stl-vector name='announcements' type-name='pointer'/>
<stl-vector name='unk_vec' type-name='pointer'/>
<int32_t name='next_report_id'/>
<int32_t/>
<int32_t/>
<static-array name='slots' count='100'>
<comment>Written to by code at 0x80fd7b0</comment>
<int16_t name='id'/>
<padding name='info' size='24' alignment='4'
comment='Weird garbage. Possibly types change for different entries.'/>
<stl-string name='unk3a'/>
<stl-string name='unk3b'/>
<stl-string name='unk3c'/>
<stl-string name='unk3d'/>
<int32_t name='unk4'/>
</static-array>
<static-array name='slot_id_used' type-name='int16_t' count='34'/>
<static-array name='slot_id_idx1' type-name='int16_t' count='34'/>
<static-array name='slot_id_idx2' type-name='int16_t' count='34'/>
<int16_t name='slots_used'/>
</compound>
<pointer name='selected_building' type-name='building'/>
<enum base-type='int16_t' name='selected_stockpile_type' type-name='stockpile_category'/>
<bool/>
<padding size='8' alignment='4' comment='0'/>
<compound name='map'> 52cdc
<stl-vector name='map_blocks'>
<pointer type-name='map_block'/>
</stl-vector>
<pointer name='block_index'/>
<stl-vector name='map_block_columns'>
<pointer type-name='map_block_column'/>
</stl-vector>
<pointer name='column_index'/>
<int32_t name='x_count_block'/>
<int32_t name='y_count_block'/>
<int32_t name='z_count_block'/>
<int32_t name='x_count'/>
<int32_t name='y_count'/>
<int32_t name='z_count'/>
<int32_t name='region_x'/>
<int32_t name='region_y'/>
<int32_t name='region_z'/>
</compound>
<static-array name='unknown_52d20'
count='2810' type-name='int16_t'/>
<pointer name='world_data' type-name='world_data'/>
<compound name='unk_54318'>
<padding size='1180'/>
<stl-vector comment='547b4'/>
<stl-vector/>
<padding size='8'/>
<stl-vector/>
<stl-vector/>
<padding size='8'/>
<bool/>
<stl-string/> 547f8
<padding size='24'/>
<stl-vector comment='54814'/>
<stl-vector/>
<padding size='8'/>
<stl-vector/>
<stl-vector/>
<padding size='8'/>
<static-array count='10' comment='true array 54854'>
<stl-vector/>
</static-array>
<static-array count='10' comment='true array 548cc'>
<stl-vector/>
</static-array>
<static-array count='10' comment='true array'>
<stl-vector/>
</static-array>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<stl-vector/>
</compound>
<padding size='8' comment='0'/>
<int32_t name='unk_54a0c'/>
<int32_t name='unk_54a10'/>
-- RAWs
<compound name='raws' type-name='world_raws'/>
<compound name='unk_59dc4'>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='pointer'/>
<static-array type-name='int16_t' count='32'/>
<int32_t/>
<int32_t/>
<int32_t/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int16_t'/>
<stl-vector type-name='int32_t'/>
<pointer name='unk_59e70'/>
<int32_t name='unk_59e74'/>
</compound>
<int32_t name='unk_59e78'/>
<compound name='unk_59e7c'>
<stl-string name='unk_59e7c'/>
<int32_t name="unk_5e200"/>
<int32_t name="unk_5e204"/>
<int32_t name="unk_5e208"/>
<int32_t name="unk_5e20c"/>
ctor 87ae880
<stl-string name='unk_59e90'/>
<padding size='16'/>
<int32_t name="unk_5e23c"/>
<int32_t name="unk_5e240"/>
<stl-string name='unk_59eac'/>
<bool/>
<bool/>
<bool/>
<bool/>
<padding size='900'/>
<pointer name='unk_5a238'/> dtor 83bed90
<int32_t name="unk_5e5ec"/>
<int32_t name="unk_5e5f0"/>
<int32_t name="unk_5e5f4"/>
<int32_t name="unk_5e5f8"/>
<int32_t name="unk_5e5fc"/>
<int32_t name="unk_5e600"/>
<int32_t name="unk_5e604"/>
<int32_t name="unk_5e608"/>
<bool/>
</compound>
-- hist figures
<compound name='history' type-name='world_history'/>
<stl-vector name='entity_populations'>
<pointer type-name='entity_population'/>
</stl-vector>
<int32_t name="unk_5e7a0"/>
<int32_t name='frame_counter' comment='increases by 1 every time . is pressed'/>
<compound name='unk_5a39c'>
<stl-vector name='unk_5a39c'/>
<static-array name='unk' count='80000'>
<comment>Looks like a temporary buffer for pathfinding or something.</comment>
<uint16_t name='unk1a'/>
<uint16_t name='tag'/>
<int32_t name='unk2'/>
<int16_t name='x'/>
<int16_t name='y'/>
<int32_t name='z'/>
</static-array>
<int32_t/>
<int16_t name='x1'/>
<int16_t name='y1'/>
<int16_t name='z1'/>
<int16_t name='x2'/>
<int16_t name='y2'/>
<int16_t name='z2'/>
<int32_t/>
<int32_t/>
<int32_t/>
<uint16_t/>
<uint16_t name='tag'/>
<bool/>
<uint16_t/>
<bool/>
<int16_t/>
<int16_t/>
<bool/>
<int32_t/>
</compound>
<compound name='unk_192bd8'>
<stl-string name='save_dir'/>
<padding size='4'/>
<static-array count='19'> 192be0
<stl-vector/>
</static-array>
</compound>
<int32_t name="unk_192cc4"/>
<compound name='unk_192cc8'>
<stl-vector/>
<stl-vector/>
<padding size='4'/>
<static-array count='105' comment='true array'>
<stl-vector type-name='pointer'/>
</static-array>
<stl-vector/>
<stl-vector/>
<stl-vector/>
<static-array count='7'>
<stl-vector/>
</static-array>
<padding size='8'/>
<stl-vector/>
</compound>
<compound name='unk_19325c'>
<static-array count='3'>
<stl-vector type-name='pointer'/>
</static-array>
<padding size='12'/>
</compound>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->

@ -0,0 +1,33 @@
#!/usr/bin/perl
use strict;
use warnings;
use XML::LibXML;
my $input_dir = $ARGV[0] || '.';
my $output_dir = $ARGV[1] || 'codegen';
my $separator = $ARGV[2] || "\n";
print "$output_dir/static.inc";
for my $filename (glob "$input_dir/*.xml") {
my $parser = XML::LibXML->new();
my $doc = $parser->parse_file($filename);
my @nodes = (
$doc->findnodes('/data-definition/enum-type'),
$doc->findnodes('/data-definition/bitfield-type'),
$doc->findnodes('/data-definition/struct-type'),
$doc->findnodes('/data-definition/class-type')
);
for my $node (@nodes) {
my $name = $node->getAttribute('type-name')
or die "Unnamed type in $filename\n";
print "$separator$output_dir/$name.h";
}
}
print $separator if $separator eq "\n";

@ -30,7 +30,7 @@ if(BUILD_SERVER)
add_subdirectory (server)
endif()
OPTION(BUILD_DF2MC "Build DF2MC (needs a checkout first)." ON)
OPTION(BUILD_DF2MC "Build DF2MC (needs a checkout first)." OFF)
if(BUILD_DF2MC)
add_subdirectory (df2mc)
endif()
@ -57,7 +57,9 @@ DFHACK_PLUGIN(deramp deramp.cpp)
DFHACK_PLUGIN(flows flows.cpp)
DFHACK_PLUGIN(filltraffic filltraffic.cpp)
DFHACK_PLUGIN(seedwatch seedwatch.cpp)
DFHACK_PLUGIN(versionosd versionosd.cpp)
DFHACK_PLUGIN(initflags initflags.cpp)
DFHACK_PLUGIN(stockpiles stockpiles.cpp)
#DFHACK_PLUGIN(versionosd versionosd.cpp)
# this is the skeleton plugin. If you want to make your own, make a copy and then change it
OPTION(BUILD_SKELETON "Build the skeleton plugin." OFF)

@ -0,0 +1,60 @@
#include <dfhack/Core.h>
#include <dfhack/Console.h>
#include <dfhack/Export.h>
#include <dfhack/PluginManager.h>
#include <dfhack/DataDefs.h>
#include <dfhack/df/d_init.h>
using std::vector;
using std::string;
using std::endl;
using namespace DFHack;
using namespace df::enums;
using df::global::d_init;
DFhackCExport command_result twaterlvl(Core * c, vector <string> & parameters);
DFhackCExport command_result tidlers(Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void )
{
return "initflags";
}
DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands)
{
commands.clear();
if (d_init) {
commands.push_back(PluginCommand("twaterlvl", "Toggle display of water/magma depth.", twaterlvl));
commands.push_back(PluginCommand("tidlers", "Toggle display of idlers.", tidlers));
}
std::cerr << "d_init: " << sizeof(df::d_init) << endl;
return CR_OK;
}
DFhackCExport command_result plugin_shutdown ( Core * c )
{
return CR_OK;
}
DFhackCExport command_result twaterlvl(Core * c, vector <string> & parameters)
{
c->Suspend();
df::global::d_init->flags1.toggle(d_init_flags1::SHOW_FLOW_AMOUNTS);
c->con << "Toggled the display of water/magma depth." << endl;
c->Resume();
return CR_OK;
}
DFhackCExport command_result tidlers(Core * c, vector <string> & parameters)
{
c->Suspend();
df::d_init_idlers iv = df::d_init_idlers(int(d_init->idlers) + 1);
if (!d_init_idlers::is_valid(iv))
iv = ENUM_FIRST_ITEM(d_init_idlers);
d_init->idlers = iv;
c->con << "Toggled the display of idlers to " << ENUM_KEY_STR(d_init_idlers, iv) << endl;
c->Resume();
return CR_OK;
}

@ -0,0 +1,87 @@
#include <dfhack/Core.h>
#include <dfhack/Console.h>
#include <dfhack/Export.h>
#include <dfhack/PluginManager.h>
#include <dfhack/DataDefs.h>
#include <dfhack/df/world.h>
#include <dfhack/df/ui.h>
#include <dfhack/df/building_stockpilest.h>
using std::vector;
using std::string;
using std::endl;
using namespace DFHack;
using namespace df::enums;
using df::global::world;
using df::global::ui;
using df::building_stockpilest;
DFhackCExport command_result copystock(Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void )
{
return "stockpiles";
}
DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands)
{
commands.clear();
if (world && ui) {
commands.push_back(PluginCommand("copystock", "Copy stockpile under cursor.", copystock));
}
std::cerr << "world: " << sizeof(df::world) << " ui: " << sizeof(df::ui)
<< " b_stock: " << sizeof(building_stockpilest) << endl;
return CR_OK;
}
DFhackCExport command_result plugin_shutdown ( Core * c )
{
return CR_OK;
}
bool inSelectMode() {
using namespace ui_sidebar_mode;
switch (ui->main.mode) {
case BuildingItems:
case QueryBuilding:
return true;
default:
return false;
}
}
DFhackCExport command_result copystock(Core * c, vector <string> & parameters)
{
CoreSuspender suspend(c);
// For convenience: when used in the stockpiles mode, switch to 'q'
if (ui->main.mode == ui_sidebar_mode::Stockpiles) {
world->selected_building = NULL; // just in case it contains some kind of garbage
ui->main.mode = ui_sidebar_mode::QueryBuilding;
c->con << "Switched back to query building." << endl;
return CR_OK;
}
if (!inSelectMode()) {
c->con << "Cannot copy stockpile in mode " << ENUM_KEY_STR(ui_sidebar_mode, ui->main.mode) << endl;
return CR_OK;
}
building_stockpilest *sp = virtual_cast<building_stockpilest>(world->selected_building);
if (!sp) {
c->con << "Selected building isn't a stockpile." << endl;
return CR_OK;
}
ui->stockpile.custom_settings = sp->settings;
ui->main.mode = ui_sidebar_mode::Stockpiles;
world->selected_stockpile_type = stockpile_category::Custom;
c->con << "Stockpile options copied." << endl;
return CR_OK;
}