From a78cc6d489b06e9d306150e3157b04465b93bd97 Mon Sep 17 00:00:00 2001 From: Mateusz Uczciwek Date: Sun, 26 Nov 2023 14:24:34 +0100 Subject: [PATCH] Update links and correct mistakes --- .../extenders/ikarus/functions/objects.md | 18 ++++---- .../lego/applications/console_commands.md | 4 +- .../lego/applications/console_commands.pl.md | 6 +-- .../lego/applications/gamestate.pl.md | 6 +-- .../lego/applications/trialoge.pl.md | 10 ++--- .../scripts/extenders/lego/tools/misc.md | 44 +++++++++---------- .../scripts/extenders/lego/tools/misc.pl.md | 44 +++++++++---------- .../scripts/extenders/lego/tools/view.md | 34 +++++++++++++- .../zparserextender/classes/helperclasses.md | 2 +- .../syntax_extensions/while.md | 2 +- .../syntax_extensions/while.pl.md | 2 +- docs/zengin/worlds/spacer.md | 23 +--------- 12 files changed, 102 insertions(+), 93 deletions(-) diff --git a/docs/zengin/scripts/extenders/ikarus/functions/objects.md b/docs/zengin/scripts/extenders/ikarus/functions/objects.md index aec329ad62..3893eae462 100644 --- a/docs/zengin/scripts/extenders/ikarus/functions/objects.md +++ b/docs/zengin/scripts/extenders/ikarus/functions/objects.md @@ -171,7 +171,7 @@ The usage of these functions is probably obvious, they checks if the given objec Inserts a Vob with the visual `vis` at the waypoint `wp`. If the visual or waypoint does not exist, this is the behaviour this function undefined. !!! Note - The inserted Vob is even an `oCMob`, so it can be given a focus name, for example. But you can treat it like a `zCVob`, if you don't need the additional properties. + The inserted Vob is even an `oCMob`, so it can be given a focus name, for example. But you can treat it like a [`zCVob`](../../../../worlds/Classes/zCVob.md)), if you don't need the additional properties. ```dae func int MEM_InsertVob(var string vis, var string wp) ``` @@ -194,7 +194,7 @@ func void MEM_DeleteVob(var int vobPtr) **Parameters** - `#!dae var int vobPtr` - Pointer to a `zCVob` object to be deleted + Pointer to a [`zCVob`](./../../../worlds/Classes/zCVob.md) object to be deleted ### `MEM_RenameVob` Renames the passed Vob to the `newName` that is also passed. @@ -206,7 +206,7 @@ func void MEM_RenameVob(var int vobPtr, var string newName) **Parameters** - `#!dae var int vobPtr` - Pointer to a `zCVob` object to be renamed + Pointer to a [`zCVob`](./../../../worlds/Classes/zCVob.md) object to be renamed - `#!dae var string newName` The new Name of the Vob @@ -220,7 +220,7 @@ func void MEM_RenameVob(var int vobPtr, var string newName) **Parameters** - `#!dae var int vobPtr` - Pointer to a triggered `zCVob` + Pointer to a triggered [`zCVob`](./../../../worlds/Classes/zCVob.md) !!! Danger If triggering the Vob has immediate effects (even before MEM_TriggerVob is exited), the name of the Vob is corrupted during this time. It is not advisable to rename, trigger again or destroy the object at this moment, the behavior in such cases is untested. @@ -234,24 +234,24 @@ func void MEM_RenameVob(var int vobPtr, var string newName) **Parameters** - `#!dae var int vobPtr` - Pointer to an untriggered `zCVob` + Pointer to an untriggered [`zCVob`](./../../../worlds/Classes/zCVob.md) !!! Danger If untriggering the Vob has immediate effects (even before MEM_TriggerVob is exited), the name of the Vob is corrupted during this time. It is not advisable to rename, trigger again or destroy the object at this moment, the behavior in such cases is untested. ### `MEM_SearchVobByName` -Returns the address of a `zCVob` named `str` if such a Vob exists. +Returns the address of a [`zCVob`](./../../../worlds/Classes/zCVob.md) named `str` if such a Vob exists. ```dae func int MEM_SearchVobByName(var string str) ``` **Parameters** - `#!dae var string str` - Name of searched `zCVob` + Name of searched [`zCVob`](./../../../worlds/Classes/zCVob.md) **Return value** -The function returns a pointer to the `zCVob` if the object with the given name exist. `0` is returned otherwise. +The function returns a pointer to the [`zCVob`](./../../../worlds/Classes/zCVob.md) if the object with the given name exist. `0` is returned otherwise. ### `MEM_SearchAllVobsByName` @@ -262,7 +262,7 @@ func int MEM_SearchAllVobsByName(var string str) **Parameters** - `#!dae var string str` - Name of searched `zCVob` + Name of searched [`zCVob`](./../../../worlds/Classes/zCVob.md) **Return value** diff --git a/docs/zengin/scripts/extenders/lego/applications/console_commands.md b/docs/zengin/scripts/extenders/lego/applications/console_commands.md index 40e8fd8dc2..89f6abc7f8 100644 --- a/docs/zengin/scripts/extenders/lego/applications/console_commands.md +++ b/docs/zengin/scripts/extenders/lego/applications/console_commands.md @@ -58,7 +58,7 @@ The function returns `TRUE` if there is a corresponding function, `FALSE` is ret ## Examples ### Basic command example -As a basic example - let us create a version command, which prints a version of our modification. +As a basic example - let us create a **version** command, which prints a version of our modification. Firstly, we declare a constant `string` variable to hold the version string to be shown. ```dae const string Mod_Version = "My mod version 0.1alpha"; @@ -78,7 +78,7 @@ We then have to register the functions. For convenience, I created a new `Regist ```dae func void RegisterConsoleFunctions() { - CC_Register (CC_ModVersion, "mod_version", "Version of my amazing mod."); + CC_Register (CC_ModVersion, "version", "Version of my amazing mod."); }; ``` Lastly, we have to call this function from `INIT_GLOBAL` function. diff --git a/docs/zengin/scripts/extenders/lego/applications/console_commands.pl.md b/docs/zengin/scripts/extenders/lego/applications/console_commands.pl.md index f16c9d240f..cbb7329754 100644 --- a/docs/zengin/scripts/extenders/lego/applications/console_commands.pl.md +++ b/docs/zengin/scripts/extenders/lego/applications/console_commands.pl.md @@ -61,7 +61,7 @@ Funkcja zwraca `TRUE` jeśli znajdzie odpowiednią funkcję, inaczej `FALSE`. ## Przykłady ### Proste polecenie konsoli -Jako prosty przykład stwórzmy polecenie version, które wyświetli nam wersję modyfikacji. +Jako prosty przykład stwórzmy polecenie **version**, które wyświetli nam wersję modyfikacji. Po pierwsze, deklarujemy stałą zmienną `string` do przechowywania informacji o wersji. ```dae const string Mod_Version = "Wersja modyfikacji - 0.1alpha"; @@ -69,7 +69,7 @@ const string Mod_Version = "Wersja modyfikacji - 0.1alpha"; Następnie tworzymy nową funkcję. !!! Note - Zwróć uwagę na poprawną sygnaturę funkcji. Jeśli nie będzie błędna, polecenie spowoduje awarię gry. + Zwróć uwagę na poprawną sygnaturę funkcji. Jeśli będzie ona błędna, polecenie spowoduje awarię gry. ```dae // Ta funkcja jest wywoływana przez nasze nowe polecenie @@ -82,7 +82,7 @@ Następnie musimy zarejestrować polecenie. Dla wygody stworzyłem nową funkcj ```dae func void RegisterConsoleFunctions() { - CC_Register (CC_ModVersion, "wersja_moda", "Wersja mojej modyfikacji."); + CC_Register (CC_ModVersion, "version", "Wersja mojej modyfikacji."); }; ``` Na koniec musimy wywołać tę funkcję w `INIT_GLOBAL`. diff --git a/docs/zengin/scripts/extenders/lego/applications/gamestate.pl.md b/docs/zengin/scripts/extenders/lego/applications/gamestate.pl.md index 806931e79c..372894133f 100644 --- a/docs/zengin/scripts/extenders/lego/applications/gamestate.pl.md +++ b/docs/zengin/scripts/extenders/lego/applications/gamestate.pl.md @@ -42,7 +42,7 @@ func void Gamestate_RemoveListener(var func listener) ## Przykłady Istnieją teraz dwie możliwości. Wszystko można zrobić bezpośrednio w `Init_Global` lub za pomocą [EventHandler](../tools/event_handler.md). -### `Init_Global` +### Init_Global ```dae func void Init_Global() { @@ -69,8 +69,6 @@ func void Init_Global() }; ``` -Może to być przydatne podczas pracy z PermMem, gdzie obiekty PermMem nie muszą być odtwarzane po załadowaniu gry. - Można to również zrobić tak: ```dae func void Init_Global() @@ -99,7 +97,7 @@ func void Init_Global() }; ``` -### EventHandler - obsługa zdarzeń +### EventHandler ```dae func void Init_Global() { diff --git a/docs/zengin/scripts/extenders/lego/applications/trialoge.pl.md b/docs/zengin/scripts/extenders/lego/applications/trialoge.pl.md index 06a9f8852f..4f2c3640c9 100644 --- a/docs/zengin/scripts/extenders/lego/applications/trialoge.pl.md +++ b/docs/zengin/scripts/extenders/lego/applications/trialoge.pl.md @@ -114,7 +114,7 @@ Resetuje kamery dialogowe do ustawień domyślnych. func void DiaCAM_Enable() ``` ### `TRIA_Wait` -Makes `self` and `other` wait for each other, e.g. for `AI_GotoWP` actions for synchronization. +Sprawia że `self` i `other` czekają na siebie, np. podaczas dla synchronizacji po wywołaniu `AI_GotoWP`. ```dae func void TRIA_Wait() ``` @@ -167,10 +167,10 @@ Kończy trwający trialog. Musi być zawsze wywoływana na końcu, w przeciwnym func void TRIA_Finish() ``` -## Examples +## Przykłady -### A Simple Trialogue -The following conversation is resolved via the trialogues: +### Prosty Trialog +Poniższa konwersacja zostanie zaimplementowana za pomocą trialogów: 1. **Arto:** Wybacz bohaterze, ale nie możesz tędy przejść. 2. **Bohater:** Dlaczego nie? @@ -271,4 +271,4 @@ func void TRIA_Test_info() }; ``` !!! Note - In addition, here are still [Dialoggestures](dialoggestures.md) used. + Dodatkowo w powyższym przykładzie użyty jest też pakiet [Dialoggestures](dialoggestures.md). diff --git a/docs/zengin/scripts/extenders/lego/tools/misc.md b/docs/zengin/scripts/extenders/lego/tools/misc.md index 29f17b1cd3..cfa99abc9b 100644 --- a/docs/zengin/scripts/extenders/lego/tools/misc.md +++ b/docs/zengin/scripts/extenders/lego/tools/misc.md @@ -29,7 +29,7 @@ Decimal: `1.5707...` ### `atan2f` Calculates the arcus tangent of an angle between the origin and (x, y) point. ```dae -func float atan2f(var int x, var int y) +func int atan2f(var int x, var int y) ``` **Parameters** @@ -45,73 +45,73 @@ The function returns arcus tangent in radians as Ikarus `float`. ### `sin` Calculates the sine of an angle given in radians. ```dae -func float sin(var float angle) +func int sin(var int angle) ``` **Parameters** -- `#!dae var float angle` +- `#!dae var int angle` The angle in radians as a Ikarus `float` **Return value** -The function returns sine of the angle. +The function returns sine of the angle as Ikarus `float`. ### `cos` Calculates the cosine of an angle given in radians. ```dae -func float cos(var float angle) +func int cos(var int angle) ``` **Parameters** -- `#!dae var float angle` +- `#!dae var int angle` The angle in radians as a Ikarus `float` **Return value** -The function returns cosine of the angle. +The function returns cosine of the angle as Ikarus `float`. ### `tan` Calculates the tangent of an angle given in radians. ```dae -func float tan(var float angle) +func int tan(var int angle) ``` **Parameters** -- `#!dae var float angle` +- `#!dae var int angle` The angle in radians as a Ikarus `float` **Return value** -The function returns tangent of the angle. +The function returns tangent of the angle as Ikarus `float`. ### `asin` -Calculates the arcus sine +Calculates the arcus sine. ```dae -func float asin(var float sine) +func int asin(var int sine) ``` **Parameters** -- `#!dae var float sine` +- `#!dae var int sine` The sine of an angle as a Ikarus `float` **Return value** -The function returns arcus sine of the angle. +The function returns arcus sine of the angle as Ikarus `float`. ### `acos` Calculates the arcus cosine ```dae -func float acos(var float cosine) +func int acos(var int cosine) ``` **Parameters** -- `#!dae var float cosine` +- `#!dae var int cosine` The cosine of an angle as a Ikarus `float` **Return value** -The function returns arcus cosine of the angle. +The function returns arcus cosine of the angle as Ikarus `float`. ### `distance2D` @@ -137,17 +137,17 @@ The function returns the distance between the two points. ### `distance2Df` Calculates the distance between two points on a two-dimensional plane but parameters and return values are Ikarus `floats`. ```dae -func float distance2Df(var float x1, var float x2, var float y1, var float y2) +func int distance2Df(var int x1, var int x2, var int y1, var int y2) ``` **Parameters** -- `#!dae var float x1` +- `#!dae var int x1` X-coordinate of the first point -- `#!dae var float x2` +- `#!dae var int x2` X-coordinate of the second point -- `#!dae var float y1` +- `#!dae var int y1` Y-coordinate of the first point -- `#!dae var float y2` +- `#!dae var int y2` Y-coordinate of the second point **Return value** diff --git a/docs/zengin/scripts/extenders/lego/tools/misc.pl.md b/docs/zengin/scripts/extenders/lego/tools/misc.pl.md index fc270f377c..15cf87044e 100644 --- a/docs/zengin/scripts/extenders/lego/tools/misc.pl.md +++ b/docs/zengin/scripts/extenders/lego/tools/misc.pl.md @@ -29,7 +29,7 @@ Decymalnie: `1.5707...` ### `atan2f` Oblicza arcus tangens kąta między początkiem a punktem (x, y). ```dae -func float atan2f(var int x, var int y) +func int atan2f(var int x, var int y) ``` **Parametry** @@ -40,78 +40,78 @@ func float atan2f(var int x, var int y) **Zwracana wartość** -Funkcja zwraca arcus tangens w radianach jako ikarusowy `float` +Funkcja zwraca arcus tangens w radianach, jako ikarusowy `float`. ### `sin` Oblicza sinus kąta podanego w radianach. ```dae -func float sin(var float angle) +func int sin(var int angle) ``` **Parametry** -- `#!dae var float angle` +- `#!dae var int angle` Kąt w radianach jako ikarusowy `float` **Zwracana wartość** -Funkcja zwraca sinus kąta. +Funkcja zwraca sinus kąta, jako ikarusowy `float`. ### `cos` Oblicza cosinus kąta podanego w radianach. ```dae -func float cos(var float angle) +func int cos(var int angle) ``` **Parametry** -- `#!dae var float angle` +- `#!dae var int angle` Kąt w radianach jako ikarusowy `float` **Zwracana wartość** -Funkcja zwraca cosinus kąta. +Funkcja zwraca cosinus kąta, jako ikarusowy `float`. ### `tan` Oblicza tangens kąta podanego w radianach. ```dae -func float tan(var float angle) +func int tan(var int angle) ``` **Parametry** -- `#!dae var float angle` +- `#!dae var int angle` Kąt w radianach jako ikarusowy `float` **Zwracana wartość** -Funkcja zwraca tangens kąta. +Funkcja zwraca tangens kąta, jako ikarusowy `float`. ### `asin` Oblicza arcus sinus ```dae -func float asin(var float sine) +func int asin(var int sine) ``` **Parametry** -- `#!dae var float sine` +- `#!dae var int sine` Sinus kąta jako ikarusowy `float` **Zwracana wartość** -Funkcja zwraca arcus sinus kąta. +Funkcja zwraca arcus sinus kąta, jako ikarusowy `float`. ### `acos` Oblicza arcus cosinus ```dae -func float acos(var float cosine) +func int acos(var int cosine) ``` **Parametry** -- `#!dae var float cosine` +- `#!dae var int cosine` Cosinus kąta jako ikarusowy `float` **Zwracana wartość** -Funkcja zwraca arcus cosinus kąta. +Funkcja zwraca arcus cosinus kąta, jako ikarusowy `float`. ### `distance2D` @@ -138,17 +138,17 @@ Funkcja zwraca odległość między dwoma punktami. ### `distance2Df` Oblicza odległość między dwoma punktami na płaszczyźnie dwuwymiarowej, ale na liczbach zmiennoprzecinkowych (float). ```dae -func float distance2Df(var float x1, var float x2, var float y1, var float y2) +func int distance2Df(var int x1, var int x2, var int y1, var int y2) ``` **Parametry** -- `#!dae var float x1` +- `#!dae var int x1` współrzędna x pierwszego punktu -- `#!dae var float x2` +- `#!dae var int x2` współrzędna x drugiego punktu -- `#!dae var float y1` +- `#!dae var int y1` współrzędna y pierwszego punktu -- `#!dae var float y2` +- `#!dae var int y2` współrzędna y drugiego punktu **Zwracana wartość** diff --git a/docs/zengin/scripts/extenders/lego/tools/view.md b/docs/zengin/scripts/extenders/lego/tools/view.md index ed8e9ae17b..2ae1886825 100644 --- a/docs/zengin/scripts/extenders/lego/tools/view.md +++ b/docs/zengin/scripts/extenders/lego/tools/view.md @@ -320,4 +320,36 @@ func void View_Top(var int hndl) **Parameters** - `#!dae var int hndl` - Handle created with [`View_Create`](#view_get) \ No newline at end of file + Handle created with [`View_Create`](#view_get) + + +## Examples + +### Display a texture on the screen +Here a texture should be displayed over the entire screen: +```dae +func void Example1() { + var int View; + View = View_Create(0, 0, PS_VMax, PS_VMax); // Virtual coordinates + View_SetTexture(View, "MyTexture.tga"); // Assign a texture to the view + // display the view on the screen: + View_Open(View); +}; +``` + +This would mean that the texture would be permanently visible on the screen (even after loading/saving/restarting). +If we want it to disappear we have to use either [`View_Delete`](#view_delete) or [`View_Close`](#view_close). + +### Display a texture with pixel coordinates +Now a texture should be displayed at the top right and be 256 x 256 pixels in size: +```dae +func void Example2() { + Print_GetScreenSize(); + var int View; + View = View_CreatePxl(Print_Screen[PS_X] - 256, 0, Print_Screen[PS_X], 256); // Pixel coordinates + View_SetTexture(View, "MYTEXTURE.TGA"); + View_Open(View); +}; +``` + +To get the size of the screen we use the [interface](interface.md) package. \ No newline at end of file diff --git a/docs/zengin/scripts/extenders/zparserextender/classes/helperclasses.md b/docs/zengin/scripts/extenders/zparserextender/classes/helperclasses.md index f0e7427039..796f5c2278 100644 --- a/docs/zengin/scripts/extenders/zparserextender/classes/helperclasses.md +++ b/docs/zengin/scripts/extenders/zparserextender/classes/helperclasses.md @@ -47,7 +47,7 @@ func void Vob_SetVobPosition( var C_Vob vob, var C_Position pos ) {}; The following classes define properties of `C_VOB` objects or classes derived from it. ## C_VOB_DATA -Represents universal `zCVob` class +Represents universal [`zCVob`](../../../../worlds/Classes/zCVob.md) class ```dae class C_VOB_DATA { diff --git a/docs/zengin/scripts/extenders/zparserextender/syntax_extensions/while.md b/docs/zengin/scripts/extenders/zparserextender/syntax_extensions/while.md index 0dd891dc07..447bcd0cba 100644 --- a/docs/zengin/scripts/extenders/zparserextender/syntax_extensions/while.md +++ b/docs/zengin/scripts/extenders/zparserextender/syntax_extensions/while.md @@ -2,7 +2,7 @@ title: While loop --- # Native WHILE loop -Just like [Ikarus](../../../../../notready.md) zParserExtender implements a while loop. +Just like [Ikarus](../../ikarus/functions/jumps_loops.md#while-loop) zParserExtender implements a while loop. ```dae var int value; value = 10; diff --git a/docs/zengin/scripts/extenders/zparserextender/syntax_extensions/while.pl.md b/docs/zengin/scripts/extenders/zparserextender/syntax_extensions/while.pl.md index 1bea568840..1a37665b11 100644 --- a/docs/zengin/scripts/extenders/zparserextender/syntax_extensions/while.pl.md +++ b/docs/zengin/scripts/extenders/zparserextender/syntax_extensions/while.pl.md @@ -2,7 +2,7 @@ title: Pętla while --- # Natywna pętla WHILE -Podobnie jak [Ikarus](../../../../../notready.md) zParserExtender implementuje pętlę while. +Podobnie jak [Ikarus](../../ikarus/functions/jumps_loops.md#while-loop) zParserExtender implementuje pętlę while. ```dae var int value; value = 10; diff --git a/docs/zengin/worlds/spacer.md b/docs/zengin/worlds/spacer.md index 7975c052ba..3449773a74 100644 --- a/docs/zengin/worlds/spacer.md +++ b/docs/zengin/worlds/spacer.md @@ -103,28 +103,7 @@ This section covers some of the basic things done in the editor. ### Common VOB settings -VOB settings vary depending on what the VOB type is. They all have common parameters of the base VOB class though: - -- vobName: an identifier shown in the editor and sometimes used in scripts. With some VOB types it's important to set this; for example waypoints and freepoints. -- visual: the mesh of the VOB -- showVisual: as the name suggests. Unknown usage. -- visualCamAlign: Unknown usage, possibly related to cutscenes. -- visualAniMode: Wind sway animation setting. -- visualAniModeStrength: a multiplier for the animation; small values such as `0.001` are typically used. -- vobFarClipZScale: a multiplier for the occlusion culling distance. Almost always left as 1, but it can be used to stop models from appearing from thin air in plain sight; e.g. a VOB of a hut which can be seen from afar might benefit from increasing this distance. The effects of this are visible in the editor. -- cdStatic: determines if the VOB will collide with the world mesh and other VOBs with `cdStatic` on. This is mostly used to help with placing objects in the editor, e.g. furniture. -- cdDyn: determines if the VOB will collide with dynamic objects (NPCs, items, etc.). This basically determines if the object has collision during gameplay. - -!!! warning - Both collision settings affect your ability to move VOBs. This can be either useful or disruptive depending on what you want to do. For example, if you want to clip a mesh with another one, you will need to disable collision and re-enable it after putting it in place. - -- staticVob: determines if the VOB is taken into consideration in static lighting calculations. Usually enabled in decorative VOBs, but some of the interactive ones have it disabled. -- dynShadow: seems to determine if the object will cast a shadow when affected by dynamic light (e.g. torches). -- zbias: Usage unknown. -- isAmbient: Usage unknown. - -!!! tip - One of the best ways of learning how to set up various VOBs is opening one of the original maps and checking the type and configuration of the related VOBs. Some things will require scripting to accomplish, however. +VOB settings vary depending on what the VOB type is. They all have common parameters of the base VOB class though. The full descripton of a zCVob class can be found [here](Classes/zCVob.md). ## Issues