Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LeGo] "Setup" article and navigation changes #117

Merged
merged 3 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/zengin/scripts/extenders/lego/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nav:
- tools
- applications
- userconstants.md
- ...
4 changes: 2 additions & 2 deletions docs/zengin/scripts/extenders/lego/applications/anim8.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`"
Expand All @@ -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`"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/zengin/scripts/extenders/lego/applications/buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/zengin/scripts/extenders/lego/applications/cursor.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: LeGo package implementing in-game mouse cursor support
**Implementation:**<br/>
[: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).
Expand Down Expand Up @@ -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).
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
81 changes: 81 additions & 0 deletions docs/zengin/scripts/extenders/lego/setup.md
Original file line number Diff line number Diff line change
@@ -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 `<Gothic-dir>\_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);
};
```
2 changes: 1 addition & 1 deletion docs/zengin/scripts/extenders/lego/tools/interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/zengin/scripts/extenders/lego/tools/talents.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/zengin/scripts/extenders/lego/tools/talents.pl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down