Ikarus Setup
Download
First you need to download ikarus from the official github repository. We recommend using the master branch as it contains the latest and most up-to-date version of Ikarus. However, you can also download a specific release if needed.
File location
Before unpacking the downloaded archive it's needed to create a dedicated folder in <Gothic-dir>\_work\Data\Scripts\Content
directory. You can name this folder as you wish; in this guide, we'll refer to it as the "MOD" folder. Unpack the downloaded files into this newly created folder. The archiver should create a folder named Ikarus-master
or Ikarus-X.X.X
. For better readability change its name to the much simpler Ikarus
.
Tip
It's a good practice to delete any unused files, so delete files for other gothic version than this you are using.
Parsing
Ikarus consists of three main parts, constants, classes and the Ikarus core. It's essential to parse these in a specific order. Additionally, there is a floats package which isn't essential, but it is highly recommended to parse it, especially if you are working with LeGo that depends on it.
The Ikarus Core is identical for both Gothic 1 and 2 and is contained in a single file, Ikarus.d
. However, there are separate files for the constants and classes for each engine, and they must be parsed correctly. Ikarus uses a C_NPC and therefore has to be parsed after the C_NPC class (after the classes.d
file). There are no other dependencies.
Since Ikarus 1.2.1 there is additional .src
file for each game engine, to simplify adding files to Gothic.src
Warning
Following example is for Gothic 2. If you are using Gothic 1 replace the G2
at the end of the file/directory name with G1
.
Initialization
Before you can use Ikarus in your scripts, it must be properly initialized. The initialization process differs between Gothic 1 and Gothic 2.
MEM_InitAll
This is main ikarus initialization function, however it consists of some smaller initialization functions.
Gothic 1
To initialize Ikarus in Gothic 1 you must define your own INIT_GLOBAL
function at the top of the Startup.d
file. Then the INIT_GLOBAL
should be called in every INIT_<location>
function (e.g. INIT_SURFACE
,INIT_OLDCAMP
etc.). INIT_SUB_<location>
functions can be skipped in that process.
Then in your INIT_GLOBAL
function you call MEM_InitAll()
initialization function.
Startup.d | |
---|---|
Gothic 2
Gothic 2 has its own INIT_GLOBAL
function, so the initialization process is much simpler. All you have to do is to call MEM_InitAll()
in INIT_GLOBAL
function located in the Startup.d
file.