diff --git a/.gitignore b/.gitignore
index 702a6490c..a19302fe4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,6 +29,7 @@ build/CMakeCache.txt
build/cmake_install.cmake
build/CMakeFiles
build/doc
+build/lua
build/bin
build/library
build/tools
diff --git a/Memory.xml b/Memory.xml
index 366dc48ba..b4f7ce1f3 100644
--- a/Memory.xml
+++ b/Memory.xml
@@ -1078,6 +1078,13 @@
+
+
+
+
+
+
+
@@ -2309,6 +2316,13 @@
+
+
+
+
+
+
+
cmake
item vector:
@@ -3174,6 +3188,13 @@
+
+
+
+
+
+
+
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index 7e24f3659..9a87db9af 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -29,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
@@ -64,6 +65,8 @@ include/dfhack/modules/Graphic.h
SET(PROJECT_SRCS
Core.cpp
+DataDefs.cpp
+DataStatics.cpp
PluginManager.cpp
TileTypes.cpp
VersionInfo.cpp
diff --git a/library/Core.cpp b/library/Core.cpp
index f218f2756..5296a057e 100644
--- a/library/Core.cpp
+++ b/library/Core.cpp
@@ -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"
@@ -494,6 +495,10 @@ bool Core::Init()
dump << vinfo->PrintOffsets();
dump.close();
}
+
+ // initialize data defs
+ virtual_identity::Init();
+ InitDataDefGlobals(this);
// create mutex for syncing with interactive tasks
StackMutex = new mutex();
diff --git a/library/DataDefs.cpp b/library/DataDefs.cpp
new file mode 100644
index 000000000..2de8c156e
--- /dev/null
+++ b/library/DataDefs.cpp
@@ -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
+#include
+#include