From 02774f4702968ab79a011f4134644e2caf18145b Mon Sep 17 00:00:00 2001
From: Emu <110698397+muczc1wek@users.noreply.github.com>
Date: Sat, 8 Jun 2024 19:53:29 +0000
Subject: [PATCH] [LeGo] "Setup" article and navigation changes (#117)
* [LeGo] Setup article
---
docs/zengin/scripts/extenders/lego/.pages | 5 ++
.../extenders/lego/applications/anim8.md | 4 +-
.../lego/applications/bloodsplats.md | 2 +-
.../extenders/lego/applications/buttons.md | 2 +-
.../extenders/lego/applications/cursor.md | 4 +-
.../lego/applications/dialoggestures.md | 2 +-
docs/zengin/scripts/extenders/lego/setup.md | 81 +++++++++++++++++++
.../scripts/extenders/lego/tools/interface.md | 2 +-
.../scripts/extenders/lego/tools/talents.md | 2 +-
.../extenders/lego/tools/talents.pl.md | 2 +-
.../lego/{various => }/userconstants.md | 0
11 files changed, 96 insertions(+), 10 deletions(-)
create mode 100644 docs/zengin/scripts/extenders/lego/.pages
create mode 100644 docs/zengin/scripts/extenders/lego/setup.md
rename docs/zengin/scripts/extenders/lego/{various => }/userconstants.md (100%)
diff --git a/docs/zengin/scripts/extenders/lego/.pages b/docs/zengin/scripts/extenders/lego/.pages
new file mode 100644
index 0000000000..b968335b15
--- /dev/null
+++ b/docs/zengin/scripts/extenders/lego/.pages
@@ -0,0 +1,5 @@
+nav:
+ - tools
+ - applications
+ - userconstants.md
+ - ...
\ No newline at end of file
diff --git a/docs/zengin/scripts/extenders/lego/applications/anim8.md b/docs/zengin/scripts/extenders/lego/applications/anim8.md
index 94b561829d..724dd2367a 100644
--- a/docs/zengin/scripts/extenders/lego/applications/anim8.md
+++ b/docs/zengin/scripts/extenders/lego/applications/anim8.md
@@ -156,7 +156,7 @@ LeGo_Init(LeGo_Anim8);
- `#!dae var int span`
Action duration in milliseconds
- `#!dae var int interpol`
- What form of movement is used (See [constants](../various/userconstants.md#anim8) for this)
+ What form of movement is used (See [constants](../userconstants.md#anim8) for this)
### `Anim8q`
!!! function "`Anim8q`"
@@ -173,7 +173,7 @@ LeGo_Init(LeGo_Anim8);
- `#!dae var int span`
Action duration in milliseconds
- `#!dae var int interpol`
- What form of movement is used (See [constants](../various/userconstants.md#anim8) for this)
+ What form of movement is used (See [constants](../userconstants.md#anim8) for this)
### `Anim8_CallOnRemove`
!!! function "`Anim8_CallOnRemove`"
diff --git a/docs/zengin/scripts/extenders/lego/applications/bloodsplats.md b/docs/zengin/scripts/extenders/lego/applications/bloodsplats.md
index e3eb75bb26..c944c029e1 100644
--- a/docs/zengin/scripts/extenders/lego/applications/bloodsplats.md
+++ b/docs/zengin/scripts/extenders/lego/applications/bloodsplats.md
@@ -16,7 +16,7 @@ description: LeGo package for displaying bloodsplats on a screen when player is
If this package is activated, red blood splatters will appear on the screen when the hero takes damage. For this, the damage perception for the hero is redirected to `_B_HeroDamage()`. To use the Bloodsplats, the enclosed textures must be available. Also, the VFX "HERO_HURT" (also included) should be entered in the `VfxInst.d` to create an even better hit effect. All textures used here are from [CGTextures.com](http://CGTextures.com). If you use Bloodsplats in your modification, this site must be noted in the credits.
!!! Tip
- See [user constants](../various/userconstants.md#bloodsplats) to edit behavior of this packet.
+ See [user constants](../userconstants.md#bloodsplats) to edit behavior of this packet.
## Initialization
Initialize with `LeGo_Bloodsplats` flag.
diff --git a/docs/zengin/scripts/extenders/lego/applications/buttons.md b/docs/zengin/scripts/extenders/lego/applications/buttons.md
index bfcb3c72f1..12fb498b3c 100644
--- a/docs/zengin/scripts/extenders/lego/applications/buttons.md
+++ b/docs/zengin/scripts/extenders/lego/applications/buttons.md
@@ -212,7 +212,7 @@ LeGo_Init(LeGo_Buttons);
### `Button_GetState`
!!! function "`Button_GetState`"
- Gets the status of the button as a bit field. See [User Constants](../various/userconstants.md#buttons).
+ Gets the status of the button as a bit field. See [User Constants](../userconstants.md#buttons).
```dae
func int Button_GetState(var int hndl)
```
diff --git a/docs/zengin/scripts/extenders/lego/applications/cursor.md b/docs/zengin/scripts/extenders/lego/applications/cursor.md
index 6ce856751d..1b494d8bbe 100644
--- a/docs/zengin/scripts/extenders/lego/applications/cursor.md
+++ b/docs/zengin/scripts/extenders/lego/applications/cursor.md
@@ -12,7 +12,7 @@ description: LeGo package implementing in-game mouse cursor support
**Implementation:**
[:material-github: Cursor.d on GitHub](https://github.com/Lehona/LeGo/blob/dev/Cursor.d)
-This package implements Gothic in-game mouse cursor support. To visually display the cursor there is a `Cursor.tga` file in the resources, but the texture can be changed in [user constants](../various/userconstants.md#cursor_1).
+This package implements Gothic in-game mouse cursor support. To visually display the cursor there is a `Cursor.tga` file in the resources, but the texture can be changed in [user constants](../userconstants.md#cursor_1).
!!! Warning
The cursor only works if the mouse is activated in the Gothic settings. It can be done directly from the scripts. See the [Ini file access](../../ikarus/functions/ini_access.md).
@@ -160,4 +160,4 @@ func void MyCursorListener(var int state)
};
};
```
-Constants used in the example can be found in the [user constants](../various/userconstants.md#cursor).
+Constants used in the example can be found in the [user constants](../userconstants.md#cursor).
diff --git a/docs/zengin/scripts/extenders/lego/applications/dialoggestures.md b/docs/zengin/scripts/extenders/lego/applications/dialoggestures.md
index 6d896962ac..802cfc1470 100644
--- a/docs/zengin/scripts/extenders/lego/applications/dialoggestures.md
+++ b/docs/zengin/scripts/extenders/lego/applications/dialoggestures.md
@@ -25,7 +25,7 @@ N/A
```dae
DIAG_Prefix + aniName + DIAG_Suffix + ((rand() % (max - (min - 1))) + min).ToString("00");
```
- `DIAG_Prefix` and `DIAG_Suffix` are [user constants](../various/userconstants.md#dialoggestures).
+ `DIAG_Prefix` and `DIAG_Suffix` are [user constants](../userconstants.md#dialoggestures).
```dae
func void DIAG(var string AniName, var int Min, var int Max)
diff --git a/docs/zengin/scripts/extenders/lego/setup.md b/docs/zengin/scripts/extenders/lego/setup.md
new file mode 100644
index 0000000000..5d7a518dc5
--- /dev/null
+++ b/docs/zengin/scripts/extenders/lego/setup.md
@@ -0,0 +1,81 @@
+---
+title: Setup
+---
+
+# LeGo Setup
+
+!!! Danger
+ LeGo depends on [Ikarus](../ikarus/index.md) script packet, if you didn't install it yet check the [Ikarus Setup](../ikarus/setup.md). This guide assumes that you already have Ikarus running.
+
+## Download
+First you need to download LeGo from the [official github repository](https://github.com/Lehona/LeGo). We recommend using the `dev` branch as it contains the latest and most up-to-date version of the package. However, you can also download a specific release if needed.
+
+## File location
+If you followed the Ikarus Setup guide you probably have a "MOD" (or any other named) folder inside the `\_work\Data\Scripts\Content` directory. If not create it.
+
+Unpack the downloaded files into this folder. The archiver should create a folder named `LeGo-dev` or `LeGo-X.X.X`. For better readability change its name to just `LeGo`.
+
+!!! Tip
+ It's a good practice to delete any unused files, so delete files for other gothic version than this you are using.
+
+## Parsing
+LeGo has a special header files, one for each supported engine version. All you need to do is to include them in `Gothic.src` right after the Ikarus files.
+
+
+=== "Gothic.src (G1)"
+ ```
+ _INTERN\CONSTANTS.D
+ _INTERN\CLASSES.D
+ MOD\IKARUS\IKARUS_G1.SRC
+ MOD\LEGO\HEADER_G1.SRC
+ ```
+=== "Gothic.src (G2)"
+ ```
+ _INTERN\CONSTANTS.D
+ _INTERN\CLASSES.D
+ MOD\IKARUS\IKARUS_G2.SRC
+ MOD\LEGO\HEADER_G2.SRC
+ ```
+
+## Initialization
+Before you can use LeGo and its packages, it must be properly initialized.
+
+!!! Warning
+ Gothic 1 by default doesn't have its own `INIT_GLOBAL` function inside `Startup.d` file. If you haven't created it yet see how to do it [here](../ikarus/setup.md#gothic-1).
+
+You initialize LeGo by calling the `LeGo_Init(var int flags)` function and specifying the flags.
+
+=== "Init All"
+ With `LeGo_All` flag you initialize all packages, excluding experimental [Buffs](./applications/buffs.md) and [Render](./applications/render.md).
+ ```dae title="Startup.d"
+ FUNC VOID INIT_GLOBAL()
+ {
+ // Init Ikarus
+ MEM_InitAll ();
+ // Init LeGo
+ LeGo_Init(LeGo_All)
+ };
+ ```
+=== "Exclude packages"
+ By the bitwise `NOT` operator you can exclude specific packages from `LeGo_All` flag.
+ ```dae title="Startup.d"
+ FUNC VOID INIT_GLOBAL()
+ {
+ // Init Ikarus
+ MEM_InitAll ();
+ // Init LeGo
+ LeGo_Init(LeGo_All &~ (LeGo_Focusnames | LeGo_Bloodsplats));
+ };
+ ```
+
+=== "Init specific packages"
+ You could also init specific packages with bitwise `OR`.
+ ```dae title="Startup.d"
+ FUNC VOID INIT_GLOBAL()
+ {
+ // Init Ikarus
+ MEM_InitAll ();
+ // Init LeGo
+ LeGo_Init(LeGo_AI_Function | LeGo_Saves);
+ };
+ ```
\ No newline at end of file
diff --git a/docs/zengin/scripts/extenders/lego/tools/interface.md b/docs/zengin/scripts/extenders/lego/tools/interface.md
index a6fa03cc91..7b7809febd 100644
--- a/docs/zengin/scripts/extenders/lego/tools/interface.md
+++ b/docs/zengin/scripts/extenders/lego/tools/interface.md
@@ -600,7 +600,7 @@ LeGo_Init(LeGo_Interface | LeGo_PrintS);
### `PrintS`
!!! function "`PrintS`"
- Same function as the external `Print`, but with smooth animations. The effect can be changed as desired with the [user constants](../various/userconstants.md#prints).
+ Same function as the external `Print`, but with smooth animations. The effect can be changed as desired with the [user constants](../userconstants.md#prints).
```dae
func void PrintS(var string txt)
```
diff --git a/docs/zengin/scripts/extenders/lego/tools/talents.md b/docs/zengin/scripts/extenders/lego/tools/talents.md
index 255c0eb3f1..eec5929340 100644
--- a/docs/zengin/scripts/extenders/lego/tools/talents.md
+++ b/docs/zengin/scripts/extenders/lego/tools/talents.md
@@ -15,7 +15,7 @@ The Talents package does two things:
1. save any number of values for a specific NPC (effectively AIVar array extension).
2. identify NPC by unique ID.
-Talents package uses one free AIVar variables, the default is AIVar with the index 89 that can be customized in `Userconst.d` the [`AIV_TALENT` constant](../various/userconstants.md#talents).
+Talents package uses one free AIVar variables, the default is AIVar with the index 89 that can be customized in `Userconst.d` the [`AIV_TALENT` constant](../userconstants.md#talents).
## Initialization
Initialize with `LeGo_PermMem` flag.
diff --git a/docs/zengin/scripts/extenders/lego/tools/talents.pl.md b/docs/zengin/scripts/extenders/lego/tools/talents.pl.md
index 88235fe550..33da5f9d2f 100644
--- a/docs/zengin/scripts/extenders/lego/tools/talents.pl.md
+++ b/docs/zengin/scripts/extenders/lego/tools/talents.pl.md
@@ -15,7 +15,7 @@ Ten pakiet robi dwie rzeczy:
1. Zapisuje dowolną liczbę wartości dla określonego NPC (efektywne rozszerzenie tablicy AIVar).
2. Pozwala zidentyfikować NPC za pomocą unikalnego ID.
-Pakiet `Talents` używa jednego wolnego AIVara, domyślnie jest to AIVar z numerem 89, który można dostosować w `Userconst.d` [`AIV_TALENT`](../various/userconstants.md#talents).
+Pakiet `Talents` używa jednego wolnego AIVara, domyślnie jest to AIVar z numerem 89, który można dostosować w `Userconst.d` [`AIV_TALENT`](../userconstants.md#talents).
## Inicjalizacja
Zainicjuj za pomocą flagi `LeGo_PermMem`.
diff --git a/docs/zengin/scripts/extenders/lego/various/userconstants.md b/docs/zengin/scripts/extenders/lego/userconstants.md
similarity index 100%
rename from docs/zengin/scripts/extenders/lego/various/userconstants.md
rename to docs/zengin/scripts/extenders/lego/userconstants.md