Configuration file access
This part of Ikarus gives you access to Gothic.ini
and loaded mod configuration files.
Initialization
The best way to initialize all Ikarus functions is to call MEM_InitAll()
in the Init_Global()
initialization function.
Warning
If you want to use Ikarus in Gothic 1, it is best to define your own Init_Global()
function and call it from every world initialization function.
Implementation
Read functions
MEM_GetCommandLine
Returns the contents of the command line passed to Gothic.
The function returns contents of the command line passed to Gothic. This could, for example, look like this:
"-TIME:7:35 -GAME:TEST_IKARUS.INI -ZREPARSE -ZWINDOW -ZLOG:5,S -DEVMODE -ZMAXFRAMERATE:30"
MEM_GetGothOpt
Searches the Gothic.ini
for an option.
var string sectionname
Settings section like[GAME]
var string optionname
One setting entry likeplayLogoVideos
Return value
The function returns an option value as a string or empty string if option was not found.
MEM_GetModOpt
Searches the loaded mod ini file for option.
var string sectionname
Settings section like[INFO]
var string optionname
One setting entry likeTitle
Return value
The function returns an option value as a string or empty string if option was not found.
MEM_GothOptSectionExists
Checks whether a section exists in Gothic.ini
var string sectionname
Settings section like[GAME]
Return value
The function returns TRUE
if section exists FALSE
is returned otherwise.
MEM_ModOptSectionExists
Checks whether a section exists in loaded mod ini file
var string sectionname
Settings section like[INFO]
Return value
The function returns TRUE
if section exists FALSE
is returned otherwise.
MEM_GothOptExists
Checks whether an option exists in Gothic.ini
var string sectionname
Settings section like[GAME]
var string optionname
One setting entry likeplayLogoVideos
Return value
The function returns TRUE
if option in a section exist FALSE
is returned otherwise.
MEM_ModOptExists
Checks whether an option exists in loaded mod ini file
var string sectionname
Settings section like[INFO]
var string optionname
One setting entry likeTitle
Return value
The function returns TRUE
if option in a section exist FALSE
is returned otherwise.
Write functions
Warning
Mod configuration is never saved to disk, therefore no separate functions exist for writing to it.
MEM_SetGothOpt
The option option
in the section section
is set to the value
. If the section and/or option does not exist, it will be created.
var string section
The section where the option should be locatedvar string option
Option to write/overwritevar string value
Value to set the option to
MEM_ApplyGothOpt
Applies the changes and saves the ini to disk
Tip
If you introduce new options, it is best to follow certain practices. It is a good practice to name your options in a clear manner and place them in a section named the same as your mod. Do not place your mod options into the [GAME]
or [PERFORMANCE]
sections.
Key functions
The Gothic.ini
contains the assignment of physical keys (e.g. "W") to logical keys (e.g. "keyUp").
MEM_GetKey
Returns the primary key assigned to logical key.
var string name
Name of the logical key
Return value
The function returns key assigned to logical key
MEM_GetSecondaryKey
Returns a secondary key assigned to logical key.
var string name
Name of the logical key
Return value
The function returns key assigned to logical key
MEM_SetKeys
Sets keyboard keys of the logical key.
var string name
Name of the logical keyvar int primary
Primary key to be assigned, can be taken from Ikarus_Const_G1 / Ikarus_Const_G2 file.var int secondary
Secondary key to be assigned, can be taken from Ikarus_Const_G1 / Ikarus_Const_G2 file.
MEM_SetKey
Sets the primary keyboard key of the logical key.
var string name
Name of the logical keyvar int key
Primary key to be assigned, can be taken from Ikarus_Const_G1 / Ikarus_Const_G2 file.
MEM_SetSecondaryKey
Sets the secondary keyboard key of the logical key.
var string name
Name of the logical keyvar int key
Secondary key to be assigned, can be taken from Ikarus_Const_G1 / Ikarus_Const_G2 file.