Skip to content

Commit

Permalink
[Scripts] Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
muczc1wek committed Dec 25, 2023
1 parent eb1ad6d commit 937a20a
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 17 deletions.
7 changes: 4 additions & 3 deletions docs/zengin/scripts/classes/c_musictheme.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const INT TRANSITION_SUB_TYPE_MEASURE = 3; // Gradual transition
```

## Name features
The musical themes of the game are played depending on the game situation. By default, the theme with the ending is played `_STD` (standard). In case of a threat, the theme will be played with the ending `_THR` (threat). Theme plays during combat `_FGT` (fight).
The musical themes of the game are played depending on the game situation. By default, the theme with the `_STD` (standard) suffix is played. In case of a threat, the `_THR` (threat) theme will be played. During the combat the `_FGT` (fight) theme plays.

```dae
instance WOO_DAY_STD(C_MUSICTHEME_STANDARD)
Expand All @@ -99,7 +99,7 @@ instance WOO_DAY_FGT(C_MUSICTHEME_FIGHT)
file = "woo_dayfgt.sgt";
};
```
In addition, with the suffix `_DAY_` and `_NGT_` determined by day or night, the theme is played.
In addition, the suffix `_DAY_` and `_NGT_` determines whether the theme should be played on day or night.
```dae
instance OWD_DAY_FGT(C_MUSICTHEME_FIGHT)
{
Expand All @@ -111,4 +111,5 @@ instance OWD_NGT_STD(C_MUSICTHEME_STANDARD)
file = "owd_daystd.sgt";
};
```
Themes from prototypes are used by default `C_MUSICTHEME_STANDARD`, `C_MUSICTHEME_THREAT` and `C_MUSICTHEME_FIGHT`.
!!! Tip
In G2 the `C_MUSICTHEME_STANDARD`, `C_MUSICTHEME_THREAT` and `C_MUSICTHEME_FIGHT` prototypes are used by default.
12 changes: 6 additions & 6 deletions docs/zengin/scripts/extenders/ikarus/floats.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,13 @@ func void printf(var int x)

### Simple operations
```dae
var int float1 = mkf(5); // Create an Ikarus float with value 5
var int float2 = mkf(2); // Create an Ikarus float with value 2
var int float1; float1 = mkf(5); // Create an Ikarus float with value 5
var int float2; float2 = mkf(2); // Create an Ikarus float with value 2

var int addResult = addf(float1, float2); // Add float1 and float2
var int subResult = subf(float1, float2); // Subtract float2 from float1
var int mulResult = mulf(float1, float2); // Multiply float1 by float2
var int divResult = divf(float1, float2); // Divide float1 by float2
var int addResult; addResluts = addf(float1, float2); // Add float1 and float2
var int subResult; subResults = subf(float1, float2); // Subtract float2 from float1
var int mulResult; mulRelsults = mulf(float1, float2); // Multiply float1 by float2
var int divResult; divResults = divf(float1, float2); // Divide float1 by float2

printf(addResult); // Output: 7
printf(subResult); // Output: 3
Expand Down
4 changes: 2 additions & 2 deletions docs/zengin/scripts/extenders/ikarus/functions/asm.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Executes the code dictated up to that point, similar to how an external function
func void ASM_RunOnce()
```

## Examples
## Example
The following function sets the NPC passed as slf as the player, as if you had pressed **O** in Marvin mode with this NPC in focus. This is so short because there is already a function for this exact purpose, it's just not normally accessible from the scripts. It is therefore sufficient to write assembly code that pushes the parameter of the function (the `this` pointer) into the appropriate register and then calls the function.
```dae
func void SetAsPlayer(var C_NPC slf) { /* Adresse der Funktion */
Expand All @@ -216,7 +216,7 @@ func void SetAsPlayer(var C_NPC slf) { /* Adresse der Funktion */
!!! Note
Call targets are specified relative to the instruction that would have been executed after the actual call instruction. Therefore, both ASM_Here() and the subtraction of 4 in the call parameter are necessary.

The above example describes, among other things, [`CALL__thiscall`](#) function form the [CALL Package](#) that can be also used to implement `SetAsPlayer`.
The above example describes, among other things, [`CALL__thiscall`](#) function form the [CALL Package](call.md) that can be also used to implement `SetAsPlayer`.
```dae
func void SetAsPlayer(var C_NPC slf) {
const int oCNpc__SetAsPlayer = 7612064;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func void MEM_WriteInt(var int address, var int value)
- `#!dae var int value`
Integer value to write

??? abstract "Examples"
??? abstract "Example"
An example of using this function is the following Ikarus function, which turns debugging messages on and off:
```dae
func void MEM_SetShowDebug(var int on)
Expand Down
2 changes: 1 addition & 1 deletion docs/zengin/scripts/extenders/ikarus/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Before unpacking the downloaded archive it's needed to create a dedicated folder
## Parsing
Ikarus consists of three main parts, [constants](./constants.md), classes and the Ikarus core. It's essential to parse these in a specific order. Additionally, there is a [floats package](floats.md) which isn't essential, but it is highly recommended to parse it, especially if you are working with [LeGo](../lego/index.md) 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.
The Ikarus Core is identical for both Gothic 1 and 2 and is contained in a single file, [`Ikarus.d`](https://github.com/Lehona/Ikarus/blob/master/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`

Expand Down
2 changes: 1 addition & 1 deletion docs/zengin/scripts/extenders/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Daedalus extenders
The default scripting language Daedalus can be quite limiting. Over the years the community created quite a few extenders to, well, extend the functionality. Before Union came along, the standard to interface with the engine was the script library [Ikarus](ikarus/index.md) and a collection of packages [LeGo](lego/index.md) built on top of that. Not so recently, an additional script packet was made (and is actively being worked on) [AF Script Packet](afsp/index.md) that offers even more functionality and is built on tom of Ikarus & LeGo.
The default scripting language Daedalus can be quite limiting. Over the years the community created quite a few extenders to, well, extend the functionality. Before Union came along, the standard to interface with the engine was the script library [Ikarus](ikarus/index.md) and a collection of packages [LeGo](lego/index.md) built on top of that. Not so recently, an additional script packet was made (and is actively being worked on) [AF Script Packet](afsp/index.md) that offers even more functionality and is built on top of Ikarus & LeGo.
With the adoption of Union and plugins the Union system can use a new extender emerged called [zParserExtender](zparserextender/index.md). Other Union plugins can, of course, implement their own external functions.
A lot of scripts are also scattered on the Gothic forums, and documentation of some of them can be found in the [Standalone](standalone/index.md) section.
7 changes: 6 additions & 1 deletion docs/zengin/scripts/extenders/lego/tools/permmem.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func int numHandles()
```

### `sizeof`
Returns Size of the instance's class in bytes
Gets the size of the given instance's class.
```dae
func int sizeof(var int inst)
```
Expand All @@ -162,6 +162,10 @@ func int sizeof(var int inst)
- `#!dae var int inst`
Any instance

**Return value**

The function returns the size of a given instance's class in bytes.

### `Hlp_IsValidHandle`
Indicates whether the handle exists and is managed by PermMem.
```dae
Expand Down Expand Up @@ -242,6 +246,7 @@ func int PM_Exists(var string name)
Name of the field

**Return value**

The function returns `TRUE` if the field exists in the archive, `FALSE` is returned otherwise.

## Archiver
Expand Down
2 changes: 1 addition & 1 deletion docs/zengin/scripts/extenders/lego/tools/string_builder.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: StringBuilder
description: LeGo package for working with the 2D interface
description: LeGo package for creating strings without using a 'ConcatStrings' function
---
# StringBuilder
The StringBuilder is a package, designed to easily concatenate multiple elements into a string (without `ConcatStrings` and `IntToString`).
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ plugins:
Functions: Funkcje
General info: Informacje ogólne
Home: Strona Główna
Plugins: Wtyczki
Plugins: Pluginy
Scripts: Skrypty
Sound: Dźwięk
Standalone: Samodzielne
Expand Down

0 comments on commit 937a20a

Please sign in to comment.