diff --git a/docs/Modding/guides/contributing.md b/docs/Modding/guides/contributing.md index 2de7dea4..ae762765 100644 --- a/docs/Modding/guides/contributing.md +++ b/docs/Modding/guides/contributing.md @@ -13,7 +13,7 @@ Including: The Northstar modding documentation uses [Markdown](https://en.wikipedia.org/wiki/Markdown). -The ``.md`` files can be found in the ``docs/source`` directory. +The `.md` files can be found in the `docs/source` directory. ## Contributing without a local build diff --git a/docs/Modding/guides/gettingstarted.md b/docs/Modding/guides/gettingstarted.md index 484b5608..441abca1 100644 --- a/docs/Modding/guides/gettingstarted.md +++ b/docs/Modding/guides/gettingstarted.md @@ -20,14 +20,14 @@ Check out the `tools` section for more information. ## Quick Start -In order to get started with making your mod, create a folder in ``R2Northstar/mods``. +In order to get started with making your mod, create a folder in `R2Northstar/mods`. While it isn't required, it is best practise by mod authors to follow the naming scheme -``Author.ModName``, such as ``Northstar.Client``. +`Author.ModName`, such as `Northstar.Client`. -After making this folder, inside it add a folder named ``mod`` and a file named -``mod.json``. +After making this folder, inside it add a folder named `mod` and a file named +`mod.json`. -Provided is a template ``mod.json``, for a detailed list of values read the +Provided is a template `mod.json`, for a detailed list of values read the `cheatsheet` ```json @@ -43,9 +43,9 @@ Provided is a template ``mod.json``, for a detailed list of values read the } ``` -Inside the ``mod`` folder, existing files found in the engine's virtual file system will +Inside the `mod` folder, existing files found in the engine's virtual file system will be overwritten and new files can be added. If you need to define new Squirrel files -``(.nut/.gnut)`` they *must* be declared in the ``"Scripts"`` array in `mod.json`. An +`(.nut/.gnut)` they *must* be declared in the `"Scripts"` array in `mod.json`. An example for this might be: ```json @@ -70,21 +70,21 @@ example for this might be: ] ``` -``"Path"`` indicates where the script is, ``"RunOn"`` is the Squirrel VM context (see -`../native/sqvm`) as an expression, and ``"ClientCallback"`` and -``"ServerCallback"`` specify a function call that can be ``"Before"`` and/or ``"After"`` +`"Path"` indicates where the script is, `"RunOn"` is the Squirrel VM context (see +`../native/sqvm`) as an expression, and `"ClientCallback"` and +`"ServerCallback"` specify a function call that can be `"Before"` and/or `"After"` map-spawn. -## Detailed ``mod.json`` architecture +## Detailed `mod.json` architecture -Located at your mod's root folder, the ``mod.json`` file is the entrypoint of your mod; +Located at your mod's root folder, the `mod.json` file is the entrypoint of your mod; it contains human-readable information about it, which scripts to load, and a bunch of interesting stuff. -This guide will dig into each of the possible ``mod.json`` fields. Please note that -``mod.json`` keys must start with an uppercase letter. +This guide will dig into each of the possible `mod.json` fields. Please note that +`mod.json` keys must start with an uppercase letter. -This is what a well-formatted ``mod.json`` looks like: +This is what a well-formatted `mod.json` looks like: ```json @@ -121,30 +121,30 @@ This is what a well-formatted ``mod.json`` looks like: !!! note - The real ``Northstar.CustomServers`` mod contains more convars and scripts, some + The real `Northstar.CustomServers` mod contains more convars and scripts, some have been removed for the readability of the example. ### Name and description Those ones are pretty self-explanatory. Both fields are used by Northstar itself to -display in-game information about your mod in the main screen ``Mods`` menu. +display in-game information about your mod in the main screen `Mods` menu. -Best pratice for your mod's name is to use the ``Author.ModName`` convention. +Best pratice for your mod's name is to use the `Author.ModName` convention. ### Version -This field specifies version of your mod using ``X.Y.Z`` scheme; this field must be +This field specifies version of your mod using `X.Y.Z` scheme; this field must be updated each time you release a new version of your mod. -Common use is to increase *Z* when you publish a fix (*e.g.* ``1.5.0`` to ``1.5.1``), -and increase *Y* when you release new features (*e.g.* ``1.5.1`` to ``1.6.0``). +Common use is to increase *Z* when you publish a fix (*e.g.* `1.5.0` to `1.5.1`), +and increase *Y* when you release new features (*e.g.* `1.5.1` to `1.6.0`). Best practise is to follow semantic versioning (https://semver.org/). ### LoadPriority This field defines the order in which all mods will be loaded by Northstar. For example, -a mod with ``"LoadPriority": 1`` will be loaded after a mod with ``"LoadPriority": 0``. +a mod with `"LoadPriority": 1` will be loaded after a mod with `"LoadPriority": 0`. If your mod uses code from another mod, make sure to set a greater LoadPriority than the mod you're using code from. @@ -154,13 +154,13 @@ mod you're using code from. This field lists configuration variables, that can be set by servers owners to modify behaviour of your mod. -Each configuration variable must have a ``"Name"`` and a ``"DefaultValue"``. ConVars can -also have an optional ``"Flags"`` field which specifies special behaviour and an -optional ``"HelpString"`` field which specifies the usage of the ConVar which can be -view in-game by running ``help ``. +Each configuration variable must have a `"Name"` and a `"DefaultValue"`. ConVars can +also have an optional `"Flags"` field which specifies special behaviour and an +optional `"HelpString"` field which specifies the usage of the ConVar which can be +view in-game by running `help `. -You can access configuration variables from squirrel code using ``GetConVarInt``, -``GetConVarFloat``, ``GetConVarBool`` or ``GetConVarString`` calls. +You can access configuration variables from squirrel code using `GetConVarInt`, +`GetConVarFloat`, `GetConVarBool` or `GetConVarString` calls. !!! warning @@ -170,8 +170,8 @@ You can access configuration variables from squirrel code using ``GetConVarInt`` #### Example If I don't want to wait 15 seconds for matches to start on my server, -``Northstar.CustomServers`` mod exposes a ConVar named -``ns_private_match_countdown_length`` in its ``mod.json`` manifesto: +`Northstar.CustomServers` mod exposes a ConVar named +`ns_private_match_countdown_length` in its `mod.json` manifesto: ```json @@ -185,11 +185,11 @@ If I don't want to wait 15 seconds for matches to start on my server, ] ``` -I can setup the ``ns_private_match_countdown_length`` variable in my -``R2Northstar/mods/Northstar.CustomServers/mod/cfg/autoexec_ns_server.cfg`` +I can setup the `ns_private_match_countdown_length` variable in my +`R2Northstar/mods/Northstar.CustomServers/mod/cfg/autoexec_ns_server.cfg` configuration file. -When starting a match, ``Northstar.CustomServers`` mod will retrieve the configuration +When starting a match, `Northstar.CustomServers` mod will retrieve the configuration variable value, or its default value if it hasn't been specified in configuration file: ```squirrel @@ -200,7 +200,7 @@ variable value, or its default value if it hasn't been specified in configuratio !!! note - All ``Northstar.CustomServers`` ConVars are listed here: + All `Northstar.CustomServers` ConVars are listed here: https://r2northstar.gitbook.io/r2northstar-wiki/hosting-a-server-with-northstar/basic-listen-server #### Flags @@ -275,7 +275,7 @@ Each script entry must have a "Path" value and a "RunOn" value. #### Path -Path of the Squirrel file to import, without ``mod/scripts/vscripts`` prefix (that's +Path of the Squirrel file to import, without `mod/scripts/vscripts` prefix (that's where your script files should go). #### RunOn @@ -295,15 +295,15 @@ A boolean expression which tells the game when and in which context to compile t |MAP_mp_box|True if the given map name is being loaded| |GAMEMODE_at|True if the given game mode is being loaded| -``CLIENT && !LOBBY`` - Compiles on client and not in the lobby. So during actual singeplayer and multiplayer gameplay. +`CLIENT && !LOBBY` - Compiles on client and not in the lobby. So during actual singeplayer and multiplayer gameplay. -``CLIENT && MP && !LOBBY`` - Compiles on client, only in multiplayer and not in the lobby. +`CLIENT && MP && !LOBBY` - Compiles on client, only in multiplayer and not in the lobby. -``( CLIENT || SERVER ) && MP`` - Compiles on both client and server only in multiplayer. +`( CLIENT || SERVER ) && MP` - Compiles on both client and server only in multiplayer. -``CLIENT && SP && MAP_sp_boomtown`` - Compiles only on client in singleplayer only when the map ``sp_boomtown`` is loaded. ( Here ``SP`` isn't needed as ``sp_boomtown`` is singleplayer only ) +`CLIENT && SP && MAP_sp_boomtown` - Compiles only on client in singleplayer only when the map `sp_boomtown` is loaded. ( Here `SP` isn't needed as `sp_boomtown` is singleplayer only ) -``CLIENT && GAMEMODE_aitdm`` - Compiles on client on both singleplayer and multiplayer only when the ``aitdm`` gamemode is set. ( ``aitdm`` is attrition which is multiplayer only so this script only compiles on multiplayer ) +`CLIENT && GAMEMODE_aitdm` - Compiles on client on both singleplayer and multiplayer only when the `aitdm` gamemode is set. ( `aitdm` is attrition which is multiplayer only so this script only compiles on multiplayer ) #### ClientCallback / ServerCallback diff --git a/docs/Modding/guides/keyvalue/crosshairmodding.md b/docs/Modding/guides/keyvalue/crosshairmodding.md index 9ccc9176..bc9a66a2 100644 --- a/docs/Modding/guides/keyvalue/crosshairmodding.md +++ b/docs/Modding/guides/keyvalue/crosshairmodding.md @@ -6,7 +6,7 @@ Example Mod: ## How To Modify Crosshairs: 1: Create the following file -``~/Your.Mod/keyvalues/scripts/weapons/mp_weapon_[desired weapon].txt`` +`~/Your.Mod/keyvalues/scripts/weapons/mp_weapon_[desired weapon].txt` 2: Put the following into the newly created .txt file: @@ -67,7 +67,7 @@ formating in the script above.** ## Adjust Crosshair Spread? Simply add the following line below the "ui" line -``"base_spread" "3.0"`` +`"base_spread" "3.0"` Below the "ui" line, Like this: ``` @@ -122,11 +122,11 @@ https://noskill.gitbook.io/titanfall2/ ### Extra Info -* As with any mod, it is recommended to test this out in a private match first. Save any changes you made to the desired weapon's file and type ``reload`` in your console +* As with any mod, it is recommended to test this out in a private match first. Save any changes you made to the desired weapon's file and type `reload` in your console * Keep in mind that some weapons have animated or dynamic crosshairs. Weapons like the Charge Rifle, Cold War, Frag Grenade, etc... have custom animations for their crosshairs. which can cause weirdness or jank when used on other weapons or when using other crosshairs on them. - * Animated weapons like the Charge rifle will work with animated crosshairs like ``ui/crosshair_titan_sniper`` + * Animated weapons like the Charge rifle will work with animated crosshairs like `ui/crosshair_titan_sniper` -Thank you to ``Cpone#0001`` and ``Nixie#8251`` from the [Northstar +Thank you to `Cpone#0001` and `Nixie#8251` from the [Northstar Discord](https://northstar.tf/discord) for helping me figure this out diff --git a/docs/Modding/guides/keyvalue/index.md b/docs/Modding/guides/keyvalue/index.md index cbf3a8d7..bd235a24 100644 --- a/docs/Modding/guides/keyvalue/index.md +++ b/docs/Modding/guides/keyvalue/index.md @@ -6,7 +6,7 @@ Do keep in mind that these are usually changed server-side. To actually change the keyvalues of weapons you'd have to name them appropriately inside a mod folder -For example: ``R2Northstar\mods\Northstar.Custom\keyvalues\scripts\weapons`` +For example: `R2Northstar\mods\Northstar.Custom\keyvalues\scripts\weapons` You can find all the weapon keyvalues [here](https://github.com/BigSpice/TitanFall_2_Weapon_Skin_Modding/tree/main/Weapon_Scripts) Example for modding crossshairs using keyvalues: [crosshairmodding](crosshairmodding.md) diff --git a/docs/Modding/guides/keyvalue/localisation.md b/docs/Modding/guides/keyvalue/localisation.md index 65e00720..59453a93 100644 --- a/docs/Modding/guides/keyvalue/localisation.md +++ b/docs/Modding/guides/keyvalue/localisation.md @@ -15,7 +15,7 @@ Languages natively supported by Titanfall2 are: - Portuguese - Russian - Spanish -- Traditional Chinese (``"tchinese"``) +- Traditional Chinese (`"tchinese"`) ## Create translation files @@ -38,24 +38,24 @@ Here's what a translation file looks like: } ``` -It begins with the ``"lang"`` instruction, contains a ``"Language"`` key indicating -language of current file's translations, and a ``"Token"`` key indexing all +It begins with the `"lang"` instruction, contains a `"Language"` key indicating +language of current file's translations, and a `"Token"` key indexing all translations. !!! warning - If the translation file contains any non-ASCII character, it must use ``"UTF-16 - LE"`` encoding. + If the translation file contains any non-ASCII character, it must use `"UTF-16 + LE"` encoding. You'll have to create one file per supported language, and all your files must be named in a similar fashion. For example, Northstar translation files are named -``"northstar_client_localisation_english.txt"``, -``"northstar_client_localisation_french.txt"``, -``"northstar_client_localisation_german.txt"`` etc. +`"northstar_client_localisation_english.txt"`, +`"northstar_client_localisation_french.txt"`, +`"northstar_client_localisation_german.txt"` etc. -You can import them from your ``mod.json`` manifesto this way: +You can import them from your `mod.json` manifesto this way: ```json @@ -68,14 +68,14 @@ You can import them from your ``mod.json`` manifesto this way: !!! note - The ``"%language%"`` syntax allows VM to load up translations matching game language + The `"%language%"` syntax allows VM to load up translations matching game language (e.g. an English client will automatically use - ``"northstar_client_localisation_english.txt"`` file) + `"northstar_client_localisation_english.txt"` file) ## Use translations in your code To translate UI elements like menus, you have to insert strings containing your -translation keys, preceded by a ``#``. +translation keys, preceded by a `#`. For example, to translate the "Launch Northstar" button on main menu, instead of calling: @@ -92,7 +92,7 @@ We'll use: AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_LAUNCH_NORTHSTAR" ) ``` -You can also use the ``Localize`` method client-side: +You can also use the `Localize` method client-side: ``` @@ -104,7 +104,7 @@ You can also use the ``Localize`` method client-side: Northstar adds new strings to the game which can be localised to match the language you are using on your Titanfall 2 installation. -They're all located in ``"Northstar.Client"`` mod: [Northstar localisation files on +They're all located in `"Northstar.Client"` mod: [Northstar localisation files on GitHub] (https://github.com/R2Northstar/NorthstarMods/blob/main/Northstar.Client/mod/resource) diff --git a/docs/Modding/guides/keyvalue/weaponkeyvalues.md b/docs/Modding/guides/keyvalue/weaponkeyvalues.md index 8a9a9513..0b48ea8d 100644 --- a/docs/Modding/guides/keyvalue/weaponkeyvalues.md +++ b/docs/Modding/guides/keyvalue/weaponkeyvalues.md @@ -6,7 +6,7 @@ Note that asset values are identical to strings in Key Value files. These can be modified with KeyValue modding, see here: [weaponmodding](broken) -The majority of these values are held in ``eWeaponVar``. Those that are can be modified with attachments (named "Mods" in Key Value files); otherwise, the game will crash with an "Unrecognized entry" error when Key Values are loaded. +The majority of these values are held in `eWeaponVar`. Those that are can be modified with attachments (named "Mods" in Key Value files); otherwise, the game will crash with an "Unrecognized entry" error when Key Values are loaded. ## List of KeyValues diff --git a/docs/Modding/guides/publishing.md b/docs/Modding/guides/publishing.md index e1c007e9..45a4a2e0 100644 --- a/docs/Modding/guides/publishing.md +++ b/docs/Modding/guides/publishing.md @@ -2,8 +2,8 @@ ## Best practices -Make sure to name your mod in the form ``.``, similar to the existing default mods, like ``Northstar.Client``, ``Northstar.CusomServer``, -Note that the Northstar name (``Northstar.Xyz``) is reserved for mods that come with the Northstar install and should therefore **not** be used. +Make sure to name your mod in the form `.`, similar to the existing default mods, like `Northstar.Client`, `Northstar.CusomServer`, +Note that the Northstar name (`Northstar.Xyz`) is reserved for mods that come with the Northstar install and should therefore **not** be used. It is recommended to upload the source code of your mod to a public repository like [Github](https://github.com/) to give your users a place to suggest changes and leave feedback in an organised manner. @@ -34,11 +34,11 @@ The Thunderstore package zip structure is as follows: ``` -- ``icon.png``: 256x256px icon for your mod. -- ``README.md``: the description page for your mod -- ``manifest.json`` outlined [here](https://northstar.thunderstore.io/package/create/docs/) +- `icon.png`: 256x256px icon for your mod. +- `README.md`: the description page for your mod +- `manifest.json` outlined [here](https://northstar.thunderstore.io/package/create/docs/) -You can put multiple mods in the ``mods/`` folder, but only do this if neccessary. +You can put multiple mods in the `mods/` folder, but only do this if neccessary. `manifest.json` checker: [https://northstar.thunderstore.io/tools/manifest-v1-validator/](https://northstar.thunderstore.io/tools/manifest-v1-validator/) @@ -49,7 +49,7 @@ After you have set up the folder structure, head to [https://northstar.thunderst When uploading, it will verify your package structure and you can publish after it's successfully checked. -To update a mod, change the version in ``mod.json`` and ``manifest.json``, and upload again. If the mod name is the same, it will update the previous version. +To update a mod, change the version in `mod.json` and `manifest.json`, and upload again. If the mod name is the same, it will update the previous version. ## Github Workflows diff --git a/docs/Modding/guides/reversing/squirrelreversing.md b/docs/Modding/guides/reversing/squirrelreversing.md index 63080bb7..7fb9ea4e 100644 --- a/docs/Modding/guides/reversing/squirrelreversing.md +++ b/docs/Modding/guides/reversing/squirrelreversing.md @@ -17,26 +17,26 @@ Keep in mind that IDA is not open source and the free version is lacking a lot o 2. Unzip the archive in a new folder. -3. Run ``ghidraRun.bat`` on windows or if you're on Linux make ``ghidraRun`` executable and run it. On Linux, there's a [Flatpak image](https://flathub.org/apps/org.ghidra_sre.Ghidra) available as well. +3. Run `ghidraRun.bat` on windows or if you're on Linux make `ghidraRun` executable and run it. On Linux, there's a [Flatpak image](https://flathub.org/apps/org.ghidra_sre.Ghidra) available as well. -3. Create a new project under ``File > New Project`` and select ``Non-Shared Project``, then hit next. Afterwards select a location for the project and a name like ``Titanfall2``. +3. Create a new project under `File > New Project` and select `Non-Shared Project`, then hit next. Afterwards select a location for the project and a name like `Titanfall2`. -4. Import the binary you want to reverse with ``File > Import File``. This guide will use ``server.dll``, found in your Titanfall2 install directory. Don't change the settings ghidra auto detects when importing the file. +4. Import the binary you want to reverse with `File > Import File`. This guide will use `server.dll`, found in your Titanfall2 install directory. Don't change the settings ghidra auto detects when importing the file. -5. Open ``server.dll`` in the Ghidra project overview. When Ghidra asks you if you want to analyse the file now, click yes. You do not need to change any analysis settings. +5. Open `server.dll` in the Ghidra project overview. When Ghidra asks you if you want to analyse the file now, click yes. You do not need to change any analysis settings. 6. Wait for Ghidra to finish the analysis. ## Understanding native Squirrel Closures -In vanilla Squirrel you can push values with functions like ``sq_pushbool``. Since Respawn changed a lot in the SQVM, you should expect these API functions to be different as well. +In vanilla Squirrel you can push values with functions like `sq_pushbool`. Since Respawn changed a lot in the SQVM, you should expect these API functions to be different as well. -To start you'll need a simple Squirrel function that is executing native code without any calculations or similar, like ``IsServer``, or ``IsClient``. -These Squirrel functions are registered in native code and return ``true`` / ``false`` if the script VM is being ran in the ``SERVER`` or ``CLIENT``. +To start you'll need a simple Squirrel function that is executing native code without any calculations or similar, like `IsServer`, or `IsClient`. +These Squirrel functions are registered in native code and return `true` / `false` if the script VM is being ran in the `SERVER` or `CLIENT`. -You can search for a string in memory with ``Search > Memory``. Select ``String`` as the format you're searching for and enter ``IsServer`` as the search value. +You can search for a string in memory with `Search > Memory`. Select `String` as the format you're searching for and enter `IsServer` as the search value. -The first occurence is at ``server.dll+0x2b44f3``. If you wait for the function to be decompiled, you'll see the string in this code: +The first occurence is at `server.dll+0x2b44f3`. If you wait for the function to be decompiled, you'll see the string in this code: ```c @@ -53,7 +53,7 @@ The first occurence is at ``server.dll+0x2b44f3``. If you wait for the function _DAT_181055f9c = 6; ``` -Because the squirrel function executes native code, the callback ``FUN_18029a630`` is probably where it's located. You can double click the reference to decompile the function. +Because the squirrel function executes native code, the callback `FUN_18029a630` is probably where it's located. You can double click the reference to decompile the function. ```c @@ -72,8 +72,8 @@ Because the squirrel function executes native code, the callback ``FUN_18029a630 } ``` -From this you can assume that native closures in squirrel_re still use the ``SQRESULT`` convention, because the closure returns ``-1`` if ``FUN_18001d840`` returns ``NULL``, which is typically an error and ``1`` if nothing happens. -It's also obvious that either ``FUN_180003710`` or ``FUN_18001d840`` pushes a boolean to the stack. It's probably ``FUN_180003710`` because it takes an extra parameter but you can check ``IsClient`` at ``server.dll+0x29a4d0`` as a reference. +From this you can assume that native closures in squirrel_re still use the `SQRESULT` convention, because the closure returns `-1` if `FUN_18001d840` returns `NULL`, which is typically an error and `1` if nothing happens. +It's also obvious that either `FUN_180003710` or `FUN_18001d840` pushes a boolean to the stack. It's probably `FUN_180003710` because it takes an extra parameter but you can check `IsClient` at `server.dll+0x29a4d0` as a reference. ```c @@ -92,9 +92,9 @@ It's also obvious that either ``FUN_180003710`` or ``FUN_18001d840`` pushes a bo } ``` -This is virtually the same, except that ``FUN_180003710`` is being called with a ``0``. -This makes it pretty obvious that ``FUN_180003710`` is the equivalent of ``sq_pushbool``. -Decompile the function, then right click the function and select ``Edit Function Signature``. +This is virtually the same, except that `FUN_180003710` is being called with a `0`. +This makes it pretty obvious that `FUN_180003710` is the equivalent of `sq_pushbool`. +Decompile the function, then right click the function and select `Edit Function Signature`. Right now the signature looks like this: ```c @@ -102,11 +102,11 @@ Right now the signature looks like this: void FUN_180003710(longlong param_1, int param_2) ``` -``param_1`` has to be a pointer to the Squirrel VM, because a pointer on 64x systems is 8 bytes long (the same as ``longlong``) and the ``HSquirrelVM`` struct is larger than 8 bytes. +`param_1` has to be a pointer to the Squirrel VM, because a pointer on 64x systems is 8 bytes long (the same as `longlong`) and the `HSquirrelVM` struct is larger than 8 bytes. -The second parameter has to be the value that will be pushed to the VM as a boolean, since it was ``1`` in ``IsServer`` (which always returns ``true``) and ``0`` in ``IsClient`` which always returns ``false``. +The second parameter has to be the value that will be pushed to the VM as a boolean, since it was `1` in `IsServer` (which always returns `true`) and `0` in `IsClient` which always returns `false`. -You can change the signature now to this, to make code using the function more readable. Because ``HSquirrelVM`` isn't defined yet, the type needs to stay ``longlong`` for now. +You can change the signature now to this, to make code using the function more readable. Because `HSquirrelVM` isn't defined yet, the type needs to stay `longlong` for now. ```c diff --git a/docs/Modding/guides/scripting/custommenus.md b/docs/Modding/guides/scripting/custommenus.md index 388debf9..c439dd12 100644 --- a/docs/Modding/guides/scripting/custommenus.md +++ b/docs/Modding/guides/scripting/custommenus.md @@ -4,7 +4,7 @@ This tutorial will explain how to create a mod that adds a new menu that's viewa ## Setup -First, create a new folder with this ``mod.json``: +First, create a new folder with this `mod.json`: ```json @@ -24,11 +24,11 @@ First, create a new folder with this ``mod.json``: } ``` -Then create ``custom_menu.nut`` in ``./mod/scripts/vscripts/ui``. +Then create `custom_menu.nut` in `./mod/scripts/vscripts/ui`. ## Minimal Example -Create ``AddCustomMenu`` in ``custom_menu.nut`` like this and make it global: +Create `AddCustomMenu` in `custom_menu.nut` like this and make it global: ```squirrel @@ -40,9 +40,9 @@ Create ``AddCustomMenu`` in ``custom_menu.nut`` like this and make it global: } ``` -``AddCustomMenu`` will get called when the UI vm is initializing and instantiate your menu. You can access your menu with ``GetMenu( "CustomMenu" )`` after it has been initialized. +`AddCustomMenu` will get called when the UI vm is initializing and instantiate your menu. You can access your menu with `GetMenu( "CustomMenu" )` after it has been initialized. -Next, create the file that defines the layout of your menu. It's already referenced in the above code at ``$"resource/ui/menus/custommenu.menu"``. Create the file ``./mod/resource/ui/menus/custommenu.menu`` and paste this code in it. +Next, create the file that defines the layout of your menu. It's already referenced in the above code at `$"resource/ui/menus/custommenu.menu"`. Create the file `./mod/resource/ui/menus/custommenu.menu` and paste this code in it. ??? ".menu configuration" @@ -125,7 +125,7 @@ Next, create the file that defines the layout of your menu. It's already referen } ``` -Now you'll need to define ``CustomMenu_Init``. This is the function previously defined that contains all initializations needed for this menu. +Now you'll need to define `CustomMenu_Init`. This is the function previously defined that contains all initializations needed for this menu. First, create an instantiated struct for variables that should be available in the scope of your custom menu script. @@ -136,7 +136,7 @@ First, create an instantiated struct for variables that should be available in t } file ``` -At the moment, this struct can only contain your menu. To set it, edit ``AddCustomMenu`` like this: +At the moment, this struct can only contain your menu. To set it, edit `AddCustomMenu` like this: ```diff @@ -147,7 +147,7 @@ At the moment, this struct can only contain your menu. To set it, edit ``AddCust } ``` -Now, define ``CustomMenu_Init``. It doesn't need to be global. +Now, define `CustomMenu_Init`. It doesn't need to be global. ```squirrel @@ -161,14 +161,14 @@ This adds a footer to your menu, that allows the user to navigate back. ## Adding a footer to the Main menu -Currently, there is no way to access your menu. You can open your (or any other menu) with ``AdvanceMenu``. +Currently, there is no way to access your menu. You can open your (or any other menu) with `AdvanceMenu`. ```squirrel AdvanceMenu( GetMenu( "CustomMenu" ) ) ``` -This is useful for callbacks triggered by button presses like from footers. To add a footer to the Main menu, first edit your ``mod.json`` code callbacks: +This is useful for callbacks triggered by button presses like from footers. To add a footer to the Main menu, first edit your `mod.json` code callbacks: ```diff @@ -184,7 +184,7 @@ This is useful for callbacks triggered by button presses like from footers. To a ] ``` -We need a new callback that's run after all menus are initialized to add any footers to them. Create the global function ``AddCustomMenuFooter`` in ``custom_menu.nut`` like this: +We need a new callback that's run after all menus are initialized to add any footers to them. Create the global function `AddCustomMenuFooter` in `custom_menu.nut` like this: ```squirrel @@ -211,9 +211,9 @@ We need a new callback that's run after all menus are initialized to add any foo ### Adding a Counter -We'll use the button we defined earlier in the ``.menu`` file to increase a number of clicks and the label to show how often the user has clicked that button. +We'll use the button we defined earlier in the `.menu` file to increase a number of clicks and the label to show how often the user has clicked that button. -first, add ``someLabel`` and ``clicks`` to the ``file`` struct. Then define the label in the ``AddCustomMenu`` and add a callback to the button. +first, add `someLabel` and `clicks` to the `file` struct. Then define the label in the `AddCustomMenu` and add a callback to the button. ```diff @@ -234,7 +234,7 @@ first, add ``someLabel`` and ``clicks`` to the ``file`` struct. Then define the } ``` -Now you need to define the ``OnSomeButtonClick`` callback that's triggered when the button is activated. +Now you need to define the `OnSomeButtonClick` callback that's triggered when the button is activated. ```squirrel @@ -268,7 +268,7 @@ First you need to add a definition in your `custommenu.menu` file: } ``` -Then add a ``UIE_CLICK`` callback for the button. It also makes sense to move the code that updates the label text to it's own function so it can be reused by the reset button. +Then add a `UIE_CLICK` callback for the button. It also makes sense to move the code that updates the label text to it's own function so it can be reused by the reset button. ```diff @@ -308,7 +308,7 @@ Then add a ``UIE_CLICK`` callback for the button. It also makes sense to move th You can add callbacks for menu events, for example when a menu is closed or opened. -If you want to reset the counter if the menu is closed, edit ``AddCustomMenu`` like this: +If you want to reset the counter if the menu is closed, edit `AddCustomMenu` like this: ```diff @@ -328,7 +328,7 @@ If you want to reset the counter if the menu is closed, edit ``AddCustomMenu`` l } ``` -And define the callback ``OnCloseCustomMenu`` to simply call ``OnResetButtonClick``. +And define the callback `OnCloseCustomMenu` to simply call `OnResetButtonClick`. ```squirrel diff --git a/docs/Modding/guides/scripting/gamemodemods.md b/docs/Modding/guides/scripting/gamemodemods.md index 866ab4e2..76df64b2 100644 --- a/docs/Modding/guides/scripting/gamemodemods.md +++ b/docs/Modding/guides/scripting/gamemodemods.md @@ -4,9 +4,9 @@ Creating a gamemode is **significantly** more complex than making mutators. The For example, the client localisation, the way the gamemode is defined (FFA, TDM, etc), the scoring system, respawn system (FFA or TDM spawnpoints) and team mechanics must all be considered. -## The ``mod.json`` +## The `mod.json` -The ``mod.json`` is responsible for governing when, and where your mod is loaded, and follows a layout that is fairly complicated at first glance. +The `mod.json` is responsible for governing when, and where your mod is loaded, and follows a layout that is fairly complicated at first glance. However, once you get the hang of it, it should be fairly easy to use. ```json @@ -46,11 +46,11 @@ The script above defines the pubic and listed details of the mod. The script above defines both what functions to run, when to run them and WHERE to run them, -The first one being ``_gamemode_simplerandomiser.nut`` runs the server scripts, which handles the portion of everything related to the player, such as taking their weapons and replacing it with a different one. +The first one being `_gamemode_simplerandomiser.nut` runs the server scripts, which handles the portion of everything related to the player, such as taking their weapons and replacing it with a different one. -Second one being ``cl_gamemode_simplerandomiser.nut`` is where the client scripts run to perform stuff locally on the player's game, such as playing music, receiving announcement texts from the server and so on. +Second one being `cl_gamemode_simplerandomiser.nut` is where the client scripts run to perform stuff locally on the player's game, such as playing music, receiving announcement texts from the server and so on. -Lastly, ``sh_gamemode_simplerandomiser.nut`` is a shared script between server and client, in this case it runs your ``simplerandomiser_init`` in order to assign many variables for the server and client to "know" about this gamemode. +Lastly, `sh_gamemode_simplerandomiser.nut` is a shared script between server and client, in this case it runs your `simplerandomiser_init` in order to assign many variables for the server and client to "know" about this gamemode. For example, both server and client needs to know whether if this gamemode exists in the private match settings, the scoring HUD and system, the spawnpoints configuration and many more. @@ -66,7 +66,7 @@ For example, both server and client needs to know whether if this gamemode exist This defines the path to the language file, and its main use is to localize strings such as the announcement texts, gamemode and so on. -Name this file ``mod.json``, and it should go in the mods root folder, that being /yourmodname. +Name this file `mod.json`, and it should go in the mods root folder, that being /yourmodname. Here's what the end result would look like: @@ -105,7 +105,7 @@ Here's what the end result would look like: ## Language file -This follows a fairly simple template, the only thing of note is that you often get strange behaviour using ``UTF-8`` when saving the file instead of using ``UTF-16 LE``. +This follows a fairly simple template, the only thing of note is that you often get strange behaviour using `UTF-8` when saving the file instead of using `UTF-16 LE`. ``` @@ -120,11 +120,11 @@ This follows a fairly simple template, the only thing of note is that you often } ``` -Name this file ``simplerandomiser_localisation_english.txt`` and place it in the ``yourmodsname/mod/resource/`` folder. +Name this file `simplerandomiser_localisation_english.txt` and place it in the `yourmodsname/mod/resource/` folder. ## Shared functions -Let's begin the process by first creating the file ``sh_gamemode_simplerandomiser.nut`` and making the core components of the gamemode, which is to define the gamemode properties. +Let's begin the process by first creating the file `sh_gamemode_simplerandomiser.nut` and making the core components of the gamemode, which is to define the gamemode properties. ```squirrel @@ -195,11 +195,11 @@ The comments should hopefully explain what most of everything does, but just to - we set the default scoring method, what spawnpoint algorithm to use, as well as the scoreboard size. - we defined server callbacks, which we will use later on in the server scripts portion of this gamemode. -Now that we're done, name this file ``sh_gamemode_simplerandomiser.nut`` and place it in the ``yourmodsname/mod/scripts/vscripts/gamemodes`` folder. +Now that we're done, name this file `sh_gamemode_simplerandomiser.nut` and place it in the `yourmodsname/mod/scripts/vscripts/gamemodes` folder. ## Server-side function -Now that we're down with defining the gamemode, its time to focus on the component on that makes the gamemode function in-game. For this, it will be mostly handled by the server scripts, so head into ``_gamemode_simplerandomiser.nut`` to begin writing the randomizing script. +Now that we're down with defining the gamemode, its time to focus on the component on that makes the gamemode function in-game. For this, it will be mostly handled by the server scripts, so head into `_gamemode_simplerandomiser.nut` to begin writing the randomizing script. ```squirrel @@ -215,7 +215,7 @@ Now that we're down with defining the gamemode, its time to focus on the compone } ``` -As you may have noticed, checking if it is a server is a special case, so we use ``#if SERVER`` and ``#endif`` instead of the usual ``if(thing){stuff}`` +As you may have noticed, checking if it is a server is a special case, so we use `#if SERVER` and `#endif` instead of the usual `if(thing){stuff}` Now that our initial function is created, we now have the game triggering `GiveRandomGun` when a player spawns, but we don't have any such function, so let's begin creating one. @@ -230,11 +230,11 @@ For this we define an array: "mp_weapon_dmr"] ``` -Here we have defined an array with only 4 weapons in it, you can make this list however you like but remember to separate all but the last item with a ``,`` +Here we have defined an array with only 4 weapons in it, you can make this list however you like but remember to separate all but the last item with a `,` ### Randomise function -As we already know its going to call the function ``GiveRandomGun`` when a player respawns, let's define that now. +As we already know its going to call the function `GiveRandomGun` when a player respawns, let's define that now. First we strip any existing weapons: ```squirrel @@ -254,7 +254,7 @@ Then lets give them a new, random weapon by selecting a random item from our pre player.GiveWeapon( pilotWeapons[ RandomInt( pilotWeapons.len() ) ] ) ``` -Now, remember the server callback that we defined earlier in ``sh_gamemode_simplerandomiser.nut``? Let's put that to use. +Now, remember the server callback that we defined earlier in `sh_gamemode_simplerandomiser.nut`? Let's put that to use. We are going to make it so the player receives an announcement whenever they have their weapons randomized. ```squirrel @@ -297,11 +297,11 @@ Overall, the server script should look like this. } ``` -Name this file ``_gamemode_simplerandomiser.nut`` and place it in the ``yourmodsname/mod/scripts/vscripts/gamemodes`` folder as well. +Name this file `_gamemode_simplerandomiser.nut` and place it in the `yourmodsname/mod/scripts/vscripts/gamemodes` folder as well. Make sure to double check that all spellings are correct in your mod as everything is case-sensitive. ## Client-side functions -Lastly, for your ``cl_gamemode_simplerandomiser.nut``, we are going to utilize the callback functions from earlier, as well as add some music to play during the gamemode. +Lastly, for your `cl_gamemode_simplerandomiser.nut`, we are going to utilize the callback functions from earlier, as well as add some music to play during the gamemode. ```squirrel @@ -353,7 +353,7 @@ Also, it also displays an announcement towards the player when they have their w Technically, yes, you could. But it wouldn't look pretty. Remember all those strings with the # symbol in front of them? We have to localize them first so it displays correctly. -Hence, open your ``simplerandomiser_localisation_english.txt`` which is located in the ``yourmodsname/mod/resource/`` folder. +Hence, open your `simplerandomiser_localisation_english.txt` which is located in the `yourmodsname/mod/resource/` folder. ```json @@ -380,11 +380,11 @@ Alright, we're finally done! However, there's just one thing missing, which is t ## Maps -We will need to create a file called ``playlists_v2.txt`` and place it in ``yourmodsname/keyvalues`` folder. +We will need to create a file called `playlists_v2.txt` and place it in `yourmodsname/keyvalues` folder. -Yes, you will need to create a folder called ``keyvalues`` which is separate from the ``mod`` folder that we placed all our scripts and localization inside. +Yes, you will need to create a folder called `keyvalues` which is separate from the `mod` folder that we placed all our scripts and localization inside. -Next, inside this ``playlists_v2.txt``, we will need to allow/disallow what maps can the gamemode be played on. +Next, inside this `playlists_v2.txt`, we will need to allow/disallow what maps can the gamemode be played on. ```text @@ -463,9 +463,9 @@ Next, inside this ``playlists_v2.txt``, we will need to allow/disallow what maps } ``` -There isn't much to say here except that we enabled this gamemode to played on all maps. So if this gamemode is set to auto-rotate maps in a server, it will go from one map to the next in order. You could disable certain maps by changing the ``1`` to a ``0``. +There isn't much to say here except that we enabled this gamemode to played on all maps. So if this gamemode is set to auto-rotate maps in a server, it will go from one map to the next in order. You could disable certain maps by changing the `1` to a `0`. -Another thing to note is that under the ``Playlists`` tab, there is an ``image`` slot. You could change the image that displays when selecting a gamemode in the private match lobby. You can find out what the keyvalues for the other images by checking out other gamemodes in ``Northstar.Custom/keyvalues/playlists_v2.txt``. +Another thing to note is that under the `Playlists` tab, there is an `image` slot. You could change the image that displays when selecting a gamemode in the private match lobby. You can find out what the keyvalues for the other images by checking out other gamemodes in `Northstar.Custom/keyvalues/playlists_v2.txt`. ## Closing words @@ -473,4 +473,4 @@ And that should be all you need in order to create a gamemode. Thanks for readin If you ever have a question or two, feel free to head into the Northstar Discord and ask about in #modding-chat. -- Revised by ``x3Karma#6984`` +- Revised by `x3Karma#6984` diff --git a/docs/Modding/guides/tools/BIKVideoModding.md b/docs/Modding/guides/tools/BIKVideoModding.md index 285fa94e..fc8e5f3c 100644 --- a/docs/Modding/guides/tools/BIKVideoModding.md +++ b/docs/Modding/guides/tools/BIKVideoModding.md @@ -23,7 +23,7 @@ The Video will now be in the same folder as the original one and converted to a ## Making a Main Menu Video Mod 1. [Convert](#converting-the-video) a Video to .bik -2. Rename the newly converted .bik to ``menu_act01.bik`` +2. Rename the newly converted .bik to `menu_act01.bik` 3. Make a mod according to [Getting Started](../gettingstarted.md) 4. Copy the .bik to the following path in your mod folder: ```text @@ -40,11 +40,11 @@ The Video will now be in the same folder as the original one and converted to a Not only can you replace the pre-existing BIK files Respawn uses, you can also make your own custom ones and play them whenever you like with console commands. -``playvideo [video name] [horizontal resolution] [vertical resolution]`` will play the named BIK file within the specified resolution. +`playvideo [video name] [horizontal resolution] [vertical resolution]` will play the named BIK file within the specified resolution. -**EX.** ``playvideo mycoolvideo 100 100`` will play the BIK file named "mycoolvideo" within a 100x100 resolution square in the top-left corner. +**EX.** `playvideo mycoolvideo 100 100` will play the BIK file named "mycoolvideo" within a 100x100 resolution square in the top-left corner. -The ``stopvideos`` command will end any currently playing BIK videos. +The `stopvideos` command will end any currently playing BIK videos. With these commands, BIK files can be used as a substitute for custom audio outside of audio overrides, though they of course can only be played directly on the client and have no directional audio. Videos running in a 1x1 resolution in the top-left corner will be nearly unnoticeable outside of whatever audio they're playing. diff --git a/docs/Modding/guides/tools/MDLModding.md b/docs/Modding/guides/tools/MDLModding.md index 7f98bd4f..6fca74d4 100644 --- a/docs/Modding/guides/tools/MDLModding.md +++ b/docs/Modding/guides/tools/MDLModding.md @@ -99,10 +99,10 @@ We will add a cube to the side of the Flatline and assign a custom material to i Can be skipped if you downloaded the model from the [Titanfall 2 Skin Modding Repo](https://github.com/BigSpice/TitanFall-2-Skin-Modding/tree/main/Models_MDL_Format). - Open HARMONY VPK. -- On the top right click on the ``Open VPK`` button. -- Navigate to the location of your Titanfall 2 installions ``/vpk/`` folder. -- Open the ``.vpk`` file you want to extract (most multiplayer weapons are in ``client_mp_common.bsp.pak000_000.vpk`` since you most likely want one of those). -- You will now see a list of all files in the ``.vpk`` file on the left side looking something like this: +- On the top right click on the `Open VPK` button. +- Navigate to the location of your Titanfall 2 installions `/vpk/` folder. +- Open the `.vpk` file you want to extract (most multiplayer weapons are in `client_mp_common.bsp.pak000_000.vpk` since you most likely want one of those). +- You will now see a list of all files in the `.vpk` file on the left side looking something like this: ``` text @@ -116,19 +116,19 @@ We will add a cube to the side of the Flatline and assign a custom material to i └── depot ``` -- Navigate to the ``models`` folder (this is where all models in this file are located). -- Navigate to the folder of the model you want to extract (for example ``weapons/vinson`` which is the internal name for the Flatline). -- Select the ``.mdl`` file you want to extract (for example ``ptpov_vinson.mdl``). +- Navigate to the `models` folder (this is where all models in this file are located). +- Navigate to the folder of the model you want to extract (for example `weapons/vinson` which is the internal name for the Flatline). +- Select the `.mdl` file you want to extract (for example `ptpov_vinson.mdl`). !!! note - Weapons are mostly split into two models, one for the first person view(``ptpov_`` and the world model ``w_``. + Weapons are mostly split into two models, one for the first person view(`ptpov_` and the world model `w_`. - ``ptpov`` is used when you are in first person. + `ptpov` is used when you are in first person. - ``w_`` is used when the weapon is viewed in the world (for example when its dropped on the ground). + `w_` is used when the weapon is viewed in the world (for example when its dropped on the ground). -- Click on the ``Unpack`` button on the top right. -- You are now prompted to select a folder to extract the model to, select a folder of your choice and click on ``Select Folder``. +- Click on the `Unpack` button on the top right. +- You are now prompted to select a folder to extract the model to, select a folder of your choice and click on `Select Folder`. - Your model is now extracted and you can close Harmony VPK. @@ -142,60 +142,60 @@ We will add a cube to the side of the Flatline and assign a custom material to i ### Setup Crowbar (one time only) -- Uppon first launch select the ``Set Up Games`` tab on the top left. -- Select either ``Portal 2`` or ``Source Filmmaker`` in the dropdown menu on the top. +- Uppon first launch select the `Set Up Games` tab on the top left. +- Select either `Portal 2` or `Source Filmmaker` in the dropdown menu on the top. - Make sure your Library Path is set to the location of the Steam library you have the game installed in on the bottom. -- The ``Game Setup`` section should now be filled with the correct paths. +- The `Game Setup` section should now be filled with the correct paths. -- Select the ``Decompile`` tab on the top. +- Select the `Decompile` tab on the top. - In this tab make sure the following settings are set: - - ``MDL input``: ``File`` - - ``Output to``: ``Subfolder (of MDL input)`` (change the text in the box to the right of that to ``decompiled``) + - `MDL input`: `File` + - `Output to`: `Subfolder (of MDL input)` (change the text in the box to the right of that to `decompiled`) Check the following boxes: - - ``QC file`` - - ``Each $texturegroup skin-familiy on single line`` - - ``Include $definebones lines (typical for view models)`` - - ``Use MixedCase for keywords`` - - ``Reference mesh SMD file`` - - ``Physics mesh SMD file`` - - ``Vertex animation VTA file (flexes)`` - - ``Procedural bones VRD file`` - - ``Bone animation SMD files`` - - ``Place in "anims" subfolder`` - - ``Prefix mesh file names with model name`` - -- Select the ``Compile`` tab on the top. + - `QC file` + - `Each $texturegroup skin-familiy on single line` + - `Include $definebones lines (typical for view models)` + - `Use MixedCase for keywords` + - `Reference mesh SMD file` + - `Physics mesh SMD file` + - `Vertex animation VTA file (flexes)` + - `Procedural bones VRD file` + - `Bone animation SMD files` + - `Place in "anims" subfolder` + - `Prefix mesh file names with model name` + +- Select the `Compile` tab on the top. - In this tab make sure the following settings are set: - - ``QC input``: ``File`` - - ``Output to``: ``Subfolder (of QC input)`` (change the text in the box to the right of that to ``compiled``) + - `QC input`: `File` + - `Output to`: `Subfolder (of QC input)` (change the text in the box to the right of that to `compiled`) Check the following boxes: - - ``No P4`` - - ``Verbose`` + - `No P4` + - `Verbose` - Set ``Game that has the model compiler`` to the game you selected in the ``Set Up Games`` tab on the top left. + Set `Game that has the model compiler` to the game you selected in the `Set Up Games` tab on the top left. - This concludes the setup for crowbar these settings will be saved and you will not need to do this again. ### Decompiling the model -- Click on the ``Browse`` button on the top right. +- Click on the `Browse` button on the top right. - Navigate to the folder you extracted the model to in the previous step. -- Select the ``.mdl`` file you want to decompile (for example ``ptpov_vinson.mdl``). -- Press the ``Decompile`` button. -- Crowbar now decompiles the model and outputs the files to the ``decompiled`` folder in the same folder as the ``.mdl`` file. +- Select the `.mdl` file you want to decompile (for example `ptpov_vinson.mdl`). +- Press the `Decompile` button. +- Crowbar now decompiles the model and outputs the files to the `decompiled` folder in the same folder as the `.mdl` file. ## Step 3: Importing to Blender - Open Blender. -- In the top left corner select ``File`` -> ``Import`` -> ``Source Engine``. -- Navigate to the folder you extracted the model to in the previous step and select the ``.qc`` file (for example ``ptpov_vinson.qc``) and uncheck the ``Import Animations`` box and check the ``Create Collections`` box. +- In the top left corner select `File` -> `Import` -> `Source Engine`. +- Navigate to the folder you extracted the model to in the previous step and select the `.qc` file (for example `ptpov_vinson.qc`) and uncheck the `Import Animations` box and check the `Create Collections` box. ## Step 4: Editing the model @@ -207,17 +207,17 @@ We will add a cube to the side of the Flatline and assign a custom material to i Before editing let me explain how the model is structured in Blender. By selecting a qc file in the import menu we told Blender to import all SMD files referenced in that qc file. This means that the model is split into multiple collections based on the SMD files referenced in the qc file. -For example the ``ptpov_vinson.qc`` file references the ``ptpov_vinson_v_vinson.smd`` file which contains the model for the Flatline. +For example the `ptpov_vinson.qc` file references the `ptpov_vinson_v_vinson.smd` file which contains the model for the Flatline. For now the smd file will be imported into blender when you import the qc file, later we will change this to be an dmx file instead. -- Select the ``ptpov_vinson_v_vinson.smd`` mesh in the outliner. -- Enter ``EDIT Mode``. -- In ``EDIT Mode`` add a cube to the side of the Flatline. -- Exit ``EDIT Mode``. -- This cube should now be part of the ``ptpov_vinson_v_vinson`` mesh. +- Select the `ptpov_vinson_v_vinson.smd` mesh in the outliner. +- Enter `EDIT Mode`. +- In `EDIT Mode` add a cube to the side of the Flatline. +- Exit `EDIT Mode`. +- This cube should now be part of the `ptpov_vinson_v_vinson` mesh. - Make sure that you now weight paint the cube to the correct bones. - !!! note - On Weapons the most safe bone to weight paint to is ``def_c_base`` since it is the root bone of the weapon. This means that the cube will always move with the weapon. + On Weapons the most safe bone to weight paint to is `def_c_base` since it is the root bone of the weapon. This means that the cube will always move with the weapon. If you want the cube to move with a specific part of the weapon you can also weight paint it to the bone that moves that part of the weapon. Again, remember to somewhat learn how rigging works in Blender to properly understand this process. @@ -226,34 +226,34 @@ For now the smd file will be imported into blender when you import the qc file, ## Step 5: Assigning Materials -This step has two ways of being done, using a ``qc`` file that references ``smd`` files or references ``dmx`` files. -Usually the ``smd`` way is what you will want todo when first importing and editing a model, however if you want to reimport a EDITED model you will need to use the ``dmx`` way. +This step has two ways of being done, using a `qc` file that references `smd` files or references `dmx` files. +Usually the `smd` way is what you will want todo when first importing and editing a model, however if you want to reimport a EDITED model you will need to use the `dmx` way. ### Assigning Materials (smd) This is the way you will usually do it when first importing a vanilla model that you have not edited yet. -- Enter ``EDIT Mode``. +- Enter `EDIT Mode`. - Select the cube. -- In the ``Material Properties`` tab on the right click on the ``New`` button. -- Set the name of the material to its path in the game files, to learn more about materials and how to make them see [RPak Modding](rpakmodding.md) or [VTF Modding](VTFModding.md). (for example ``models\weapons_r2\coolmaterial\cool_material``) -- Exit ``EDIT Mode``. +- In the `Material Properties` tab on the right click on the `New` button. +- Set the name of the material to its path in the game files, to learn more about materials and how to make them see [RPak Modding](rpakmodding.md) or [VTF Modding](VTFModding.md). (for example `models\weapons_r2\coolmaterial\cool_material`) +- Exit `EDIT Mode`. - Your cube should now have the material assigned to it ingame after compiling. ### Assigning Materials (dmx) This is the way you will usually do it when reimporting a model that you have edited. -- Enter ``EDIT Mode``. +- Enter `EDIT Mode`. - Select the cube. -- In the ``Material Properties`` tab on the right click on the ``New`` button. +- In the `Material Properties` tab on the right click on the `New` button. - Set the name of the material to its NAME in the game files !!! note with dmx files you can set the material path later on in the export menu. If you have multiple needed paths we will talk about that in the next step [Multiple Material Paths](#step-5-5-multiple-material-paths-dmx). This is why we set the name of the material to its name in the game files instead of its path. -- Exit ``EDIT Mode``. +- Exit `EDIT Mode`. - Your cube should now have the material assigned to it ingame after compiling. !!! note @@ -262,7 +262,7 @@ This is the way you will usually do it when reimporting a model that you have ed ## Step 5.5: Multiple Material Paths (dmx) -If you have materials with multiple paths (different folders in the game files) you will want to use the ``$renamematerial`` command in the qc file. +If you have materials with multiple paths (different folders in the game files) you will want to use the `$renamematerial` command in the qc file. Usage: ```text @@ -281,20 +281,20 @@ Command docs: [VALVe developer docs $renamematerial](https://developer.valvesoft ## Step 6: Exporting from Blender -- In the ``Source Engine Export`` Menu in the ``Scene Properties`` select an ``Export Path`` usually the same folder as the original qc file. -- Set the ``Export Format`` to ``DMX``. +- In the `Source Engine Export` Menu in the `Scene Properties` select an `Export Path` usually the same folder as the original qc file. +- Set the `Export Format` to `DMX`. !!! note This is important since we want to export the model as a dmx file instead of an smd file, this is because of limitation in the smd format that we want to avoid. dmx by default will, uppon importing set a "material path" which is the path to the material in the game files, if you reimport this model later on you will need to -- Press the ``Export`` button and select ``Scene Export`` (this will export all meshes in the scene to DMX files, you can also individually export meshes by selecting them in the outliner and then pressing the ``Export`` button and selecting the mesh in the Export Menu). +- Press the `Export` button and select `Scene Export` (this will export all meshes in the scene to DMX files, you can also individually export meshes by selecting them in the outliner and then pressing the `Export` button and selecting the mesh in the Export Menu). - Your DMX files are now exported and you can close Blender. ## Step 7: Compiling the model -- Open your ``.qc`` file in a text editor of your choice. +- Open your `.qc` file in a text editor of your choice. - On the top of the file you will see so called "bodygroup" lines, these are used to define the bodygroups of the model. They look a bit like this: ``` @@ -305,7 +305,7 @@ Command docs: [VALVe developer docs $renamematerial](https://developer.valvesoft } ``` -- For each bodygroup you will want to change the files to be the dmx files you exported in the previous step. (in most cases its gonna be just renaming all the files to ``.dmx`` instead of ``.smd``). +- For each bodygroup you will want to change the files to be the dmx files you exported in the previous step. (in most cases its gonna be just renaming all the files to `.dmx` instead of `.smd`). !!! note @@ -313,46 +313,46 @@ Command docs: [VALVe developer docs $renamematerial](https://developer.valvesoft We do this so Crowbar uses the dmx files instead of the smd files when compiling the model. - Open Crowbar. -- Select the ``Compile`` tab on the top. -- Click on the ``Browse`` button on the top right. -- Select the ``.qc`` file you want to compile (for example ``ptpov_vinson.qc``). -- Choose your game from the dropdown labeled ``Games that has the model compiler`` (for example ``Portal 2``) -- Press the ``Compile`` button. -- Crowbar now compiles the model and outputs the files to the ``compiled`` folder in the same folder as the ``.qc`` file, inside the ``compiled`` folder you will find the full folder path of the model (for example ``models\weapons\vinson\``). +- Select the `Compile` tab on the top. +- Click on the `Browse` button on the top right. +- Select the `.qc` file you want to compile (for example `ptpov_vinson.qc`). +- Choose your game from the dropdown labeled `Games that has the model compiler` (for example `Portal 2`) +- Press the `Compile` button. +- Crowbar now compiles the model and outputs the files to the `compiled` folder in the same folder as the `.qc` file, inside the `compiled` folder you will find the full folder path of the model (for example `models\weapons\vinson\`). !!! note Usually the error is self explainatory and you can fix it by yourself. By default Crowbar will not output a compiled file if any errors occur during the compilation process. - If you have Visual Studio Code installed you can also use the ``Valve KeyValue Files Support`` extension to have a better overview of the qc file, extension id: ``GEEKiDoS.vdf`` + If you have Visual Studio Code installed you can also use the `Valve KeyValue Files Support` extension to have a better overview of the qc file, extension id: `GEEKiDoS.vdf` ## Step 8: Combining model files - Open MDLShit. -- In a file explorer navigate to the compiled folder of your model (for example ``compiled\models\weapons\vinson\``). -- In this folder you will find the ``.mdl`` file and multiple other files, in our case there will be 3 files ``.mdl``, ``.vvd`` and ``.vtx``) all with the same name. +- In a file explorer navigate to the compiled folder of your model (for example `compiled\models\weapons\vinson\`). +- In this folder you will find the `.mdl` file and multiple other files, in our case there will be 3 files `.mdl`, `.vvd` and `.vtx`) all with the same name. - In MDLShit drag these into their respective boxes. - Make sure they are checked and the boxes you dont have files for are unchecked. -- Press the ``Check`` button. -- Press the ``Convert`` button. -- MDLShit will now combine the files into a single ``_conv.mdl`` file, this is our final exported and working model you can now close MDLShit and use that model in a mod. +- Press the `Check` button. +- Press the `Convert` button. +- MDLShit will now combine the files into a single `_conv.mdl` file, this is our final exported and working model you can now close MDLShit and use that model in a mod. ## Common errors -In this list the word ```` will be used to refer to the name of the file that is causing the error and X will refer to a number depending on your file, ``line`` will refer to the line in the qc file that is causing the error. +In this list the word `` will be used to refer to the name of the file that is causing the error and X will refer to a number depending on your file, `line` will refer to the line in the qc file that is causing the error. The following words correspond to the following: -- ````: The name of the file that is causing the error. -- ````: The line in the qc file that is causing the error. +- ``: The name of the file that is causing the error. +- ``: The line in the qc file that is causing the error. -``modelpath.qc(): - could not load file '<.smd'``: +`modelpath.qc(): - could not load file '<.smd'`: This error means that the qc file is trying to reference a file that does not exist, make sure that the file is in the same folder as the qc file and that the name of the file is correct. If the above solution does not work think about if you need said file actually, if not you can remove it from the qc file. Or if you need it you can create it yourself. You can also see if a Physics or LOD file is the missing file, if it is make sure you have the correct settings in Crowbar for the file to be generated. -``Crowbar ERROR: The model compiler, "", does not exist.`` +`Crowbar ERROR: The model compiler, "", does not exist.` -``Crowbar ERROR: The game's "" file does not exist.`` - Mostly happens if you did not properly set up Crowbar, make sure you set the ``Game that has the model compiler`` to [your prerequisite game](https://r2northstar.readthedocs.io/en/latest/guides/tools/MDLModding.html#prequisites). +`Crowbar ERROR: The game's "" file does not exist.` + Mostly happens if you did not properly set up Crowbar, make sure you set the `Game that has the model compiler` to [your prerequisite game](https://r2northstar.readthedocs.io/en/latest/guides/tools/MDLModding.html#prequisites). diff --git a/docs/Modding/guides/tools/VTFModding.md b/docs/Modding/guides/tools/VTFModding.md index 43a284bc..31583e0f 100644 --- a/docs/Modding/guides/tools/VTFModding.md +++ b/docs/Modding/guides/tools/VTFModding.md @@ -36,11 +36,11 @@ You have 2 options for a VPK tool. Pick either the older VPK tool: [cra0 VPKTool](https://github.com/Wanty5883/Titanfall2/blob/master/tools/Titanfall_VPKTool3.4_Portable.zip) or the Newer VPK tool: [Harmony VPKTool](https://github.com/harmonytf/HarmonyVPKTool) (better). -With your VPK tool opened. 'Open' ``englishclient_mp_common.pak000_dir.vpk`` which is located in ``Titanfall2/vpk``. +With your VPK tool opened. 'Open' `englishclient_mp_common.pak000_dir.vpk` which is located in `Titanfall2/vpk`. Inside of the VPK, not all guns filenames match their ingame names. Here is [list of weapon names](https://noskill.gitbook.io/titanfall2/documentation/file-location/weapon/weapon-model) to help you out. -Navigate to ``models/weapons/car101``. Extract all the viewmodel versions (ptpov) and normal model (w) mdl's. +Navigate to `models/weapons/car101`. Extract all the viewmodel versions (ptpov) and normal model (w) mdl's. ## Hex Editor @@ -49,17 +49,17 @@ We need a hex editor. Before editing with hex editors, you need to be aware that Open your .mdl in your hex editor. -We want to get closer to the path we need or else you'll be scrolling and searching for hours. Search:(CTRL+F) for skin_31. If you don't get any matches, try skn_31, skin31, elite, or prime. The path should look something like ``.models\Weapons_R2\weaponname\weaponname_skin_31``. +We want to get closer to the path we need or else you'll be scrolling and searching for hours. Search:(CTRL+F) for skin_31. If you don't get any matches, try skn_31, skin31, elite, or prime. The path should look something like `.models\Weapons_R2\weaponname\weaponname_skin_31`. Don't change this unless you want to effect skin31 textures. -The path we do need to change is ``.models\Weapons_R2\weaponname\weaponname``. This comes before the ``skin_31`` path. -I recommend only changing the last section of the path. We'll change ``.models\Weapons_r2\car_smg\CAR_smg`` to ``.models\weapons_r2\car_smg\car_ctm``. Note the capitalization, as some vpk repacking tools cannot repack properly if the changed path contains capitals. +The path we do need to change is `.models\Weapons_R2\weaponname\weaponname`. This comes before the `skin_31` path. +I recommend only changing the last section of the path. We'll change `.models\Weapons_r2\car_smg\CAR_smg` to `.models\weapons_r2\car_smg\car_ctm`. Note the capitalization, as some vpk repacking tools cannot repack properly if the changed path contains capitals. -Now copy these changes for ``ptpov_`` and/or ``w_`` model(s). As these are the stow (On your back) and main menu models. If don't change these. Your texture will only work when in a match. +Now copy these changes for `ptpov_` and/or `w_` model(s). As these are the stow (On your back) and main menu models. If don't change these. Your texture will only work when in a match. ## Creating VMT -In the same folder you extracted your mdl's. Make a ``materials`` folder next to the ``models`` folder. +In the same folder you extracted your mdl's. Make a `materials` folder next to the `models` folder. Example: ``` @@ -68,7 +68,7 @@ Example: materials ``` -Recreate the path you changed in the ``materials`` folder, such that the last section is a .vmt file: +Recreate the path you changed in the `materials` folder, such that the last section is a .vmt file: ```text @@ -108,10 +108,10 @@ When we use vtf textures, we can only use the albedo and normal. Learn more abou [VTFEdit](https://nemstools.github.io/pages/VTFLib-Download.html) is a tool to edit, view, and create .vtf files. -Launch [VTFEdit](https://nemstools.github.io/pages/VTFLib-Download.html). Top left, click ``File``, ``Import``, find and Import your custom texture(s). +Launch [VTFEdit](https://nemstools.github.io/pages/VTFLib-Download.html). Top left, click `File`, `Import`, find and Import your custom texture(s). -When importing your normal map. Choose to import as a ``Volume Map`` -When importing your diffuse map. Choose to import as a ``Animated Map`` +When importing your normal map. Choose to import as a `Volume Map` +When importing your diffuse map. Choose to import as a `Animated Map` More info about .vtf format possibilities [here](https://retryy.gitbook.io/tf2/wiki/create/formats), or the official source docs [here](https://developer.valvesoftware.com/wiki/Valve_Texture_Format). @@ -119,11 +119,11 @@ After that, save your new .vtf's into the same folder as your custom .vmt with a ## Configuring your .vmt -In the ``"$basetexture"`` argument enter your .vtf texture directory. We'll use ``models\weapons_r2\car_smg\car_ctm\NAMEOFVTF``. This should point to your custom diffuse .vtf with the simple name. The game expects these paths to be without the ``.vtf`` file extension - don't add it. +In the `"$basetexture"` argument enter your .vtf texture directory. We'll use `models\weapons_r2\car_smg\car_ctm\NAMEOFVTF`. This should point to your custom diffuse .vtf with the simple name. The game expects these paths to be without the `.vtf` file extension - don't add it. -Do the same for adding your normal map with the ``"$bumpmap"`` argument. +Do the same for adding your normal map with the `"$bumpmap"` argument. -In some cases you might have to create another vtf with literally any image. Put its path in the ``"$texture2"`` argument. As far as i know, this is sometimes necessary even though the texture isn't used. +In some cases you might have to create another vtf with literally any image. Put its path in the `"$texture2"` argument. As far as i know, this is sometimes necessary even though the texture isn't used. ## Final VPK folder @@ -149,17 +149,17 @@ Your root folder should look somewhat like this ## Finished. -You're done! You just need to pack it into a vpk with a vpk tool (for our gun mod, we'd repack to ``englishclient_mp_common.pak000_dir.vpk``), and put the vpk into a Northstar mod inside a ``vpk`` folder. +You're done! You just need to pack it into a vpk with a vpk tool (for our gun mod, we'd repack to `englishclient_mp_common.pak000_dir.vpk`), and put the vpk into a Northstar mod inside a `vpk` folder. Help with repacking [here](https://noskill.gitbook.io/titanfall2/intro/duction/vpk-packpack), and help with Northstar mods [here](https://r2northstar.readthedocs.io/en/latest/guides/gettingstarted.html). ## Making your Skin Animated -To add animation functionality, all we need to do is add a Proxie; which is just a modifier inside a ``.vmt``, and change our albedo vtf texture. +To add animation functionality, all we need to do is add a Proxie; which is just a modifier inside a `.vmt`, and change our albedo vtf texture. -You need to create a .vtf texture with multiple frames imported to a single .vtf texture, that's your animated texture. You can do this with [VTFEdit](https://nemstools.github.io/pages/VTFLib-Download.html). Then assign the texture in ``$basetexture``. +You need to create a .vtf texture with multiple frames imported to a single .vtf texture, that's your animated texture. You can do this with [VTFEdit](https://nemstools.github.io/pages/VTFLib-Download.html). Then assign the texture in `$basetexture`. -At the bottom of your vmt but before the ``}``, add this: +At the bottom of your vmt but before the `}`, add this: ```text @@ -175,4 +175,4 @@ At the bottom of your vmt but before the ``}``, add this: ``` -To change the fps of the texture, change the value after ``animatedTextureFrameRate``, and you'll be done making your texture animated! \ No newline at end of file +To change the fps of the texture, change the value after `animatedTextureFrameRate`, and you'll be done making your texture animated! \ No newline at end of file diff --git a/docs/Modding/guides/tools/rpakmodding.md b/docs/Modding/guides/tools/rpakmodding.md index 71b06f25..f08ad4cb 100644 --- a/docs/Modding/guides/tools/rpakmodding.md +++ b/docs/Modding/guides/tools/rpakmodding.md @@ -39,16 +39,16 @@ Once it has been downloaded, it is recommended to set up your file structure as └── assets ``` -- ``RePak``: the base folder where your RePak/RPak related files go -- ``RePak.exe``: the `unzipped` file you downloaded from GitHub -- ``pack_all.bat``: a .bat file that will pack all of your RPaks when opened (outlined below) -- ``rpaks``: the folder where RePak.exe will put your RPaks when they have been created -- ``maps``: the folder where you will write your "map" files, these define the contents of your RPaks -- ``assets``: the folder where you will put your various different images and folders, used to create your RPaks +- `RePak`: the base folder where your RePak/RPak related files go +- `RePak.exe`: the `unzipped` file you downloaded from GitHub +- `pack_all.bat`: a .bat file that will pack all of your RPaks when opened (outlined below) +- `rpaks`: the folder where RePak.exe will put your RPaks when they have been created +- `maps`: the folder where you will write your "map" files, these define the contents of your RPaks +- `assets`: the folder where you will put your various different images and folders, used to create your RPaks ### Making pack_all.bat -``pack_all.bat`` is recommended for using RePak, as it allows for quick and easy packing of all of your RPaks. +`pack_all.bat` is recommended for using RePak, as it allows for quick and easy packing of all of your RPaks. Below is the script that should be copied into the file. ```bat @@ -69,11 +69,11 @@ For information on making other types of RPaks, check the RePak Docs: ### Finding the camo Before you can make your RPak, you need to know which assets you want to replace. -Camos in Titanfall 2 tend to have their own RPaks, with the naming scheme ``camo_skin_col.rpak`` +Camos in Titanfall 2 tend to have their own RPaks, with the naming scheme `camo_skin_col.rpak` Firstly, make sure you have LegionPlus downloaded, if you don't, it can be downloaded from [here](https://github.com/r-ex/LegionPlus/releases). -Then use LegionPlus to open one of the ``camo_skin_col.rpak`` RPaks, it should look like this: +Then use LegionPlus to open one of the `camo_skin_col.rpak` RPaks, it should look like this: ![CamoRPak](https://user-images.githubusercontent.com/66967891/181027612-e5f7af74-9e1a-496e-a2d7-783423f7b179.png) @@ -82,7 +82,7 @@ Then use LegionPlus to open one of the ``camo_skin_col.rpak`` RPaks, it Extract the asset by double clicking on it, or by selecting it and clicking "Export Selected" -Make a note of the Name of the asset, in this example it's ``models\camo_skins\camo_skin04_col`` +Make a note of the Name of the asset, in this example it's `models\camo_skins\camo_skin04_col` ### Editing the texture @@ -104,13 +104,13 @@ After you have made the desired changes to the image, export it as a .dds file w !!! warning Try to make your textures have dimensions that are powers of two, so that [mipmaps](https://en.wikipedia.org/wiki/Mipmap#Overview) can be used. - For example ``256x256`` ``512x512`` ``1024x512`` ``4096x1024`` are all fine, but ``350x700`` might cause issues. + For example `256x256` `512x512` `1024x512` `4096x1024` are all fine, but `350x700` might cause issues. ![MipMaps](https://upload.wikimedia.org/wikipedia/commons/thumb/5/59/Mipmap_Aliasing_Comparison.png/1280px-Mipmap_Aliasing_Comparison.png) -Place your newly created .dds file in the ``assets\texture`` folder, following the path in the Name you noted down above. -In this example the .dds file would go in ``RePak\assets\texture\models\camo_skins``, with the path of the image being ``..\RePak\assets\texture\models\camo_skins\camo_skin04_col.dds`` +Place your newly created .dds file in the `assets\texture` folder, following the path in the Name you noted down above. +In this example the .dds file would go in `RePak\assets\texture\models\camo_skins`, with the path of the image being `..\RePak\assets\texture\models\camo_skins\camo_skin04_col.dds` ### Making a map file @@ -118,9 +118,9 @@ In this example the .dds file would go in ``RePak\assets\texture\models\camo_ski Once you have edited your texture image and placed it in the right folder, you are ready to make your map file. Map files are what RePak uses to create the .rpak file (and .starpak files if needed) and are in the .json file format. -They can be named anything you want, but should be put in the ``RePak\maps`` folder. +They can be named anything you want, but should be put in the `RePak\maps` folder. -Below is an example of a map file that creates an RPak called ``example.rpak`` which contains 1 texture asset. +Below is an example of a map file that creates an RPak called `example.rpak` which contains 1 texture asset. ```json @@ -139,43 +139,43 @@ Below is an example of a map file that creates an RPak called ``example.rpak`` w } ``` -- ``name``: the name of the file that gets created by RePak. -- ``assetsDir``: the folder that RePak bases the file path on when looking for textures. -- ``outputDir``: the folder that RePak will put the files that it creates in. -- ``starpakPath``: the path of the starpak file for streaming textures. -- ``version``: the RPak version RePak will use when creating the RPaks. **Version 7 is Titanfall 2, version 8 is Apex Legends.** -- ``files``: an array of all of the assets that RePak will create in the RPak. -- ``$type``: the type of asset that this asset is, use ``txtr`` for textures. -- ``path``: the path of the asset, used in texture assets for finding the image. **This should start with** ``texture/`` **and the rest should match the Name given by LegionPlus.** +- `name`: the name of the file that gets created by RePak. +- `assetsDir`: the folder that RePak bases the file path on when looking for textures. +- `outputDir`: the folder that RePak will put the files that it creates in. +- `starpakPath`: the path of the starpak file for streaming textures. +- `version`: the RPak version RePak will use when creating the RPaks. **Version 7 is Titanfall 2, version 8 is Apex Legends.** +- `files`: an array of all of the assets that RePak will create in the RPak. +- `$type`: the type of asset that this asset is, use `txtr` for textures. +- `path`: the path of the asset, used in texture assets for finding the image. **This should start with** `texture/` **and the rest should match the Name given by LegionPlus.** !!! warning - If the ``path`` doesn't match up with the location of your file, RePak will throw an error + If the `path` doesn't match up with the location of your file, RePak will throw an error !!! warning - If the ``path`` contains any ``\`` characters, make sure that you either replace them with ``/`` or you duplicate them (``\\``) + If the `path` contains any `\` characters, make sure that you either replace them with `/` or you duplicate them (`\\`) - This is because ``\`` is the escape character in JSON, and will therefore break the ``path`` + This is because `\` is the escape character in JSON, and will therefore break the `path` ### Creating the RPak -To create your RPak file, simply open ``pack_all.bat``. +To create your RPak file, simply open `pack_all.bat`. -Alternatively, click and drag your map file over ``RePak.exe``. (I don't recommend this, it's a pain) +Alternatively, click and drag your map file over `RePak.exe`. (I don't recommend this, it's a pain) **Look at the console for any errors.** -If there are no errors, a .rpak file should have been created in the ``rpaks`` folder. +If there are no errors, a .rpak file should have been created in the `rpaks` folder. ### Using the RPak in a mod Create the basis of the mod using the `gettingstarted` guide. -Inside the mod's folder, create a new folder, called ``paks``. Move your .rpak file (and .starpak files if you have any) into the folder. +Inside the mod's folder, create a new folder, called `paks`. Move your .rpak file (and .starpak files if you have any) into the folder. ![ModStructure](https://user-images.githubusercontent.com/66967891/181840035-3cfa24e0-efdd-49fa-85f6-60e6c4cc9a12.png) -Inside the ``paks`` folder that you created, make a new .json file called ``rpak.json``. -In this example, the ``camo_skin04_col.rpak`` rpak is completely replaced by ``example.rpak``. +Inside the `paks` folder that you created, make a new .json file called `rpak.json`. +In this example, the `camo_skin04_col.rpak` rpak is completely replaced by `example.rpak`. This is fine for camo RPaks, but isn't suitable for more complex RPaks ```json @@ -196,39 +196,39 @@ This is fine for camo RPaks, but isn't suitable for more complex RPaks } ``` -- ``Preload``: if set to ``true`` this makes RPaks get loaded as soon as possible. -- ``Aliases``: this completely replaces the RPak with the specified RPak. In this example ``camo_skin04_col.rpak`` is replaced by ``example.rpak``. -- ``Postload``: this makes RPaks get loaded directly after the specified RPak. +- `Preload`: if set to `true` this makes RPaks get loaded as soon as possible. +- `Aliases`: this completely replaces the RPak with the specified RPak. In this example `camo_skin04_col.rpak` is replaced by `example.rpak`. +- `Postload`: this makes RPaks get loaded directly after the specified RPak. #### Preload This field tells Northstar whether or not to load a specific RPak as soon as RPak loading starts. -The field is a boolean. (``true`` or ``false``) and should be formatted like ``"": true`` or ``"": false`` +The field is a boolean. (`true` or `false`) and should be formatted like `"": true` or `"": false` -Example: ``"my_new.rpak": true`` +Example: `"my_new.rpak": true` #### Aliases This field tells Northstar that a specific RPak should never be loaded, and a different RPak should be loaded instead. -The field should be formatted like ``"": ""`` +The field should be formatted like `"": ""` -Example: ``"common.rpak": "my_new.rpak"`` +Example: `"common.rpak": "my_new.rpak"` #### Postload This field tells Northstar that a specific RPak must be loaded directly after another specified RPak has finished loading. -The field should be formatted like ``"": ""`` +The field should be formatted like `"": ""` -Example: ``"my_new.rpak": "common.rpak"`` +Example: `"my_new.rpak": "common.rpak"` !!! warning If an asset in your RPak references another asset, it must be loaded after the asset that it references, or the game will infinitely loop when launched. - This is mostly a problem for ``matl`` assets, ``txtr`` assets don't reference other assets. + This is mostly a problem for `matl` assets, `txtr` assets don't reference other assets. -The file structure of your ``paks`` folder should be similar to this: +The file structure of your `paks` folder should be similar to this: ![PaksStructure](https://user-images.githubusercontent.com/66967891/181840126-98e48860-84d0-496d-8f2e-1cea4dea7363.png) @@ -240,10 +240,10 @@ The file structure of your ``paks`` folder should be similar to this: └── rpak.json ``` -- ``example.rpak``: this is the RPak file that you made. -- ``rpak.json``: this controls how the game loads your RPak files +- `example.rpak`: this is the RPak file that you made. +- `rpak.json`: this controls how the game loads your RPak files -**After** ``rpak.json`` **is set up correctly, your RPak mod should be complete and functional!** +**After** `rpak.json` **is set up correctly, your RPak mod should be complete and functional!** !!! note If when you test the rpak the colour looks weird, use SRGB in the .dds compression, or use non-SRGB if you were already using SRGB diff --git a/docs/Modding/guides/tools/soundmodding.md b/docs/Modding/guides/tools/soundmodding.md index 7630b18f..e63bb905 100644 --- a/docs/Modding/guides/tools/soundmodding.md +++ b/docs/Modding/guides/tools/soundmodding.md @@ -3,37 +3,37 @@ ## Audio Type -- You will need to use ``WAV`` format and either ``48000hz`` or ``44100hz`` sample rate. +- You will need to use `WAV` format and either `48000hz` or `44100hz` sample rate. - More details below in [creating_your_sound](#creating_your_sound) ## Step 1 - Identifying the Sound First you need to identify the exact sound. There's a command for this: -``ns_print_played_sounds 1`` It will show all the audio events that +`ns_print_played_sounds 1` It will show all the audio events that are happening at that moment on the console. For example, use your Grapple and open the console the event ID will be -``pilot_grapple_fire`` +`pilot_grapple_fire` How it looks in the console: ![console](https://raw.githubusercontent.com/rwynx/audio-overriding-northstar/main/Images/audioeventeample.png) All weapons, boosts, tacticals have different events IDs on different surfaces (concrete, solidmetal, wood, dirt etc.) That's why you must identify the exact event/s. Examples based on Grapple: -- Concrete impact: ``concrete_grapple_impact_1p_vs_3p`` -- Solidmetal impact: ``solidmetal_grapple_extract_1p_vs_3p`` etc. +- Concrete impact: `concrete_grapple_impact_1p_vs_3p` +- Solidmetal impact: `solidmetal_grapple_extract_1p_vs_3p` etc. -**NOTE:** ``ns_print_played_sounds 1`` will show you every event ID. Not +**NOTE:** `ns_print_played_sounds 1` will show you every event ID. Not just in-match ones. For example: -- The sound when you move the cursor to an option it will be ``menu_focus``, and clicking sound will be ``menu_accept`` or menu music ``mainmenu_music`` +- The sound when you move the cursor to an option it will be `menu_focus`, and clicking sound will be `menu_accept` or menu music `mainmenu_music` Check the console often, as it's easy to miss your sound - there can be a lot of sounds playing. There's also a [list](https://gist.github.com/begin-theadventure/84c46e803aa358b102d754ff992ae9e4) of all EvenIDs (audio). -Sounds can be played in-game from the console via ``script_ui EmitUISound(soundname)``. +Sounds can be played in-game from the console via `script_ui EmitUISound(soundname)`. Additionally [subtitles](https://gist.github.com/begin-theadventure/cf941af91cd158de4fde747ec78c2902) in the form of plain text can also be useful. @@ -47,7 +47,7 @@ If you want to export only a specific sound use search. It's possible to export When you successfully identified your event and have the audio file/s ready it's time to set up the folder structure. -Assuming the event name is ``pilot_grapple_fire``, the folder structure of your mod should look like this: +Assuming the event name is `pilot_grapple_fire`, the folder structure of your mod should look like this: ```text @@ -60,7 +60,7 @@ Assuming the event name is ``pilot_grapple_fire``, the folder structure of your ``` -Example of a ``mod.json`` (documented here: [Getting Started](../gettingstarted.md)) +Example of a `mod.json` (documented here: [Getting Started](../gettingstarted.md)) ```json @@ -74,13 +74,13 @@ Example of a ``mod.json`` (documented here: [Getting Started](../gettingstarted. ``` -**Inside the ``audio/`` folder:** +**Inside the `audio/` folder:** -- ``pilot_grapple_fire/`` folder which needs to contain your .wav file(s) -- ``pilot_grapple_fire.json`` json used to configure the sound override, dont forget to edit. +- `pilot_grapple_fire/` folder which needs to contain your .wav file(s) +- `pilot_grapple_fire.json` json used to configure the sound override, dont forget to edit. You will have to add that folder with your sound and the json for each event you want to override. -The event JSON files must contain both ``EventId`` and ``AudioSelectionStrategy`` like this: +The event JSON files must contain both `EventId` and `AudioSelectionStrategy` like this: ```json @@ -91,10 +91,10 @@ The event JSON files must contain both ``EventId`` and ``AudioSelectionStrategy` } ``` -The ``AudioSelectionStrategy`` can be either: +The `AudioSelectionStrategy` can be either: -- ``sequential``: If you have one sound or you want to play them in alphabetical order. -- ``random``: If you have more than one sound and you want to randomize them. +- `sequential`: If you have one sound or you want to play them in alphabetical order. +- `random`: If you have more than one sound and you want to randomize them. ## Creating Your Sound {#creating_your_sound} @@ -102,13 +102,13 @@ The ``AudioSelectionStrategy`` can be either: - **Recommended tool:** [Audacity](https://www.audacityteam.org/download/) Open/Add your audio as a track to Audacity and set the project rate accordingly. -Either ``48000hz`` or ``44100hz`` can work well in most cases, but a few sounds don't use either. Which sampling rate you should use depends on the original sound's sampling rate. +Either `48000hz` or `44100hz` can work well in most cases, but a few sounds don't use either. Which sampling rate you should use depends on the original sound's sampling rate. -For example: if you use ``44100khz`` and the sound is slightly too high pitched in game, use ``48000khz``. If you use ``48000khz`` and it's slightly low pitched in game, use ``44100khz``. +For example: if you use `44100khz` and the sound is slightly too high pitched in game, use `48000khz`. If you use `48000khz` and it's slightly low pitched in game, use `44100khz`. If you're unsure which to use, or the sound still seems too high, or low pitched, you can use [LegionPlus](https://github.com/r-ex/LegionPlus) to determine the original rate. -After that, export your track as a 16-bit ``wav`` file (any other bit-depth will cause Northstar to crash). +After that, export your track as a 16-bit `wav` file (any other bit-depth will cause Northstar to crash). Make sure you don't add any metadata as this will cause white noise to be at the end of the sound. @@ -127,7 +127,7 @@ This is usually because there's some metadata left in the audio. Remove it to fi You can bulk remove it with [Metadata Cleaner](https://metadatacleaner.romainvigier.fr) or a shell script (requires ffmpeg to be installed) and also individually with Audacity. - ``metadata_remover.sh`` (WAV only) + `metadata_remover.sh` (WAV only) ??? script ```shell @@ -203,5 +203,5 @@ This is usually because there's some metadata left in the audio. Remove it to fi ## Installation -- As with any mod, the folder which contains your ``mod.json`` needs to be inside ``Titanfall 2/r2Northstar/Mods/``. +- As with any mod, the folder which contains your `mod.json` needs to be inside `Titanfall 2/r2Northstar/Mods/`. diff --git a/docs/Modding/plugins/interfacesapi.md b/docs/Modding/plugins/interfacesapi.md index 0553d917..4b0335f1 100644 --- a/docs/Modding/plugins/interfacesapi.md +++ b/docs/Modding/plugins/interfacesapi.md @@ -5,10 +5,10 @@ the plugins system now use source interfaces. The launcher exposes almost everything required by plugins in interfaces that allow for backwards compatibility. The only thing that's passed to a plugin directly is the northstar dll HWND and a struct of data that's different for each plugin. -Plugins are required to expose a ``void* CreateInterface(const char* name, int* status)`` function to share their own interfaces. -The launcher loads the ``PluginId`` interface from the plugin to query info such as it's name. +Plugins are required to expose a `void* CreateInterface(const char* name, int* status)` function to share their own interfaces. +The launcher loads the `PluginId` interface from the plugin to query info such as it's name. -Plugins can use the ``CreateInterface`` function exposed by the northstarDll to use northstar interfaces such as for logging. +Plugins can use the `CreateInterface` function exposed by the northstarDll to use northstar interfaces such as for logging. An interface is just an abstract class to force all functions into a vftable. ## Northstar Interfaces diff --git a/docs/Modding/reference/northstar/chathooks.md b/docs/Modding/reference/northstar/chathooks.md index 322a61a7..8e7e1f94 100644 --- a/docs/Modding/reference/northstar/chathooks.md +++ b/docs/Modding/reference/northstar/chathooks.md @@ -1,6 +1,6 @@ # Chathooks -This document provides usage of the Chathook API added in Northstar ``v1.6.0``. +This document provides usage of the Chathook API added in Northstar `v1.6.0`. For an example of chathooks in use, check out EmmaM's [OwOfier mod](https://github.com/emma-miler/OwOfier/). @@ -33,13 +33,13 @@ The client chat callbacks allow you to intercept chat messages and modify or blo the display name of the player who sent the chat. !!! cpp-var "bool isTeam" - whether this chat has a ``[TEAM]`` tag. + whether this chat has a `[TEAM]` tag. !!! cpp-var "bool isDead" - whether this chat has a ``[DEAD]`` tag. + whether this chat has a `[DEAD]` tag. !!! cpp-var "bool isWhisper" - whether this chat has a ``[WHISPER]`` tag. + whether this chat has a `[WHISPER]` tag. !!! cpp-var "bool shouldBlock" if true, this chat will not be displayed. @@ -224,9 +224,9 @@ With custom messages you can send chat messages at any time, to all players or t **Parameters:** - - ``entity player`` - the player that the chat message will appear to be from. - - ``string text`` - the contents of the chat message. Supports [ANSI escape codes](#ansi_escape) for colors. - - ``bool isTeamChat`` - whether this chat is only sent to the player's team. + - `entity player` - the player that the chat message will appear to be from. + - `string text` - the contents of the chat message. Supports [ANSI escape codes](#ansi_escape) for colors. + - `bool isTeamChat` - whether this chat is only sent to the player's team. **Example:** @@ -246,10 +246,10 @@ With custom messages you can send chat messages at any time, to all players or t **Parameters:** - - ``entity fromPlayer`` - the player the message will be from. - - ``entity toPlayer`` - the player that the message will be shown to. - - ``string text`` - the contents of the chat message. Supports [ANSI escape codes](#ansi_escape) for colors. - - ``bool whisper`` - if true, ``[WHISPER]`` will be displayed before the message to indicate the message is private. + - `entity fromPlayer` - the player the message will be from. + - `entity toPlayer` - the player that the message will be shown to. + - `string text` - the contents of the chat message. Supports [ANSI escape codes](#ansi_escape) for colors. + - `bool whisper` - if true, `[WHISPER]` will be displayed before the message to indicate the message is private. **Example:** @@ -272,8 +272,8 @@ With custom messages you can send chat messages at any time, to all players or t **Parameters:** - - ``string text`` - the contents of the chat message. Supports [ANSI escape codes](#ansi_escape) for colors. - - ``bool withServerTag`` - if true, ``[SERVER]`` will appear before the message in chat. Defaults to true. + - `string text` - the contents of the chat message. Supports [ANSI escape codes](#ansi_escape) for colors. + - `bool withServerTag` - if true, `[SERVER]` will appear before the message in chat. Defaults to true. **Example:** @@ -304,10 +304,10 @@ With custom messages you can send chat messages at any time, to all players or t **Parameters:** - - ``entity toPlayer`` - the player that the message will be shown to. - - ``string text`` - the contents of the chat message. Supports [ANSI escape codes](#ansi_escape) for colors. - - ``bool whisper`` - if true, ``[WHISPER]`` will be displayed before the message to indicate the message is private. - - ``bool withServerTag`` - if true, ``[SERVER]`` will appear before the message in chat. Defaults to true. + - `entity toPlayer` - the player that the message will be shown to. + - `string text` - the contents of the chat message. Supports [ANSI escape codes](#ansi_escape) for colors. + - `bool whisper` - if true, `[WHISPER]` will be displayed before the message to indicate the message is private. + - `bool withServerTag` - if true, `[SERVER]` will appear before the message in chat. Defaults to true. **Example:** @@ -336,19 +336,19 @@ meaning. For example, the string: Hello world, \x1b[31mthis text is red\x1b[0m. And \x1b[34mthis text is blue\x1b[0m. ``` -``\x1b`` is a special character that Squirrel (and other languages) replace with a reserved ASCII character. For future -reference this will be referred to with ``ESC`` (e.g. setting red text is ``ESC[31m``). +`\x1b` is a special character that Squirrel (and other languages) replace with a reserved ASCII character. For future +reference this will be referred to with `ESC` (e.g. setting red text is `ESC[31m`). The following commands are available: |Codes|Description| |-----|-----------| -|``ESC[0m`` and ``ESC[39m``|Reset text formatting.| -|``ESC[30-37m``, ``ESC[90-97m``|Set to one of [the available color presets](https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit).| -|``ESC[38;5;Xm``|Set to one of [the available 8-bit colors](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit).| -|``ESC[38;2;R;G;Bm``|Set to an RGB color, with ``R``, ``G`` and ``B`` in the range 0-255.| -|``ESC[110m``|Set to chat text color.| -|``ESC[111m``|Set to friendly player name color.| -|``ESC[112m``|Set to enemy player name color.| -|``ESC[113m``|Set to network name color.| +|`ESC[0m` and `ESC[39m`|Reset text formatting.| +|`ESC[30-37m`, `ESC[90-97m`|Set to one of [the available color presets](https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit).| +|`ESC[38;5;Xm`|Set to one of [the available 8-bit colors](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit).| +|`ESC[38;2;R;G;Bm`|Set to an RGB color, with `R`, `G` and `B` in the range 0-255.| +|`ESC[110m`|Set to chat text color.| +|`ESC[111m`|Set to friendly player name color.| +|`ESC[112m`|Set to enemy player name color.| +|`ESC[113m`|Set to network name color.| diff --git a/docs/Modding/reference/northstar/customdamagesources.md b/docs/Modding/reference/northstar/customdamagesources.md index 5e126de4..42ff79d0 100644 --- a/docs/Modding/reference/northstar/customdamagesources.md +++ b/docs/Modding/reference/northstar/customdamagesources.md @@ -14,9 +14,9 @@ To add multiple damage source IDs, use The first string parameter is the in-code weapon name while the latter is the name displayed in the obituary. -Damage source IDs should be added in ``"After"`` server callbacks. +Damage source IDs should be added in `"After"` server callbacks. -For example, we can call the methods from a function in ``damage_source_example.nut``: +For example, we can call the methods from a function in `damage_source_example.nut`: ```squirrel @@ -39,7 +39,7 @@ For example, we can call the methods from a function in ``damage_source_example. } ``` -Then call the function as an ``"After"`` server callback in the ``mod.json``: +Then call the function as an `"After"` server callback in the `mod.json`: ```javascript diff --git a/docs/Modding/reference/northstar/dependencyconstants.md b/docs/Modding/reference/northstar/dependencyconstants.md index 790d5a9b..6df5f3ce 100644 --- a/docs/Modding/reference/northstar/dependencyconstants.md +++ b/docs/Modding/reference/northstar/dependencyconstants.md @@ -3,16 +3,16 @@ ## Compiler Directives Compiler directives are a way to compile code only if a specific condition is met. To -use this you have the ``#if``, ``#endif``, ``#else`` and ``#elseif`` keyword. +use this you have the `#if`, `#endif`, `#else` and `#elseif` keyword. Contditons you can check for are -- ``SERVER`` Checks if the code is compiled on the server VM. -- ``CLIENT`` Checks if the code is compiled on the client VM. -- ``UI`` Checks if the code is compiled on the UI VM. -- ``MP`` Checks if the code is compiled in a multiplayer match. -- ``SP`` Checks if the code is compiled in a singeplayer match. -- ``DEV`` Checks if the code is compiled with the ``-dev`` keyword in the startup +- `SERVER` Checks if the code is compiled on the server VM. +- `CLIENT` Checks if the code is compiled on the client VM. +- `UI` Checks if the code is compiled on the UI VM. +- `MP` Checks if the code is compiled in a multiplayer match. +- `SP` Checks if the code is compiled in a singeplayer match. +- `DEV` Checks if the code is compiled with the `-dev` keyword in the startup arguments. These conditions can also be combined with the regular squirrel boolean expressions @@ -38,7 +38,7 @@ These conditions can also be combined with the regular squirrel boolean expressi Dependency constants are used to only compile code if a dependency your mod requires is loaded, these use the Compiler directives syntax. -Inside your ``mod.json`` define a constant as: +Inside your `mod.json` define a constant as: ```squirrel @@ -58,7 +58,7 @@ For Example: "PLAYER_HAS_ROGUELIKE_MOD": "TF|Roguelike" ``` -Will define a constant ``PLAYER_HAS_ROGUELIKE_MOD`` that is set to ``0`` or ``1`` +Will define a constant `PLAYER_HAS_ROGUELIKE_MOD` that is set to `0` or `1` depending if the mod is enabled. It then can be used as a constant/compiler flag. ```squirrel diff --git a/docs/Modding/reference/northstar/httprequests.md b/docs/Modding/reference/northstar/httprequests.md index c7b73d53..cd76fc62 100644 --- a/docs/Modding/reference/northstar/httprequests.md +++ b/docs/Modding/reference/northstar/httprequests.md @@ -8,10 +8,10 @@ a database with an API so that your servers can save player stats. !!! warning - For security reasons, private network hosts, such as ``localhost`` or ``192.168.1.106`` are blocked by default, meaning you cannot make HTTP requests to them. + For security reasons, private network hosts, such as `localhost` or `192.168.1.106` are blocked by default, meaning you cannot make HTTP requests to them. This includes a blanket ban on IPv6 hosts. - You are also limited to ``HTTP`` and ``HTTPS`` for protocols. Any other protocols will prevent the request from being made. + You are also limited to `HTTP` and `HTTPS` for protocols. Any other protocols will prevent the request from being made. ## Launch Arguments @@ -21,9 +21,9 @@ These should be applied to your client or server's launch commandline. |Name|Description| |---|---| -|``-allowlocalhttp``| Disables private network checks for HTTP requests, allowing any IPv4 and IPv6 host to be used.| -|``-disablehttprequests``| Disables HTTP requests. Any attempts at making requests will fail.| -|``-disablehttpssl``| Disables SSL verifications, useful when the host's SSL certificate is invalid, and insecure HTTP cannot be used.| +|`-allowlocalhttp`| Disables private network checks for HTTP requests, allowing any IPv4 and IPv6 host to be used.| +|`-disablehttprequests`| Disables HTTP requests. Any attempts at making requests will fail.| +|`-disablehttpssl`| Disables SSL verifications, useful when the host's SSL certificate is invalid, and insecure HTTP cannot be used.| ## HTTP API @@ -47,37 +47,37 @@ The HTTP system uses a few enums and structs for requests and their callbacks. !!! cpp-member "GET = 0" - Uses the ``GET`` HTTP method for the request. + Uses the `GET` HTTP method for the request. !!! cpp-member "POST = 1" - Uses the ``POST`` HTTP method for the request. + Uses the `POST` HTTP method for the request. !!! cpp-member "HEAD = 2" - Uses the ``HEAD`` HTTP method for the request. + Uses the `HEAD` HTTP method for the request. !!! cpp-member "PUT = 3" - Uses the ``PUT`` HTTP method for the request. + Uses the `PUT` HTTP method for the request. !!! cpp-member "DELETE = 4" - Uses the ``DELETE`` HTTP method for the request. + Uses the `DELETE` HTTP method for the request. !!! cpp-member "PATCH = 5" - Uses the ``PATCH`` HTTP method for the request. + Uses the `PATCH` HTTP method for the request. !!! cpp-member "OPTIONS = 6" - Uses the ``OPTIONS`` HTTP method for the request. + Uses the `OPTIONS` HTTP method for the request. !!! cpp-struct "struct HttpRequest" - Contains the settings for a HTTP request. This is used for the more flexible ``NSHttpRequest` function. + Contains the settings for a HTTP request. This is used for the more flexible `NSHttpRequest` function. !!! cpp-var "(HttpRequestMethod) int method" @@ -114,7 +114,7 @@ The HTTP system uses a few enums and structs for requests and their callbacks. !!! warning - Only ``POST`` requests can send a body to the remote end. You may only choose to send a body, or query parameters. + Only `POST` requests can send a body to the remote end. You may only choose to send a body, or query parameters. Having both will give priority to the body and clear the parameters. @@ -158,7 +158,7 @@ The HTTP system uses a few enums and structs for requests and their callbacks. !!! warning - Your mod needs to be load priority 1 or above to use ``HttpRequest`` and ``HttpRequestResponse`` in your script. + Your mod needs to be load priority 1 or above to use `HttpRequest` and `HttpRequestResponse` in your script. !!! cpp-function "bool NSHttpRequest( HttpRequest requestParameters, void functionref( HttpRequestResponse ) onSuccess = null, void functionref( HttpRequestFailure ) onFailure = null )" @@ -168,9 +168,9 @@ The HTTP system uses a few enums and structs for requests and their callbacks. **Parameters:** - - ``HttpRequest requestParameters`` - The parameters to use for this request. - - ``[OPTIONAL] void functionref( HttpRequestResponse ) onSuccess`` - The callback to execute if the request is successful. - - ``[OPTIONAL] void functionref( HttpRequestFailure ) onFailure`` - The callback to execute if the request has failed. + - `HttpRequest requestParameters` - The parameters to use for this request. + - `[OPTIONAL] void functionref( HttpRequestResponse ) onSuccess` - The callback to execute if the request is successful. + - `[OPTIONAL] void functionref( HttpRequestFailure ) onFailure` - The callback to execute if the request has failed. **Returns:** @@ -182,7 +182,7 @@ The HTTP system uses a few enums and structs for requests and their callbacks. As you can see, you can either use named functions for the callbacks, or create lambdas. Lambdas are particularly useful as they let you capture local variables of the functions to re-use later - such as ``callback`` in this example. + such as `callback` in this example. ```squirrel @@ -215,10 +215,10 @@ The HTTP system uses a few enums and structs for requests and their callbacks. **Parameters:** - - ``string url`` - The url to make the HTTP request at. - - ``[OPTIONAL] table< string, array< string > > queryParameters`` - A table of key value parameters to insert in the url. - - ``[OPTIONAL] void functionref( HttpRequestResponse ) onSuccess`` - The callback to execute if the request is successful. - - ``[OPTIONAL] void functionref( HttpRequestFailure ) onFailure`` - The callback to execute if the request has failed. + - `string url` - The url to make the HTTP request at. + - `[OPTIONAL] table< string, array< string > > queryParameters` - A table of key value parameters to insert in the url. + - `[OPTIONAL] void functionref( HttpRequestResponse ) onSuccess` - The callback to execute if the request is successful. + - `[OPTIONAL] void functionref( HttpRequestFailure ) onFailure` - The callback to execute if the request has failed. **Returns:** @@ -256,10 +256,10 @@ The HTTP system uses a few enums and structs for requests and their callbacks. **Parameters:** - - ``string url`` - The url to make the HTTP request at. - - ``[OPTIONAL] table< string, array< string > > queryParameters`` - A table of key value parameters to insert in the url. - - ``[OPTIONAL] void functionref( HttpRequestResponse ) onSuccess`` - The callback to execute if the request is successful. - - ``[OPTIONAL] void functionref( HttpRequestFailure ) onFailure`` - The callback to execute if the request has failed. + - `string url` - The url to make the HTTP request at. + - `[OPTIONAL] table< string, array< string > > queryParameters` - A table of key value parameters to insert in the url. + - `[OPTIONAL] void functionref( HttpRequestResponse ) onSuccess` - The callback to execute if the request is successful. + - `[OPTIONAL] void functionref( HttpRequestFailure ) onFailure` - The callback to execute if the request has failed. **Returns:** @@ -277,10 +277,10 @@ The HTTP system uses a few enums and structs for requests and their callbacks. **Parameters:** - - ``string url`` - The url to make the HTTP request at. - - ``string body`` - The body to send with the request. Expects JSON by default. - - ``[OPTIONAL] void functionref( HttpRequestResponse ) onSuccess`` - The callback to execute if the request is successful. - - ``[OPTIONAL] void functionref( HttpRequestFailure ) onFailure`` - The callback to execute if the request has failed. + - `string url` - The url to make the HTTP request at. + - `string body` - The body to send with the request. Expects JSON by default. + - `[OPTIONAL] void functionref( HttpRequestResponse ) onSuccess` - The callback to execute if the request is successful. + - `[OPTIONAL] void functionref( HttpRequestFailure ) onFailure` - The callback to execute if the request has failed. **Returns:** @@ -315,7 +315,7 @@ The HTTP system uses a few enums and structs for requests and their callbacks. **Parameters:** - - ``int statusCode`` - The status code to verify. + - `int statusCode` - The status code to verify. **Returns:** @@ -327,11 +327,11 @@ The HTTP system uses a few enums and structs for requests and their callbacks. !!! warning - The JSON parser currently supports the following types for values: ``string``, ``integer``, ``float``, ``bool``, ``table``, and ``array``. + The JSON parser currently supports the following types for values: `string`, `integer`, `float`, `bool`, `table`, and `array`. Tables and arrays can only hold supported types. Unsupported types will be ignored. Keys can only be strings. - The JSON parser currently does not support keys holding ``null`` values, and simply won't include them in decoded tables or encoded JSON strings. + The JSON parser currently does not support keys holding `null` values, and simply won't include them in decoded tables or encoded JSON strings. @@ -343,12 +343,12 @@ The HTTP system uses a few enums and structs for requests and their callbacks. **Parameters:** - - ``string json`` - The JSON string to decode into a table. - - ``[OPTIONAL] bool fatalParseErrors`` - Whether or not parsing errors should throw a fatal script error. Default to false. + - `string json` - The JSON string to decode into a table. + - `[OPTIONAL] bool fatalParseErrors` - Whether or not parsing errors should throw a fatal script error. Default to false. **Returns:** - - The table decoded from the JSON string on success, or an empty table ``{}`` on parse failure (if fatalParseErrors is false). + - The table decoded from the JSON string on success, or an empty table `{}` on parse failure (if fatalParseErrors is false). @@ -359,7 +359,7 @@ The HTTP system uses a few enums and structs for requests and their callbacks. **Parameters:** - - ``table data`` - The table to encode to a JSON string. + - `table data` - The table to encode to a JSON string. **Returns:** diff --git a/docs/Modding/reference/northstar/modsettings.md b/docs/Modding/reference/northstar/modsettings.md index e8f541a1..8ce00380 100644 --- a/docs/Modding/reference/northstar/modsettings.md +++ b/docs/Modding/reference/northstar/modsettings.md @@ -21,9 +21,9 @@ Inside of the callback specified here, you can add your settings. !!! warning - ConVar values will only persist if the ConVar has an ARCHIVE flag. For Clients, use ``FCVAR_ARCHIVE_PLAYERPROFILE``. + ConVar values will only persist if the ConVar has an ARCHIVE flag. For Clients, use `FCVAR_ARCHIVE_PLAYERPROFILE`. - All Mod Settings functions have a ``stackPos`` paramter. This parameter should only be changed if you're writing custom wrappers for the settings. + All Mod Settings functions have a `stackPos` paramter. This parameter should only be changed if you're writing custom wrappers for the settings. !!! cpp-function "void ModSettings_AddModTitle( string modName, int stackPos = 2 )" @@ -47,18 +47,18 @@ Inside of the callback specified here, you can add your settings. **Parameters:** - * ``string conVar`` - the ConVar this setting modifies - * ``string displayName`` - The display string of this setting. This can be a localization token. - * ``string type = ""`` - Optional type of this ConVar. This guards against users inserting invalid values. - * ``int stackPos = 2`` + * `string conVar` - the ConVar this setting modifies + * `string displayName` - The display string of this setting. This can be a localization token. + * `string type = ""` - Optional type of this ConVar. This guards against users inserting invalid values. + * `int stackPos = 2` **Types:** - * ``int`` - * ``bool`` - * ``float`` - * ``float2`` - * ``float3`` / ``vector`` + * `int` + * `bool` + * `float` + * `float2` + * `float3` / `vector` other types will default to setting a string for the ConVar. @@ -68,10 +68,10 @@ Inside of the callback specified here, you can add your settings. **Parameters:** - * ``string conVar`` - the ConVar this setting modifies - * ``string displayName`` - The display string of this setting. This can be a localization token. - * ``array values`` - all possible values of this enum. The ConVar value will be set to the index of the selected value. - * ``int stackPos = 2`` + * `string conVar` - the ConVar this setting modifies + * `string displayName` - The display string of this setting. This can be a localization token. + * `array values` - all possible values of this enum. The ConVar value will be set to the index of the selected value. + * `int stackPos = 2` !!! cpp-function "void ModSettings_AddSliderSetting( string conVar, string displayName, float min = 0.0, float max = 1.0, float stepSize = 0.1, bool forceClamp = false )" @@ -79,12 +79,12 @@ Inside of the callback specified here, you can add your settings. **Parameters:** - * ``string conVar`` - the conVar this setting modifies - * ``string displayName`` - The display string of this setting. This can be a localization token. - * ``float min = 0.0`` - the minimum value of the ConVar - * ``float max = 0.0`` - the maximum value of the ConVar - * ``float stepSize = 0.1`` - the distance between each possible value. - * ``bool forceClamp = false`` - wether to force the value to round to the nearest interval of ``stepValue``. + * `string conVar` - the conVar this setting modifies + * `string displayName` - The display string of this setting. This can be a localization token. + * `float min = 0.0` - the minimum value of the ConVar + * `float max = 0.0` - the maximum value of the ConVar + * `float stepSize = 0.1` - the distance between each possible value. + * `bool forceClamp = false` - wether to force the value to round to the nearest interval of `stepValue`. !!! note @@ -96,9 +96,9 @@ Inside of the callback specified here, you can add your settings. **Parameters:** - * ``string conVar`` - the conVar this setting modifies - * ``void functionref() onPress`` - callback that gets triggered when this button is pressed. - * ``int stackPos`` + * `string conVar` - the conVar this setting modifies + * `void functionref() onPress` - callback that gets triggered when this button is pressed. + * `int stackPos` ## Examples @@ -128,4 +128,4 @@ To create custom wrapper functions you need to specify the stack position where } ``` -Note that in this example the stack position is ``3``, since ``AddModSettingsButton`` needs to walk one additional step to the callback function. +Note that in this example the stack position is `3`, since `AddModSettingsButton` needs to walk one additional step to the callback function. diff --git a/docs/Modding/reference/northstar/msinterface.md b/docs/Modding/reference/northstar/msinterface.md index cbec2f94..547f34ab 100644 --- a/docs/Modding/reference/northstar/msinterface.md +++ b/docs/Modding/reference/northstar/msinterface.md @@ -2,7 +2,7 @@ !!! note - All of these functions are only exposed to the ``UI`` VM. + All of these functions are only exposed to the `UI` VM. These are functions required for the ingame server browser and the authorization process for the Masterserver and game servers. @@ -10,26 +10,26 @@ These are functions required for the ingame server browser and the authorization !!! cpp-function "bool NSIsMasterServerAuthenticated()" - Returns ``true`` if the client is authenticated with the Masterserver + Returns `true` if the client is authenticated with the Masterserver !!! cpp-function "bool NSMasterServerConnectionSuccessful()" - Returns ``true`` if a successful connection has been established + Returns `true` if a successful connection has been established ## Game Server Authentification !!! cpp-function "void NSTryAuthWithServer( int serverIndex, string password = "" )" - Tries authing with the fetched server at ``serverIndex`` and the provided password + Tries authing with the fetched server at `serverIndex` and the provided password !!! cpp-function "bool NSIsAuthenticatingWithServer()" - Returns ``true`` if the client is currently authing with a game server + Returns `true` if the client is currently authing with a game server !!! cpp-function "bool NSWasAuthSuccessful()" - Returns ``true`` if the client successfully authed with a game server + Returns `true` if the client successfully authed with a game server !!! cpp-function "void NSConnectToAuthedServer()" @@ -46,7 +46,7 @@ These are functions required for the ingame server browser and the authorization !!! cpp-function "void NSCompleteAuthWithLocalServer()" - Call this after `NSWasAuthSuccessful` returns ``true`` to complete the local authorization process. + Call this after `NSWasAuthSuccessful` returns `true` to complete the local authorization process. ## Server Information @@ -56,7 +56,7 @@ These are functions required for the ingame server browser and the authorization !!! cpp-function "bool NSIsRequestingServerList()" - Returns ``true`` if the last request by + Returns `true` if the last request by !!! cpp-function "int NSGetServerCount()" @@ -125,7 +125,7 @@ These are functions required for the ingame server browser and the authorization !!! cpp-var "bool requiresPassword" - If ``true`` an extra password is required to connect to the server. Otherwise the password is an empty string + If `true` an extra password is required to connect to the server. Otherwise the password is an empty string !!! cpp-var "string region" diff --git a/docs/Modding/reference/northstar/safeio.md b/docs/Modding/reference/northstar/safeio.md index 39550fda..5ebb71cb 100644 --- a/docs/Modding/reference/northstar/safeio.md +++ b/docs/Modding/reference/northstar/safeio.md @@ -1,6 +1,6 @@ # Safe I/O -If you want to store an extended amount of data in your mod it is not sustainable to only use ConVars as they are limited in space and easily reset. With Safe I/O you are able to write to one folder (``/saves/``). In this folder you can store text files of any type (e.g. ``.txt``, ``.json``), it's also possible to use non text file formats (e.g. ``.exe``) however you won't be able to run them on your PC. It also allows for sub-folders. +If you want to store an extended amount of data in your mod it is not sustainable to only use ConVars as they are limited in space and easily reset. With Safe I/O you are able to write to one folder (`/saves/`). In this folder you can store text files of any type (e.g. `.txt`, `.json`), it's also possible to use non text file formats (e.g. `.exe`) however you won't be able to run them on your PC. It also allows for sub-folders. ## Saving a file @@ -11,7 +11,7 @@ To actually save the file you use: !!! cpp-function "void NSSaveFile( string file, string data )" - - `string file` The name of the file you want to store, this supports sub folders. Needs to be with the file type (e.g. ``/TitanData/tone.txt``). + - `string file` The name of the file you want to store, this supports sub folders. Needs to be with the file type (e.g. `/TitanData/tone.txt`). - `string data` The saved data, this can be any valid String. @@ -20,7 +20,7 @@ Alternatively if you want a faster way to store `table_overview` you can use: !!! cpp-function "void NSSaveJSONFile(string file, table data)" - - `string file` The name of the file you want to store, this supports sub folders. Doesn't have to be ``.json`` but will use the correct formatting for a ``.json``. + - `string file` The name of the file you want to store, this supports sub folders. Doesn't have to be `.json` but will use the correct formatting for a `.json`. - `table data` The table that will be written to the file, this only supports the types specified in the `json_overview`. @@ -28,11 +28,11 @@ Alternatively if you want a faster way to store `table_overview` you can use: !!! cpp-function "void function NSLoadFile( string file, void functionref( string ) onSuccess, void functionref() onFailure = null )" - - `string file` This is the name of the file you want to load, it has the same formating as in ``NSSaveFile``. + - `string file` This is the name of the file you want to load, it has the same formating as in `NSSaveFile`. - - `void functionref( string ) onSuccess` The function that gets execued when the file is successfully loaded, the parameter ``string`` is the content of the loaded file. + - `void functionref( string ) onSuccess` The function that gets execued when the file is successfully loaded, the parameter `string` is the content of the loaded file. - - `void functionref() onFailure = null` The function that gets execued when the loading was NOT successful, by default the function is just ``null``. + - `void functionref() onFailure = null` The function that gets execued when the loading was NOT successful, by default the function is just `null`. !!! note If you are having trouble with functionrefs you can read up on them here: :ref:`functionref_overview` @@ -41,7 +41,7 @@ You can also get all saved file: !!! cpp-function "array function NSGetAllFiles( string path = "" )" - - `string path = "": Gets all files in a specified path, by default its just ``/saves/``. + - `string path = "": Gets all files in a specified path, by default its just `/saves/`. Returns: An array with all file names in the specified path. @@ -49,16 +49,16 @@ You can also get all saved file: !!! cpp-function "void NSDeleteFile(string file)" - `string file` This is the name of the file you want to check exsits, it has the same formating as in ``NSSaveFile``. + `string file` This is the name of the file you want to check exsits, it has the same formating as in `NSSaveFile`. ## File checks !!! cpp-function "bool NSDoesFileExist(string file)" - `string file` This is the name of the file you want to check exsits, it has the same formating as in ``NSSaveFile``. + `string file` This is the name of the file you want to check exsits, it has the same formating as in `NSSaveFile`. - Returns: ``true`` if the file was found, otherwise it returns ``false``. + Returns: `true` if the file was found, otherwise it returns `false`. !!! cpp-function "int NSGetFileSize(string file)" @@ -75,11 +75,11 @@ You can also get all saved file: `string file` This is the path you want to check. - Returns: ``true`` if the path is a folder, otherwise it returns ``false``. + Returns: `true` if the path is a folder, otherwise it returns `false`. !!! cpp-function "int NSGetTotalSpaceRemaining()" Returns: Amount of KB you have left to write on. !!! note - The max size of data you can store is ``50MB`` per mod. Can be overwritten with ``-maxfoldersize BYTES`` in the launch args. + The max size of data you can store is `50MB` per mod. Can be overwritten with `-maxfoldersize BYTES` in the launch args. diff --git a/docs/Modding/reference/northstar/serversiderui.md b/docs/Modding/reference/northstar/serversiderui.md index b344b447..58741163 100644 --- a/docs/Modding/reference/northstar/serversiderui.md +++ b/docs/Modding/reference/northstar/serversiderui.md @@ -1,13 +1,13 @@ # Serverside RUI {#serverside-rui-doc} -Server-side Rui provides a set of functions enabling servers to display complex hud elements on clients without requiring a client-side mod. These functions were introduced in Northstar ``1.10.0``. +Server-side Rui provides a set of functions enabling servers to display complex hud elements on clients without requiring a client-side mod. These functions were introduced in Northstar `1.10.0`. It should be noted that there’s no guarantee the client will see the hud elements. ## Polls -Creates a poll on ``player``. +Creates a poll on `player`.
/_static/serversiderui/vote.png !!! cpp-function "int NSGetPlayerResponse( entity player )" - Returns the index of the item from ``options`` the player voted for. If the player hadn't voted yet it returns a -1. + Returns the index of the item from `options` the player voted for. If the player hadn't voted yet it returns a -1. **Example:** @@ -52,7 +52,7 @@ alt="/_static/serversiderui/vote.png" /> ## Large Message -Sends a large message to ``player`` which will appear in the top right corner. +Sends a large message to `player` which will appear in the top right corner.
/_static/serversiderui/largemessage.gif ## Info Message -Sends a smaller message to ``player`` which will appear from the center right. +Sends a smaller message to `player` which will appear from the center right.
/_static/serversiderui/info.gif ## PopUp -Send a small popup to ``player`` which will appear in the lower half of their screen under their cursor. +Send a small popup to `player` which will appear in the lower half of their screen under their cursor.
/_static/serversiderui/popup.gif ## Announcement -Sends a large announcement to ``player``. +Sends a large announcement to `player`.
`` and gets automatically updated by the game. The higher the index the older the ``DamageHistoryStruct`` is ( so to get the most recent struct you do ``player.e.recentDamageHistory[ 0 ]`` ). +You can get the damage history for any player entity with `player.e.recentDamageHistory`, this is of the type `array` and gets automatically updated by the game. The higher the index the older the `DamageHistoryStruct` is ( so to get the most recent struct you do `player.e.recentDamageHistory[ 0 ]` ). ### Getter functions @@ -63,7 +63,7 @@ You can get the damage history for any player entity with ``player.e.recentDamag - `float time` How old the damage history can be in seconds. - - Returns: All ``DamageHistoryStruct`` found in the given time frame. + - Returns: All `DamageHistoryStruct` found in the given time frame. ### Setter functions @@ -71,7 +71,7 @@ You can get the damage history for any player entity with ``player.e.recentDamag !!! cpp-function "void function UpdateDamageHistory( entity player, float maxTime, float time )" - Removes all ``DamageHistoryStruct`` in the time frame ``time - maxTime`` + Removes all `DamageHistoryStruct` in the time frame `time - maxTime` - `entity player` The player you want to update the damage history from. diff --git a/docs/Modding/reference/respawn/dialog.md b/docs/Modding/reference/respawn/dialog.md index 07e3ac85..add438ef 100644 --- a/docs/Modding/reference/respawn/dialog.md +++ b/docs/Modding/reference/respawn/dialog.md @@ -17,7 +17,7 @@ All the data in the struct that can be changed. The headline of the dialog !!! cpp-var "string message" - The body of text under the headline, it supports newline with ``\n`` + The body of text under the headline, it supports newline with `\n` !!! cpp-var "DialogMessageRuiData &ruiMessage" Stores relevant RUI data @@ -44,7 +44,7 @@ All the data in the struct that can be changed. Sets the left image as an animated spinner !!! cpp-var "bool showPCBackButton = false" - Shows an additional button below all other buttons that closes the dialog for the client when pressed, works the same as pressing the ``esc`` button + Shows an additional button below all other buttons that closes the dialog for the client when pressed, works the same as pressing the `esc` button !!! cpp-var "float inputDisableTime = 0" How long it takes before the client is able to press a button @@ -59,10 +59,10 @@ All the data in the struct that can be changed. Creates a larger dialog window even if there is no text or buttons to fill that space !!! cpp-var "array buttonData" - Stores the information added by the ``AddDialogButton`` function + Stores the information added by the `AddDialogButton` function !!! cpp-var "array footerData" - Stores the information added by the ``AddDialogFooter`` function + Stores the information added by the `AddDialogFooter` function !!! cpp-struct "DialogMessageRuiData" @@ -110,7 +110,7 @@ All the data in the struct that can be changed. - `DialogData dialog` Instance of a DialogData struct - - `string text` The Text that is shown on the button, supports some assets with ``%ASSET PATH%`` + - `string text` The Text that is shown on the button, supports some assets with `%ASSET PATH%` - `void functionref() callback` Function that is executed when the button is pressed. @@ -135,14 +135,14 @@ All the data in the struct that can be changed. - `DialogData dialog` Instance of a DialogData struct - - `string text` The Text that is shown on the button, supports some assets with ``%ASSET PATH%`` + - `string text` The Text that is shown on the button, supports some assets with `%ASSET PATH%` !!! cpp-function "bool IsDialogActive( DialogData dialogData )" - `DialogData dialog` Instance of a DialogData struct - - Returns: ``true`` if the dialog with that struct is currently open, otherwise it returns ``false`` + - Returns: `true` if the dialog with that struct is currently open, otherwise it returns `false` !!! cpp-function "void OpenErrorDialog( string errorDetails )" diff --git a/docs/Modding/reference/respawn/entities.md b/docs/Modding/reference/respawn/entities.md index 446badf9..534729a2 100644 --- a/docs/Modding/reference/respawn/entities.md +++ b/docs/Modding/reference/respawn/entities.md @@ -1,6 +1,6 @@ # Entities -There are different Classes for Server and Client. Classes that start with ``C_`` are exclusive to the Client VM and classes that only have the ``C`` Prefix are only usable in the Server VM. +There are different Classes for Server and Client. Classes that start with `C_` are exclusive to the Client VM and classes that only have the `C` Prefix are only usable in the Server VM. Most entries have three sub entries: The class available to the SERVER, the CLIENT and methods that are available on both VMs. @@ -8,7 +8,7 @@ For a graphic reprasentation of the Server and Client class inheritance, refer t !!! note - Pay attention to the ``extends`` keyword for each class! You can use every property of that the parent class has access to! + Pay attention to the `extends` keyword for each class! You can use every property of that the parent class has access to! This List of Classes and their Methods is incomplete! @@ -57,7 +57,7 @@ Basic entity that most other entities inherit from. !!! cpp-function "void AddOutput( string outputName, string | entity target, string inputName, string parameter = "", float delay = 0, float maxFires = 0 )" - Connects an output on this entity to an input on another entity via code. The ``target`` can be a name or a named entity. + Connects an output on this entity to an input on another entity via code. The `target` can be a name or a named entity. !!! cpp-function "vector GetOrigin()" @@ -73,7 +73,7 @@ Basic entity that most other entities inherit from. !!! cpp-function "entity GetOwner()" - Returns the owner of this entity. Set the owner with ``SetOwner`` + Returns the owner of this entity. Set the owner with `SetOwner` !!! cpp-function "entity GetBossPlayer()" @@ -85,40 +85,40 @@ Basic entity that most other entities inherit from. !!! cpp-function "bool IsNPC()" - Returns ``true`` if this entity is an NPC + Returns `true` if this entity is an NPC !!! cpp-function "bool IsTitan()" - Returns ``true`` if this entity is a Titan + Returns `true` if this entity is a Titan !!! cpp-function "bool IsHuman()" Returns true if this entity is a gameplay-wise a human. - For example, returns ``true`` if the entity is a grunt but ``false`` if the entity is a Titan or spectre etc. + For example, returns `true` if the entity is a grunt but `false` if the entity is a Titan or spectre etc. However, players will always be Human, even when they are spectating or their playermodel is robotic (for example when playing as stim) !!! cpp-function "bool IsMechanical()" - Returns ``true`` if this entity is mechanical. Examples are Titans and spectres + Returns `true` if this entity is mechanical. Examples are Titans and spectres !!! note - This returns ``true`` for players that are playing mechanical classes + This returns `true` for players that are playing mechanical classes !!! cpp-function "bool IsPhaseShifted()" - Returns ``true`` if this entity is currently phase shifting + Returns `true` if this entity is currently phase shifting !!! cpp-function "bool IsPlayer()" - Returns ``true`` if this entity is a player + Returns `true` if this entity is a player !!! cpp-function "bool IsProjectile()" - Returns ``true`` if this entity is a projectile + Returns `true` if this entity is a projectile !!! cpp-function "asset GetModelName()" @@ -142,13 +142,13 @@ Basic entity that most other entities inherit from. !!! cpp-function "void SetValueForEffectNameKey( asset effect )" - Similar to ``SetValueForModelKey`` but for FX. + Similar to `SetValueForModelKey` but for FX. !!! cpp-function "table CreateTableFromModelKeyValues()" !!! cpp-function "int GetArmorType()" - Returns ``0`` for light armor and ``1`` for heavy armor + Returns `0` for light armor and `1` for heavy armor Titans use heavy armor while pilots and similar use light armor @@ -170,7 +170,7 @@ Basic entity that most other entities inherit from. !!! cpp-function "bool HasGibModel()" - Returns ``true`` if this entity has gib models + Returns `true` if this entity has gib models !!! cpp-function "bool HasKey( string key )" @@ -198,13 +198,13 @@ Basic entity that most other entities inherit from. !!! cpp-function "var Get( string key )" - The same as ``GetValueForKey`` + The same as `GetValueForKey` !!! cpp-function "void SetValueForKey( var key, var val )" !!! cpp-function "var Set( string key )" - The same as ``SetValueForKey`` + The same as `SetValueForKey` !!! cpp-function "vector GetVelocity()" @@ -220,7 +220,7 @@ Basic entity that most other entities inherit from. !!! cpp-function "bool IsInvulnerable()" - returns ``true`` if this entity is invulnerable + returns `true` if this entity is invulnerable !!! cpp-function "vector GetWorldSpaceCenter()" @@ -288,17 +288,17 @@ Basic entity that most other entities inherit from. !!! cpp-function "bool IsCloaked()" - Returns ``true`` if this entity is cloaked + Returns `true` if this entity is cloaked !!! cpp-function "bool IsEntAlive()" - Returns ``true`` if this entity is alive + Returns `true` if this entity is alive !!! cpp-function "bool IsValidInternal()" - Returns ``true`` if this entity is Valid. + Returns `true` if this entity is Valid. - ``IsValid( ent )`` is a good alternative + `IsValid( ent )` is a good alternative !!! cpp-function "vector GetForwardVector()" @@ -318,7 +318,7 @@ Basic entity that most other entities inherit from. Returns a new instance of a class. - You can invoke the constructor with brackets as well, for example like this: ``CBaseEntity()`` + You can invoke the constructor with brackets as well, for example like this: `CBaseEntity()` !!! cpp-function "void SetDoDestroyCallback( bool doCallBack )" @@ -334,15 +334,15 @@ Basic entity that most other entities inherit from. !!! cpp-function "bool GetCritsPrevented()" - Returns ``true`` if this entity can't be critted. + Returns `true` if this entity can't be critted. !!! cpp-function "bool IsHologram()" - Returns ``true`` if this entity is a hologram + Returns `true` if this entity is a hologram !!! cpp-function "bool IsOnGround()" - Returns ``true`` if this entity is touching the ground + Returns `true` if this entity is touching the ground !!! cpp-function "void SetModel( asset model )" @@ -360,17 +360,17 @@ Basic entity that most other entities inherit from. !!! cpp-function "bool IsBreakableGlass()" - Returns ``true`` if this entity is breakable glass + Returns `true` if this entity is breakable glass !!! cpp-function "bool IsWorld()" - Returns ``true```if this entity is the gameworld + Returns `true```if this entity is the gameworld !!! cpp-function "void DispatchImpactEffects( entity ent, vector startPos, vector endPos, vector hitNormal, entity prop, int propIndex, int damageType, int impactIndex, entity orig, int impactEffectFlags )" !!! cpp-function "void IsPlayerDecoy()" - Returns ``true`` if this entity is a decoy + Returns `true` if this entity is a decoy !!! cpp-function "void SetPassThroughDirection( float dir )" @@ -378,7 +378,7 @@ Basic entity that most other entities inherit from. !!! cpp-function "void SetTakeDamageType( int takeDamageType )" - ``DAMAGE_NO``, ``DAMAGE_YES``, ``DAMAGE_EVENTS_ONLY`` + `DAMAGE_NO`, `DAMAGE_YES`, `DAMAGE_EVENTS_ONLY` !!! cpp-function "void SetPreventCrits( bool prevent )" @@ -452,11 +452,11 @@ Basic entity that most other entities inherit from. !!! cpp-function "bool NotSolid()" - Returns ``false`` if this entity is solid + Returns `false` if this entity is solid !!! cpp-function "void MoveTo( vector pos, float moveTime, float easeIn = 0, float easeOut = 0 )" - Moves this entity to ``pos`` over the duration of ``moveTime`` with ease in and ease out + Moves this entity to `pos` over the duration of `moveTime` with ease in and ease out !!! note @@ -618,7 +618,7 @@ Basic entity that most other entities inherit from. the function must be called (or the entity deleted) at some point to avoid leaking the new slot we make in this Table. - compile with output with ``compilestring`` + compile with output with `compilestring` ### C_BaseEntity @@ -696,7 +696,7 @@ Basic entity that most other entities inherit from. !!! cpp-function "bool IsHUDVisible()" - Return ``true`` if HUD is shown on this entity + Return `true` if HUD is shown on this entity ## CDynamicProp / C_DynamicProp @@ -771,7 +771,7 @@ Weapons hold by a player or that are lying on the ground are of this type. !!! cpp-function "bool GetAllowHeadShots()" - Returns ``true`` if this weapon can deal crits + Returns `true` if this weapon can deal crits !!! cpp-function "float GetMaxDamageFarDist()" @@ -807,7 +807,7 @@ Weapons hold by a player or that are lying on the ground are of this type. !!! cpp-function "bool IsChargeWeapon()" - Returns ``true`` if this weapon is a charge weapon + Returns `true` if this weapon is a charge weapon !!! cpp-function "void SetNextAttackAllowedTime( float time )" @@ -833,7 +833,7 @@ Weapons hold by a player or that are lying on the ground are of this type. !!! cpp-function "bool IsWeaponOffhand()" - Returns ``true`` if this weapon is equipped as a offhand weapon + Returns `true` if this weapon is equipped as a offhand weapon !!! cpp-function "float GetWeaponChargeFraction()" @@ -845,7 +845,7 @@ Weapons hold by a player or that are lying on the ground are of this type. !!! cpp-function "bool HasMod( string mod )" - Check if the array of mods for this weapon contains ``mod`` + Check if the array of mods for this weapon contains `mod` !!! cpp-function "int GetWeaponCurrentEnergyCost()" @@ -895,7 +895,7 @@ Weapons hold by a player or that are lying on the ground are of this type. !!! cpp-function "bool ShouldPredictProjectiles()" - Returns ``true`` if clients should be predicting the projectiles fired from this weapon. + Returns `true` if clients should be predicting the projectiles fired from this weapon. !!! cpp-function "float GetScriptTime0()" @@ -903,11 +903,11 @@ Weapons hold by a player or that are lying on the ground are of this type. !!! cpp-function "void SetScriptTime0( float gameTime )" - ``gameTime`` needs to be game time. The current game time can be retrieved with ``Time()`` + `gameTime` needs to be game time. The current game time can be retrieved with `Time()` !!! cpp-function "bool IsReloading()" - Returns ``true`` if this weapon is currently being reloaded. + Returns `true` if this weapon is currently being reloaded. !!! cpp-function "void SetForcedADS()" @@ -989,7 +989,7 @@ Weapons hold by a player or that are lying on the ground are of this type. !!! cpp-function "bool IsWeaponInAds()" - Returns ``true`` if this weapon is in ADS. + Returns `true` if this weapon is in ADS. !!! cpp-function "void ResetWeaponToDefaultEnergyCost()" @@ -1005,13 +1005,13 @@ Weapons hold by a player or that are lying on the ground are of this type. !!! cpp-function "bool IsWeaponAdsButtonPressed()" - Returns ``true`` while the ADS button is pressed. + Returns `true` while the ADS button is pressed. !!! cpp-function "float GetWeaponChargeLevelMax()" !!! cpp-function "bool IsReadyToFire()" - Returns ``true`` if the weapon can be fired. + Returns `true` if the weapon can be fired. !!! cpp-function "void SetAttackKickRollScale(float scale)" @@ -1029,7 +1029,7 @@ Weapons hold by a player or that are lying on the ground are of this type. !!! cpp-function "string GetSmartAmmoWeaponType()" - Check if weaponType is valid: ``Assert( weaponType in VALID_WEAPON_TYPES )`` + Check if weaponType is valid: `Assert( weaponType in VALID_WEAPON_TYPES )` !!! cpp-function "int GetWeaponBurstFireCount()" @@ -1075,11 +1075,11 @@ Weapons hold by a player or that are lying on the ground are of this type. !!! cpp-function "void ForceReleaseFromServer()" - Will eventually result in ``Grenade_OnWeaponToss_()`` or equivalent function + Will eventually result in `Grenade_OnWeaponToss_()` or equivalent function !!! cpp-function "bool IsForceReleaseFromServer()" - returns ``true`` if this weapon has been forced to be released + returns `true` if this weapon has been forced to be released ### C_WeaponX @@ -1091,7 +1091,7 @@ Weapons hold by a player or that are lying on the ground are of this type. !!! cpp-function "void SetViewmodelAmmoModelIndex( int index )" - ``index`` may be the number of rounds in the clip etc. + `index` may be the number of rounds in the clip etc. ## CProjectile / C_Projectile @@ -1183,7 +1183,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "bool GrenadeHasIgnited()" - Returns ``true`` if this grenade has already been ignited + Returns `true` if this grenade has already been ignited !!! cpp-function "void GrenadeIgnite()" @@ -1231,7 +1231,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "void InitMissileSpiral( vector pos, vector dir, int missileNumber, bool unknown_purpose1, bool unknown_purpose2 )" - If both ``slowAndExpand`` and ``consistentSpacing`` are true, missiles fly faster instead of normal ``slowAndExpand`` behavior. + If both `slowAndExpand` and `consistentSpacing` are true, missiles fly faster instead of normal `slowAndExpand` behavior. !!! cpp-function "void SetSpeed( float speed )" @@ -1277,7 +1277,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "bool Lunge_IsActive()" - Returns ``true`` if the player is currently lunging to a melee victim. + Returns `true` if the player is currently lunging to a melee victim. !!! cpp-function "bool GetForcedDialogueOnly()" @@ -1329,7 +1329,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "int Code_GetActiveBurnCardIndex()" - Use ``GetActiveBurnCardIndex`` instead + Use `GetActiveBurnCardIndex` instead !!! cpp-function "string GetPlayerSettingsField( string field )" @@ -1369,7 +1369,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "bool IsWallHanging()" - Returns ``true`` if the player is wall hanging. + Returns `true` if the player is wall hanging. !!! cpp-function "float GetNextTitanRespawnAvailable()" @@ -1393,21 +1393,21 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "bool IsCrouched()" - Returns ``true`` if the player is crouching. + Returns `true` if the player is crouching. !!! cpp-function "bool IsStanding()" - Returns ``true`` if the player is standing + Returns `true` if the player is standing !!! cpp-function "void IsTraversing()" !!! cpp-function "void IsWallRunning()" - Returns ``true`` if the player is wallrunning. + Returns `true` if the player is wallrunning. !!! cpp-function "bool IsZiplining()" - Returns ``true`` if the player is currently attached to a zipline + Returns `true` if the player is currently attached to a zipline !!! cpp-function "vector Lunge_GetStartPositionOffset()" @@ -1493,11 +1493,11 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "void HolsterWeapon()" - Holsters this weapon. The player can't use it until it's deployed again with ``DeployWeapon`` + Holsters this weapon. The player can't use it until it's deployed again with `DeployWeapon` !!! cpp-function "void DeployWeapon()" - May not work with ``DeployAndEnableWeapons()`` and ``HolsterAndDisableWeapons()`` + May not work with `DeployAndEnableWeapons()` and `HolsterAndDisableWeapons()` !!! cpp-function "float GetZoomFrac()" @@ -1550,7 +1550,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "entity CreateAnimatedPlayerDecoy( string decoyType )" - Decoy Types: ``pt_mp_execution_attacker_hologram_01``, ``pt_mp_execution_attacker_hologram_02``, ``pt_mp_execution_attacker_hologram_03`` + Decoy Types: `pt_mp_execution_attacker_hologram_01`, `pt_mp_execution_attacker_hologram_02`, `pt_mp_execution_attacker_hologram_03` !!! cpp-function "void StopObserverMode()" @@ -1574,7 +1574,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "bool IsNoclipping()" - Returns ``true`` if noclip is enabled. + Returns `true` if noclip is enabled. !!! cpp-function "void SetCinematicEventFlags( int flag )" @@ -1618,7 +1618,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "void ClientCommand( string command )" - Executes a command on the player's client. For a server to execute a console command on a client, the client has to launch the game with the ``norestrictservercommands`` launch argument for security reasons. + Executes a command on the player's client. For a server to execute a console command on a client, the client has to launch the game with the `norestrictservercommands` launch argument for security reasons. !!! cpp-function "entity GetCockpit()" @@ -1687,13 +1687,13 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "bool IsDoomed()" - Returns ``true`` if this soul is in doomed state + Returns `true` if this soul is in doomed state !!! cpp-function "float GetTitanSoulNetFloat( string key )" !!! cpp-function "entity GetInvalidHealthBarEnt()" - Returns an instance of ``CNPC_Titan`` + Returns an instance of `CNPC_Titan` !!! cpp-function "int GetTitanSoulNetInt( string key )" @@ -1911,7 +1911,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "int GetAIClass()" - ``AIC_SMALL_TURRET``, ``AIC_MARVIN``, ``AIC_SPECTRE``, ``AIC_STALKER_CRAWLING``, ``AIC_FRAG_DRONE``, ``AIC_HUMAN`` + `AIC_SMALL_TURRET`, `AIC_MARVIN`, `AIC_SPECTRE`, `AIC_STALKER_CRAWLING`, `AIC_FRAG_DRONE`, `AIC_HUMAN` !!! cpp-function "string GetBodyType()" @@ -1937,7 +1937,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "void DisableBehavior( string behaviour )" - Possible behaviours: ``Follow``, ``Assault`` + Possible behaviours: `Follow`, `Assault` !!! cpp-function "void SetThinkEveryFrame( bool think )" @@ -1983,7 +1983,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "bool CanSee( entity ent )" - Returns ``true`` if the npc can see the ``ent``. + Returns `true` if the npc can see the `ent`. !!! cpp-function "bool IsCrouching()" @@ -2007,7 +2007,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "bool HasXRaySupport()" - Returns if ``this.supportsXRay`` not null. + Returns if `this.supportsXRay` not null. !!! cpp-function "void ForceCombat()" @@ -2061,7 +2061,7 @@ Grenade entities in worldspace. Grenades that are equipped ("cooked") by players !!! cpp-function "void SetAttackMode( bool attack )" - Set to ``false`` to not attack enemies. + Set to `false` to not attack enemies. CNPC_SentryTurret / C_NPC_SentryTurret @@ -2211,7 +2211,7 @@ CNPC_SentryTurret / C_NPC_SentryTurret !!! cpp-function "void Decoy_Dissolve()" - Dissolve this decoy. You might want to clear decoy fx with ``CleanupFXAndSoundsForDecoy( entity decoy )`` afterwards. + Dissolve this decoy. You might want to clear decoy fx with `CleanupFXAndSoundsForDecoy( entity decoy )` afterwards. !!! cpp-function "void SetTimeout( float duration )" @@ -2253,7 +2253,7 @@ CNPC_SentryTurret / C_NPC_SentryTurret Returns the total time of time spent in this cockpit. - Cockpit booting takes 1.3 seconds, so anything less than 1.3 seconds is still playing the booting animation. You can use ``TitanCockpit_IsBooting( entity cockpit )`` to determine this state. + Cockpit booting takes 1.3 seconds, so anything less than 1.3 seconds is still playing the booting animation. You can use `TitanCockpit_IsBooting( entity cockpit )` to determine this state. !!! cpp-function "void SetOpenViewmodelOffset( float x, float y, float z )" diff --git a/docs/Modding/reference/respawn/hud_element_notation.md b/docs/Modding/reference/respawn/hud_element_notation.md index 79cdd791..47438d87 100644 --- a/docs/Modding/reference/respawn/hud_element_notation.md +++ b/docs/Modding/reference/respawn/hud_element_notation.md @@ -23,7 +23,7 @@ An Element is declared in the following way: } ``` -If you're working on a **menu**, you need a ``menu`` object that contains all elements, for example like this: +If you're working on a **menu**, you need a `menu` object that contains all elements, for example like this: ``` @@ -53,9 +53,9 @@ It usually doesn't matter if you use quotation marks to assign string values to ## HUD & Panel files -The first line of a ``.menu`` or ``.res`` file needs to be the resource path to itself, starting from the resource folder. +The first line of a `.menu` or `.res` file needs to be the resource path to itself, starting from the resource folder. -It's not possible to load other files as menus or panels. A ``.menu`` represents an independant menu of the game, while ``.res`` files are "Panels" that can be loaded from other elements. +It's not possible to load other files as menus or panels. A `.menu` represents an independant menu of the game, while `.res` files are "Panels" that can be loaded from other elements. The rest of the file needs to be wrapped in curly brackets. @@ -92,9 +92,9 @@ Capitalization of the properties shouldn't matter. !!! cpp-function "controlSettingsFile" - Load a ``.res`` file. All elements in the settings file are instantiated and set as children of the element. + Load a `.res` file. All elements in the settings file are instantiated and set as children of the element. - ``Hud_GetChild`` only works if the parent element is (has the ``ControlName``) a **CNestedPanel**! + `Hud_GetChild` only works if the parent element is (has the `ControlName`) a **CNestedPanel**! #### Identifying @@ -146,9 +146,9 @@ Capitalization of the properties shouldn't matter. !!! cpp-function "textAlignment" - Controls the element boundary point the element's text gets aligned with. ``east`` -> Left, ``north`` -> Top, ``west`` -> Right, ``south`` Bottom. + Controls the element boundary point the element's text gets aligned with. `east` -> Left, `north` -> Top, `west` -> Right, `south` Bottom. - You can also combine the directions like this: ``north-west``. + You can also combine the directions like this: `north-west`. !!! cpp-function "allcaps" @@ -400,7 +400,7 @@ Capitalization of the properties shouldn't matter. ### Conditional Properties -You can declare properties for specific conditions by adding ``[CONDITION]`` after the property value. +You can declare properties for specific conditions by adding `[CONDITION]` after the property value. When putting a condition after an element's name, the element will only be created if the condition evaluates to true. @@ -440,7 +440,7 @@ Usable conditions are: -On top of that, logical operators like ``!``, ``&&`` and ``||`` are available as well. +On top of that, logical operators like `!`, `&&` and `||` are available as well. #### Example: @@ -547,4 +547,4 @@ You can calculate the position or dimensions etc. with different units. If you p ### Including KeyValues -To include another KeyValue file, use ``#base "filepath"`` at the top of a VDF file. +To include another KeyValue file, use `#base "filepath"` at the top of a VDF file. diff --git a/docs/Modding/reference/respawn/hud_menus.md b/docs/Modding/reference/respawn/hud_menus.md index 96cb7cf4..ce61fd63 100644 --- a/docs/Modding/reference/respawn/hud_menus.md +++ b/docs/Modding/reference/respawn/hud_menus.md @@ -1,10 +1,10 @@ # HUD Menus -Before working on HUD, it's recommended to `extract `_ the ``englishclient_frontend.bsp.pak000_dir.vpk`` vpk. This file contains all vanilla menus and UI logic and will be a very helpful reference! +Before working on HUD, it's recommended to `extract `_ the `englishclient_frontend.bsp.pak000_dir.vpk` vpk. This file contains all vanilla menus and UI logic and will be a very helpful reference! ## Registering a menu -In your ``mod.json``, add a ``Before`` UI callback like this: +In your `mod.json`, add a `Before` UI callback like this: ```json @@ -17,7 +17,7 @@ In your ``mod.json``, add a ``Before`` UI callback like this: } ``` -In the script you referenced, create a global in which you register your menu with the ``AddMenu`` like this: +In the script you referenced, create a global in which you register your menu with the `AddMenu` like this: ```squirrel @@ -29,9 +29,9 @@ In the script you referenced, create a global in which you register your menu wi } ``` -If you want to, you can add a init to ``AddMenu`` like this: ``AddMenu( "MenuName", $"path/to/menu.menu", func )`` +If you want to, you can add a init to `AddMenu` like this: `AddMenu( "MenuName", $"path/to/menu.menu", func )` -The returns ``void`` and takes no parameters. It gets called once the menu is initialized. +The returns `void` and takes no parameters. It gets called once the menu is initialized. It's recommended to create a file struct in which you store menu states: @@ -51,7 +51,7 @@ It's recommended to create a file struct in which you store menu states: ### Menu Functions -Useless functions have been left out. From ``_menus.nut`` +Useless functions have been left out. From `_menus.nut` !!! cpp-function "UICodeCallback_ActivateMenus" @@ -77,7 +77,7 @@ Useless functions have been left out. From ``_menus.nut`` !!! cpp-function "void OpenSubmenu( var menu, bool updateMenuPos = true )" - if ``updateMenuPos`` is not ``null``, the menu is required to have a ``ButtonFrame`` element that is the main content reference. + if `updateMenuPos` is not `null`, the menu is required to have a `ButtonFrame` element that is the main content reference. ### Retrieve Menus @@ -113,29 +113,29 @@ Useless functions have been left out. From ``_menus.nut`` Accepted events: - * ``eUIEvent.MENU_OPEN`` + * `eUIEvent.MENU_OPEN` - * ``eUIEvent.MENU_CLOSE`` + * `eUIEvent.MENU_CLOSE` - * ``eUIEvent.MENU_SHOW`` + * `eUIEvent.MENU_SHOW` - * ``eUIEvent.MENU_HIDE`` + * `eUIEvent.MENU_HIDE` - * ``eUIEvent.MENU_NAVIGATE_BACK`` + * `eUIEvent.MENU_NAVIGATE_BACK` - * ``eUIEvent.MENU_TAB_CHANGED`` + * `eUIEvent.MENU_TAB_CHANGED` - * ``eUIEvent.MENU_ENTITLEMENTS_CHANGED`` + * `eUIEvent.MENU_ENTITLEMENTS_CHANGED` - * ``eUIEvent.MENU_INPUT_MODE_CHANGED`` + * `eUIEvent.MENU_INPUT_MODE_CHANGED` !!! cpp-function "void AddPanelEventHandler( var panel, int event, void functionref() func )" Accepted events: - * ``eUIEvent.PANEL_SHOW`` + * `eUIEvent.PANEL_SHOW` - * ``eUIEvent.PANEL_HIDE`` + * `eUIEvent.PANEL_HIDE` !!! cpp-function "void AddButtonEventHandler( var button, int event, void functionref( var ) func )" @@ -143,7 +143,7 @@ Useless functions have been left out. From ``_menus.nut`` Add an event handler to an element. - If you have a reference to the element, use ``Hud_AddEventHandler`` + If you have a reference to the element, use `Hud_AddEventHandler` !!! cpp-function "void AddEventHandlerToButtonClass( var menu, string classname, int event, void functionref( var ) func )" @@ -155,7 +155,7 @@ Useless functions have been left out. From ``_menus.nut`` !!! cpp-function "bool IsDialog( var menu )" - Returns ``true`` if the menu is a dialog. + Returns `true` if the menu is a dialog. @@ -184,7 +184,7 @@ Not recommended to use. !!! cpp-function "void FocusDefault( var menu )" - Like ``FocusDefaultMenuItem`` but excludes some menus. + Like `FocusDefaultMenuItem` but excludes some menus. ### Footers diff --git a/docs/Modding/reference/respawn/hud_script.md b/docs/Modding/reference/respawn/hud_script.md index 8abef01b..47873814 100644 --- a/docs/Modding/reference/respawn/hud_script.md +++ b/docs/Modding/reference/respawn/hud_script.md @@ -16,11 +16,11 @@ Script methods to manipulate hud elements. !!! cpp-function "bool Hud_HasChild( var elem, string childName )" - Returns ``true`` if the element has a child named like ``childName`` + Returns `true` if the element has a child named like `childName` !!! cpp-function "var Hud_GetChild( var elem, string childName )" - Returns the child element of the passed element named like ``childName`` + Returns the child element of the passed element named like `childName` !!! cpp-function "array GetElementsByClassname( var elem, string className )" @@ -44,7 +44,7 @@ Script methods to manipulate hud elements. !!! cpp-function "var Hud_GetPos( var elem )" - Returns an array of type ``int[2]`` as a ``var``. The position is **relative** to the element's base position. + Returns an array of type `int[2]` as a `var`. The position is **relative** to the element's base position. !!! cpp-function "void Hud_SetX( var elem, int x )" @@ -68,7 +68,7 @@ Script methods to manipulate hud elements. !!! cpp-function "var Hud_GetBasePos( var elem )" - Returns an orray of type ``int[2]`` as a ``var``. Base position is always ``[0,0]`` + Returns an orray of type `int[2]` as a `var`. Base position is always `[0,0]` !!! cpp-function "int Hud_GetBaseX( var elem )" @@ -80,7 +80,7 @@ Script methods to manipulate hud elements. !!! cpp-function "var Hud_GetAbsPos( var elem )" - Returns an array of type ``int[2]`` as a ``var``. Absolute coordinates on the screen of this element. + Returns an array of type `int[2]` as a `var`. Absolute coordinates on the screen of this element. !!! cpp-function "int Hud_GetAbsX( var elem )" @@ -94,19 +94,19 @@ Script methods to manipulate hud elements. Move to relative x over time with interpolation. - * ``INTERPOLATOR_LINEAR``: linear interpolation + * `INTERPOLATOR_LINEAR`: linear interpolation - * ``INTERPOLATOR_ACCEL``: move with accelerating speed + * `INTERPOLATOR_ACCEL`: move with accelerating speed - * ``INTERPOLATOR_DEACCEL``: move with deaccelerating speed + * `INTERPOLATOR_DEACCEL`: move with deaccelerating speed - * ``INTERPOLATOR_PULSE``: one time bounce + * `INTERPOLATOR_PULSE`: one time bounce - * ``INTERPOLATOR_FLICKER``: no transition + * `INTERPOLATOR_FLICKER`: no transition - * ``INTERPOLATOR_SIMPLESPLINE``: ease in / out + * `INTERPOLATOR_SIMPLESPLINE`: ease in / out - * ``INTERPOLATOR_BOUNCE``: gravitational bounce + * `INTERPOLATOR_BOUNCE`: gravitational bounce !!! cpp-function "void Hud_SetYOverTime( var elem, int y, float transitionTime, int interpolation_mode "= 0 ) @@ -134,7 +134,7 @@ Script methods to manipulate hud elements. !!! cpp-function "bool Hud_IsVisible( var elem )" - Returns ``true`` if the element is visible + Returns `true` if the element is visible !!! cpp-function "void Hud_SetVisible( var elem, bool visible )" @@ -198,7 +198,7 @@ Script methods to manipulate hud elements. !!! cpp-function "var Hud_GetSize( var elem )" - Returns an array of type ``int[2]`` as a ``var``. The first index is width and the second height of the element. + Returns an array of type `int[2]` as a `var`. The first index is width and the second height of the element. !!! cpp-function "void Hud_SetSize( var elem, int x, int y )" @@ -206,13 +206,13 @@ Script methods to manipulate hud elements. !!! cpp-function "var Hud_GetBaseSize( var elem )" - Returns the width and height values the element got initialized with as an array of type ``int[2]`` as ``var``. + Returns the width and height values the element got initialized with as an array of type `int[2]` as `var`. !!! cpp-function "void Hud_ScaleOverTime( var elem, float width_factor, float height_factor, float "time, int interpolation_mode ) Set the width and height of the element over time. - The final width and height is calculated like this: ``width * width_factor`` + The final width and height is calculated like this: `width * width_factor` !!! cpp-function "void Hud_SetScaleX( var elem, float xStretch )" @@ -248,7 +248,7 @@ Script methods to manipulate hud elements. !!! cpp-function "bool Hud_IsLocked( var elem )" - Returns ``true`` if the element is locked. + Returns `true` if the element is locked. Locked elements are visible, can be focused and selected but don't trigger events and play a locked sound if they are selected @@ -258,7 +258,7 @@ Script methods to manipulate hud elements. !!! cpp-function "bool Hud_IsEnabled( var elem )" - Returns ``true`` if the element is enabled + Returns `true` if the element is enabled Disabled elements are visible but can't be focused or selected and don't trigger events. @@ -268,7 +268,7 @@ Script methods to manipulate hud elements. !!! cpp-function "bool Hud_IsFocused( var elem )" - Returns ``true`` if this element is focused + Returns `true` if this element is focused Focused elements will be selected when pressing enter @@ -278,7 +278,7 @@ Script methods to manipulate hud elements. !!! cpp-function "bool Hud_IsSelected( var elem )" - Returns ``true`` if this element is selected + Returns `true` if this element is selected !!! cpp-function "void Hud_SetSelected( var elem, bool selected )" @@ -290,13 +290,13 @@ Script methods to manipulate hud elements. !!! cpp-function "bool Hud_IsLabel( var elem )" - Returns ``true`` if the element is a label + Returns `true` if the element is a label ## Element RUI !!! cpp-function "bool Hud_IsRuiPanel( var elem )" - Returns ``true`` if this element can contain ruis + Returns `true` if this element can contain ruis !!! cpp-function "var Hud_GetRui( var elem )" @@ -332,13 +332,13 @@ Script methods to manipulate hud elements. Accepted events: - * ``UIE_CLICK`` + * `UIE_CLICK` - * ``UIE_GET_FOCUS`` + * `UIE_GET_FOCUS` - * ``UIE_LOSE_FOCUS`` + * `UIE_LOSE_FOCUS` - * ``UIE_CHANGE`` + * `UIE_CHANGE` ## Other Visuals diff --git a/docs/Modding/reference/respawn/movers.md b/docs/Modding/reference/respawn/movers.md index 629f00f7..3a02f544 100644 --- a/docs/Modding/reference/respawn/movers.md +++ b/docs/Modding/reference/respawn/movers.md @@ -2,29 +2,29 @@ Movers are entites that move and rotate smoothly. -``script_mover`` allows for smooth movement and rotation contrary to ``script_mover_lightweight`` which is not able to rotate. +`script_mover` allows for smooth movement and rotation contrary to `script_mover_lightweight` which is not able to rotate. ## Create a Mover !!! cpp-function "entity CreateExpensiveScriptMover( vector origin , vector angles )" - returns ``script_mover`` + returns `script_mover` !!! cpp-function "entity CreateExpensiveScriptMoverModel( asset model, vector origin, vector angles, int solidType, float fadeDist )" - returns ``script_mover`` which has a model + returns `script_mover` which has a model !!! cpp-function "entity CreateScriptMover( vector origin, vector angles )" - returns ``script_mover_lightweight`` + returns `script_mover_lightweight` !!! cpp-function "entity CreateScriptMoverModel( asset model, vector origin, vector angles, int solidType, float fadeDist )" - returns ``script_mover_lightweight`` which has a model + returns `script_mover_lightweight` which has a model !!! cpp-function "entity CreateOwnedScriptMover( entity owner )" - returns ``script_mover`` which will be at the location of the owner + returns `script_mover` which will be at the location of the owner ## Moving diff --git a/docs/Modding/reference/respawn/native_server/collision.md b/docs/Modding/reference/respawn/native_server/collision.md index 375e9faa..083996d0 100644 --- a/docs/Modding/reference/respawn/native_server/collision.md +++ b/docs/Modding/reference/respawn/native_server/collision.md @@ -8,9 +8,9 @@ Do muliple LOS checks, early out if any return true. Runs on multiple threads. - ``mask``: ``TRACE_MASK_*`` + `mask`: `TRACE_MASK_*` - ``group``: ``TRACE_COLLISION_GROUP_*`` + `group`: `TRACE_COLLISION_GROUP_*` !!! cpp-function "TraceResults TraceLine( vector startPos, vector endPos, var ignoreEntOrArrayOfEnts = null, int traceMask = 0, int collisionGroup = 0 )" @@ -30,11 +30,11 @@ !!! cpp-function "float TraceLineSimple( vector startPos, vector endPos, entity ignoreEnt )" - Does a trace and returns the distance from ``startPos`` to hit. + Does a trace and returns the distance from `startPos` to hit. !!! cpp-function "float TraceHullSimple( vector startPos, vector endPos, vector hullMins, vector hullMaxs, entity ignoreEnt )" - Does a trace and returns the distance from ``startPos`` to hit. + Does a trace and returns the distance from `startPos` to hit. !!! cpp-function "void DoTraceCoordCheck( bool check )" diff --git a/docs/Modding/reference/respawn/native_server/damageinfo.md b/docs/Modding/reference/respawn/native_server/damageinfo.md index e9cc64ab..1ff34283 100644 --- a/docs/Modding/reference/respawn/native_server/damageinfo.md +++ b/docs/Modding/reference/respawn/native_server/damageinfo.md @@ -47,16 +47,16 @@ Because damageInfo instances are implemented as userdata they can't be typed. !!! cpp-function "int DamageInfo_GetDamageSourceIdentifier( var damageInfo )" - Returns the ``eDamageSourceId`` + Returns the `eDamageSourceId` - ``damageSourceId`` is an ``int`` that references an ``enum`` and can be used to identify what source damage came from. + `damageSourceId` is an `int` that references an `enum` and can be used to identify what source damage came from. - ``damageSourceId`` is mostly found as an argument in some kill and damage related functions. Respawn has created a function that will attempt to localise the damageSourceId inputed. - To add your own custom ``damageSourceID`` , see: :doc:`../../northstar/customdamagesources` + `damageSourceId` is mostly found as an argument in some kill and damage related functions. Respawn has created a function that will attempt to localise the damageSourceId inputed. + To add your own custom `damageSourceID` , see: :doc:`../../northstar/customdamagesources` - Other useful functions can be found in the ``damageinfo`` section of this page and in :doc:`entities` + Other useful functions can be found in the `damageinfo` section of this page and in :doc:`entities` - ``GetObitFromdamageSourceId`` is a global function that attempts to localise the ``damageSourceId`` inputed, if it cannot get a localised string it will simply return the localisation string of the source. + `GetObitFromdamageSourceId` is a global function that attempts to localise the `damageSourceId` inputed, if it cannot get a localised string it will simply return the localisation string of the source. !!! cpp-function "float DamageInfo_GetViewPunchMultiplier( vare damageInfo )" diff --git a/docs/Modding/reference/respawn/native_server/debugdraw.md b/docs/Modding/reference/respawn/native_server/debugdraw.md index 861a2878..5aaefcc4 100644 --- a/docs/Modding/reference/respawn/native_server/debugdraw.md +++ b/docs/Modding/reference/respawn/native_server/debugdraw.md @@ -6,7 +6,7 @@ The rest are defined in scripts using these. -In Titanfall it is possible to draw shapes in 3D, from the SERVER and CLIENT VM, using the debug draw functions, however in order for them to actually render you will need to set ``sv_cheats 1`` and ``enable_debug_overlays 1`` in your launch config or console. +In Titanfall it is possible to draw shapes in 3D, from the SERVER and CLIENT VM, using the debug draw functions, however in order for them to actually render you will need to set `sv_cheats 1` and `enable_debug_overlays 1` in your launch config or console. These debug drawing functions are available: diff --git a/docs/Modding/reference/respawn/native_server/dev.md b/docs/Modding/reference/respawn/native_server/dev.md index 6189f82a..27661450 100644 --- a/docs/Modding/reference/respawn/native_server/dev.md +++ b/docs/Modding/reference/respawn/native_server/dev.md @@ -18,7 +18,7 @@ !!! cpp-function "array GetModelViewerList()" - Returns list of files in ``scripts/model_view_list.txt``, which is written by reRun (respawn internal tool) + Returns list of files in `scripts/model_view_list.txt`, which is written by reRun (respawn internal tool) !!! cpp-function "void NativeFuncTest( number a, bool b, number c )" diff --git a/docs/Modding/reference/respawn/native_server/getent.md b/docs/Modding/reference/respawn/native_server/getent.md index ab5ebc9c..ff646637 100644 --- a/docs/Modding/reference/respawn/native_server/getent.md +++ b/docs/Modding/reference/respawn/native_server/getent.md @@ -12,7 +12,7 @@ Creating entities is documented [here](createent.md). !!! cpp-function "array GetPlayerArrayEx( string classname, int onSameTeamAsNum, int enemiesOfTeamNum, vector origin, float maxdist )" - Get array of all players by class, team within dist. team -1 for any team, ``"any"`` for any class, otherwise ``"titan"`` or ``"pilot"``, -1 for any dist + Get array of all players by class, team within dist. team -1 for any team, `"any"` for any class, otherwise `"titan"` or `"pilot"`, -1 for any dist !!! cpp-function "array GetPlayerArrayOfTeam( int team )" @@ -86,11 +86,11 @@ Get all players in a titan and souls. !!! cpp-function "array GetNPCArrayEx( string classname, int onSameTeamAsNum, int enemiesOfTeamNum, vector origin, float maxdist )" - Get array of all NPCs by class, team, within dist. team -1 for any team, ``"any"`` for any class, otherwise ``"titan"`` or ``"pilot"``, -1 for any dist + Get array of all NPCs by class, team, within dist. team -1 for any team, `"any"` for any class, otherwise `"titan"` or `"pilot"`, -1 for any dist !!! cpp-function "GetNPCArrayWithSubclassEx( string classname, int onSameTeamAsNum, int enemiesOfTeamNum, vector origin, float maxdist, array subclasses )" - Get array of all NPCs by class, team, and subclass (array), within dist. team -1 for any team, ``"'any"`` for any class, -1 for any dist + Get array of all NPCs by class, team, and subclass (array), within dist. team -1 for any team, `"'any"` for any class, -1 for any dist !!! cpp-function "array GetNPCArrayByClass( string classname )" @@ -106,7 +106,7 @@ Get all players in a titan and souls. !!! cpp-function "array GetProjectileArrayEx( string classname, int onSameTeamAsNum, int enemiesOfTeamNum, vector origin, float maxdist )" - Get array of all NPCs by class, team, within dist. team -1 for any team, ``"any"`` for any class, otherwise ``"titan"`` or ``"pilot"``, -1 for any dist + Get array of all NPCs by class, team, within dist. team -1 for any team, `"any"` for any class, otherwise `"titan"` or `"pilot"`, -1 for any dist ## Find Entities diff --git a/docs/Modding/reference/respawn/native_server/misc.md b/docs/Modding/reference/respawn/native_server/misc.md index da1d9615..a5ab903f 100644 --- a/docs/Modding/reference/respawn/native_server/misc.md +++ b/docs/Modding/reference/respawn/native_server/misc.md @@ -14,7 +14,7 @@ !!! cpp-function "bool IsEnemyTeam( int ownTeam, int otherTeam )" - Returns if ``otherTeam`` is an enemy of ``ownTeam`` + Returns if `otherTeam` is an enemy of `ownTeam` !!! cpp-function "void SetMaxActivityMode( int mode )" @@ -28,7 +28,7 @@ !!! cpp-function "void SendToConsole( string cmd )" - Execute ``cmd`` on the local host + Execute `cmd` on the local host !!! cpp-function "void RecordAchievementEvent( string s1, number n1 )" @@ -94,7 +94,7 @@ Fade the player's scren. - Fade flags start with ``FFADE_`` + Fade flags start with `FFADE_` ## Levels diff --git a/docs/Modding/reference/respawn/native_server/netvar.md b/docs/Modding/reference/respawn/native_server/netvar.md index 7648adb1..a4eb9716 100644 --- a/docs/Modding/reference/respawn/native_server/netvar.md +++ b/docs/Modding/reference/respawn/native_server/netvar.md @@ -8,7 +8,7 @@ !!! cpp-function "int GetNetworkedVariableIndex( string name )" - Gets the internal index used to reference a scripted network variable. For use with ``FX_PATTACH_SCRIPT_NETWORK_VAR``. + Gets the internal index used to reference a scripted network variable. For use with `FX_PATTACH_SCRIPT_NETWORK_VAR`. !!! cpp-function "void SetGlobalNetBool( string name, bool value )" @@ -34,7 +34,7 @@ ## Remote Functions -Remote functions allow the ``SERVER`` to call registered script functions on the ``CLIENT`` and ``UI`` VM. +Remote functions allow the `SERVER` to call registered script functions on the `CLIENT` and `UI` VM. !!! cpp-function "void Remote_BeginRegisteringFunctions()" diff --git a/docs/Modding/reference/respawn/native_server/npc.md b/docs/Modding/reference/respawn/native_server/npc.md index 7ddaac63..acebe999 100644 --- a/docs/Modding/reference/respawn/native_server/npc.md +++ b/docs/Modding/reference/respawn/native_server/npc.md @@ -12,7 +12,7 @@ For settings, see [AI Settings](settings.md#ai-settings) !!! cpp-function "void ToggleNPCPathsForEntity( entity ent, bool pathable )" - Controls if ``ent`` is traversable by NPCs + Controls if `ent` is traversable by NPCs !!! cpp-function "void ToggleNPCPathsForEntityAtPosition( entity ent, vector pos, bool pathable )" @@ -93,11 +93,11 @@ For settings, see [AI Settings](settings.md#ai-settings) !!! cpp-function "array NavMesh_RandomPositions( vector startPos, int hull, int numPositionsRequested, float minDist, float maxDist )" - Get n( < 64 ) ground positions around a spot within ``minDist`` and ``maxDist`` + Get n( < 64 ) ground positions around a spot within `minDist` and `maxDist` !!! cpp-function "array NavMesh_RandomPositions_LargeArea( vector startPos, int hull, int numPositionsRequested, float minDist, float maxDist )" - Get up to n ground positions around a spot within ``minDist`` and ``maxDist``. Gets center of random polygons. + Get up to n ground positions around a spot within `minDist` and `maxDist`. Gets center of random polygons. !!! cpp-function "bool NavMesh_IsPosReachableForAI( entity npc, vector point )" diff --git a/docs/Modding/reference/respawn/native_server/playermelee.md b/docs/Modding/reference/respawn/native_server/playermelee.md index 8a0080ad..80f3b5d5 100644 --- a/docs/Modding/reference/respawn/native_server/playermelee.md +++ b/docs/Modding/reference/respawn/native_server/playermelee.md @@ -11,7 +11,7 @@ !!! cpp-function "table PlayerMelee_AttackTrace( entity player, float range, bool functionref( entity attacker, entity target ) isValidTargetFunc )" Do a trace for potential melee targets in front of player. - Returns a table with keys ``entity`` and ``position``, which is the hit entity and position + Returns a table with keys `entity` and `position`, which is the hit entity and position !!! cpp-function "bool PlayerMelee_IsExecutionReachable( entity attacker, entity target, number dist )" diff --git a/docs/Modding/reference/respawn/native_server/sp.md b/docs/Modding/reference/respawn/native_server/sp.md index 69bbd7cc..fd787de1 100644 --- a/docs/Modding/reference/respawn/native_server/sp.md +++ b/docs/Modding/reference/respawn/native_server/sp.md @@ -10,7 +10,7 @@ Do a save. - Will call back ``bool CodeCallback_SaveGameIsSafeToCommit()`` to validate if it is ok to commit the save file. + Will call back `bool CodeCallback_SaveGameIsSafeToCommit()` to validate if it is ok to commit the save file. !!! cpp-function "void SaveGame_Commit()" @@ -44,12 +44,12 @@ !!! cpp-function "void ChangeLevel( string mapName, LevelTransitionStruct transitionStruct )" - Loads a new level. The data in ``transitionStruct`` can be read in the next level with ``GetLevelTransitionStruct()``. + Loads a new level. The data in `transitionStruct` can be read in the next level with `GetLevelTransitionStruct()`. !!! cpp-function "LevelTransitionStruct ornull GetLevelTransitionStruct()" - Reads the transition data set by ``ChangeLevel()`` on the previous map. - Return ``null`` if this is the first map or the previous map didn't supply any data. + Reads the transition data set by `ChangeLevel()` on the previous map. + Return `null` if this is the first map or the previous map didn't supply any data. ## Timeshift diff --git a/docs/Modding/reference/respawn/topology.md b/docs/Modding/reference/respawn/topology.md index fcb7369a..29e6f743 100644 --- a/docs/Modding/reference/respawn/topology.md +++ b/docs/Modding/reference/respawn/topology.md @@ -22,11 +22,11 @@ Since the number of topologies that can be created is very limited and Vanilla u This creates a simple topology at the specified origin relative to the parent position. - The parameters ``right`` and ``down`` specify the dimensions of the topology relative to the origin. For example, passing ```` and ``<0,GetScreenSize()[1],0>`` will create a topology that covers the entire screen. Note that in this example the origin is the top left corner. The unit used is pixels. + The parameters `right` and `down` specify the dimensions of the topology relative to the origin. For example, passing `` and `<0,GetScreenSize()[1],0>` will create a topology that covers the entire screen. Note that in this example the origin is the top left corner. The unit used is pixels. !!! cpp-function "void RuiTopology_CreateSphere( vector origin, vector angles, vector right, vector down, COCKPIT_RUI_RADIUS, COCKPIT_RUI_WIDTH, COCKPIT_RUI_HEIGHT, float subDiv )" - Similar to ``RuiTopology_CreatePlane`` but creates an arched sphere instead of a plane. Unlike in ``RuiTopology_CreatePlane``, **right and down are angles and not relative positions**. The width and height are instead controlled by their respective parameters. + Similar to `RuiTopology_CreatePlane` but creates an arched sphere instead of a plane. Unlike in `RuiTopology_CreatePlane`, **right and down are angles and not relative positions**. The width and height are instead controlled by their respective parameters. !!! cpp-function "void RuiTopology_Destroy( var topology )" @@ -36,7 +36,7 @@ Since the number of topologies that can be created is very limited and Vanilla u Parents the given topology to the anchor entity. The topology moves and rotates relative to the parent. - Set the position of the topology to ``<0,0,0>`` to render at the parent's position. + Set the position of the topology to `<0,0,0>` to render at the parent's position. !!! cpp-function "void RuiTopology_UpdatePos( topo, updateOrg, right, down )" @@ -49,10 +49,10 @@ Since the number of topologies that can be created is very limited and Vanilla u Drawcalls determine how and where RUIs on a topology are being rendered. -* ``RUI_DRAW_NONE``: Don't render rui at all -* ``RUI_DRAW_HUD``: Render rui on screen. Uses screen coordinates in pixels. -* ``RUI_DRAW_WORLD``: Render rui in worldspace on a two dimensional surface facing the direction of the topology. -* ``RUI_DRAW_COCKPIT``: Similiar to ``RUI_DRAW_HUD`` but follows the cockpit headbob movement. +* `RUI_DRAW_NONE`: Don't render rui at all +* `RUI_DRAW_HUD`: Render rui on screen. Uses screen coordinates in pixels. +* `RUI_DRAW_WORLD`: Render rui in worldspace on a two dimensional surface facing the direction of the topology. +* `RUI_DRAW_COCKPIT`: Similiar to `RUI_DRAW_HUD` but follows the cockpit headbob movement. **Drawcalls are not set for a topology but for each rui individually** diff --git a/docs/Modding/repak/assets/datatable.md b/docs/Modding/repak/assets/datatable.md index bcfd4c06..d83d8fd0 100644 --- a/docs/Modding/repak/assets/datatable.md +++ b/docs/Modding/repak/assets/datatable.md @@ -12,7 +12,7 @@ } ``` -### 2. Example Datatable ``.csv`` File +### 2. Example Datatable `.csv` File |`setFile`|`titanRef`|`difficulty`|`isPrime`|`coreBuildingIcon`| @@ -25,34 +25,34 @@ ## Asset Structure: -### ``$type`` +### `$type` -For an asset to be a datatable asset, the ``$type`` field must be ``"dtbl"``. +For an asset to be a datatable asset, the `$type` field must be `"dtbl"`. -### ``path`` +### `path` -The ``path`` field of a datatable asset is used to determine the location in the RPak's ``assetsDir`` that the ``.csv`` file is in. +The `path` field of a datatable asset is used to determine the location in the RPak's `assetsDir` that the `.csv` file is in. !!! warning If the .csv file has no columns, RePak will output the following warning to the console, before skipping the asset. - ``Attempted to add dtbl asset with no columns. Skipping asset...`` + `Attempted to add dtbl asset with no columns. Skipping asset...` !!! warning If the .csv file has fewer than 2 rows, RePak will output the following warning to the console, before skipping the asset. - ``Attempted to add dtbl asset with invalid row count. Skipping asset... - DTBL - CSV must have a row of column types at the end of the table`` + `Attempted to add dtbl asset with invalid row count. Skipping asset... + DTBL - CSV must have a row of column types at the end of the table` ## File Structure: -The file must be a valid ``.csv`` file, with at least 2 rows, and at least 1 column. +The file must be a valid `.csv` file, with at least 2 rows, and at least 1 column. -The final row of the ``.csv`` determines the type of each column, and each entry must be one of the following values: +The final row of the `.csv` determines the type of each column, and each entry must be one of the following values: -* ``bool`` - either ``0`` (false) or ``1`` (true) -* ``int`` - any integer value -* ``float`` - any float value -* ``vector`` - three float values in the format ```` -* ``string`` - any string value -* ``asset`` - any string value (must be a valid asset) -* ``assetnoprecache`` - any string value (must be a valid asset) \ No newline at end of file +* `bool` - either `0` (false) or `1` (true) +* `int` - any integer value +* `float` - any float value +* `vector` - three float values in the format `` +* `string` - any string value +* `asset` - any string value (must be a valid asset) +* `assetnoprecache` - any string value (must be a valid asset) \ No newline at end of file diff --git a/docs/Modding/repak/assets/texture.md b/docs/Modding/repak/assets/texture.md index df56c10a..dfc1de41 100644 --- a/docs/Modding/repak/assets/texture.md +++ b/docs/Modding/repak/assets/texture.md @@ -38,12 +38,12 @@ following compression types: !!! note - The image file in this texture asset will be called ``test_texture.dds`` and will be - at ``/textures/models/humans/test_texture.dds`` + The image file in this texture asset will be called `test_texture.dds` and will be + at `/textures/models/humans/test_texture.dds` !!! note - Because ``disableStreaming`` is ``true``, this texture will not be stored in a + Because `disableStreaming` is `true`, this texture will not be stored in a .starpak file, and all mip levels will be stored in the .rpak file ### 2. Streamed Texture Asset @@ -59,88 +59,88 @@ following compression types: !!! note - The image file in this texture asset will be called ``test_texture_2.dds`` and will - be at ``/textures/models/humans/test_texture_2.dds`` + The image file in this texture asset will be called `test_texture_2.dds` and will + be at `/textures/models/humans/test_texture_2.dds` !!! note - Because ``disableStreaming`` is not present, this texture will have it's higher - resolution mip levels stored in ``test_texture_2.starpak``, as defined by the - ``starpakPath``. It will not use the default ``starpakPath`` if one is defined - outside of the ``files`` array + Because `disableStreaming` is not present, this texture will have it's higher + resolution mip levels stored in `test_texture_2.starpak`, as defined by the + `starpakPath`. It will not use the default `starpakPath` if one is defined + outside of the `files` array ## Asset Structure: -### ``$type`` +### `$type` -For an asset to be a texture asset, the ``$type`` field must be ``"txtr"``. +For an asset to be a texture asset, the `$type` field must be `"txtr"`. -### ``path`` +### `path` -The ``path`` field of a texture asset is used to determine the location in the RPak's -``assetsDir`` that the image file is in. +The `path` field of a texture asset is used to determine the location in the RPak's +`assetsDir` that the image file is in. It is also used as the asset's unique identifier, allowing other assets to reference and use it. -The ``path`` field must start with ``textures/`` and must not end with a file extension. +The `path` field must start with `textures/` and must not end with a file extension. !!! error - If RePak is unable to locate a file at the given ``path``, it will output the + If RePak is unable to locate a file at the given `path`, it will output the following error to the console: - ``Failed to find texture source file %s. Exiting...`` where ``%s`` is the ``path`` + `Failed to find texture source file %s. Exiting...` where `%s` is the `path` field of the texture. !!! error - If the file at the given ``path`` is not a .dds file, RePak will output the + If the file at the given `path` is not a .dds file, RePak will output the following error to the console: - ``Attempted to add txtr asset '%s' that was not a valid DDS file (invalid magic).`` - where ``%s`` is the ``path`` field of the texture. + `Attempted to add txtr asset '%s' that was not a valid DDS file (invalid magic).` + where `%s` is the `path` field of the texture. !!! error If an unsupported .dds compression type is used, RePak will output the following error to the console: - ``Attempted to add txtr asset '%s' that was not using a supported DDS type. - Exiting...`` where ``%s`` is the ``path`` field of the texture. + `Attempted to add txtr asset '%s' that was not using a supported DDS type. + Exiting...` where `%s` is the `path` field of the texture. -### ``starpakPath`` +### `starpakPath` -The ``starpakPath`` field of a texture asset determines the path of the starpak in which +The `starpakPath` field of a texture asset determines the path of the starpak in which the higher resolution mip levels should be stored. -If no ``starpakPath`` value is specified, RePak will default to using the default -``starpakPath``, defined at file scope in the map file. +If no `starpakPath` value is specified, RePak will default to using the default +`starpakPath`, defined at file scope in the map file. -The ``starpakPath`` field should be a string, and importantly, should end in -``.starpak``. +The `starpakPath` field should be a string, and importantly, should end in +`.starpak`. !!! note - If the starpak name ends in ``_hotswap.starpak`` (e.g. ``my_thing_hotswap.starpak``) + If the starpak name ends in `_hotswap.starpak` (e.g. `my_thing_hotswap.starpak`) then Titanfall 2 will view it as optional. This allows the starpak to be moved, removed, or replaced while the game is running and streaming the texture. This can be useful for debugging. !!! error - If the ``starpakPath`` is not present, and no ``starpakPath`` is defined at file + If the `starpakPath` is not present, and no `starpakPath` is defined at file scope, RePak will output the following error to the console. - ``attempted to add asset '%s' as a streaming asset, but no starpak files were + `attempted to add asset '%s' as a streaming asset, but no starpak files were available. to fix: add 'starpakPath' as an rpak-wide variable or: add 'starpakPath' - as an asset specific variable`` where %s is the ``path`` of the texture asset + as an asset specific variable` where %s is the `path` of the texture asset -### ``disableStreaming`` +### `disableStreaming` -The ``disableStreaming`` field of a texture asset determines if the texture should use a +The `disableStreaming` field of a texture asset determines if the texture should use a starpak to store the higher resolution mip levels. -It should be a boolean value, with ``true`` disabling the use of a starpak, +It should be a boolean value, with `true` disabling the use of a starpak, -``disableStreaming`` defaults to ``false`` if it is not present. +`disableStreaming` defaults to `false` if it is not present. diff --git a/docs/Modding/repak/assets/uiatlas.md b/docs/Modding/repak/assets/uiatlas.md index c46d7dd4..fba1db1d 100644 --- a/docs/Modding/repak/assets/uiatlas.md +++ b/docs/Modding/repak/assets/uiatlas.md @@ -1,8 +1,8 @@ # UI Image Atlases -UI Image Atlases (``uimg``) are what the game uses to store multiple UI assets, they -reference a single texture asset, known as the ``atlas`` and have an array of -``textures`` which defines the different usable UI assets. +UI Image Atlases (`uimg`) are what the game uses to store multiple UI assets, they +reference a single texture asset, known as the `atlas` and have an array of +`textures` which defines the different usable UI assets. ## Examples: @@ -36,7 +36,7 @@ reference a single texture asset, known as the ``atlas`` and have an array of !!! note - This UI Image Atlas expects a texture with the path of ``rui/example1`` which is at + This UI Image Atlas expects a texture with the path of `rui/example1` which is at least 256x128 ### 2. Full Map File With a UI Image Atlas @@ -99,108 +99,108 @@ reference a single texture asset, known as the ``atlas`` and have an array of ## Asset Structure: -### ``$type`` +### `$type` -For an asset to be a UI Image Atlas asset, the ``$type`` field must be ``"uimg"``. +For an asset to be a UI Image Atlas asset, the `$type` field must be `"uimg"`. -### ``path`` +### `path` -The ``path`` field for a UI Image Atlas asset is mostly unused, and as such can be set +The `path` field for a UI Image Atlas asset is mostly unused, and as such can be set to almost any value. It is used when logging information about the asset. -### ``atlas`` +### `atlas` -The ``atlas`` field for a UI Image Atlas asset determines which texture asset it will +The `atlas` field for a UI Image Atlas asset determines which texture asset it will use. !!! error - If the uimg asset doesn't contain a valid ``atlas`` field, RePak will output one of + If the uimg asset doesn't contain a valid `atlas` field, RePak will output one of the following errors to the console: - ``Required field 'atlas' not found for uimg asset '%s'. Exiting...`` + `Required field 'atlas' not found for uimg asset '%s'. Exiting...` - ``'atlas' field is not of required type 'string' for uimg asset '%s'. Exiting...`` + `'atlas' field is not of required type 'string' for uimg asset '%s'. Exiting...` - where ``%s`` is the ``path`` field of the UI Image Atlas + where `%s` is the `path` field of the UI Image Atlas !!! error If the texture asset cannot be found, RePak will output the following message to the console before exiting: - ``Atlas asset was not found when trying to add uimg asset '%s'. Make sure that the - txtr is above the uimg in your map file. Exiting..."`` + `Atlas asset was not found when trying to add uimg asset '%s'. Make sure that the + txtr is above the uimg in your map file. Exiting..."` - where ``%s`` is the ``path`` field of the UI Image Atlas + where `%s` is the `path` field of the UI Image Atlas -### ``textures`` +### `textures` -The ``textures`` array in a UI Image Atlas asset defines the different UI textures that +The `textures` array in a UI Image Atlas asset defines the different UI textures that the atlas contains. Any number of UI textures may be contained within one UI Image Atlas. -#### ``path`` +#### `path` -An entry in the ``textures`` array must have a ``path`` field, as the game must use it +An entry in the `textures` array must have a `path` field, as the game must use it to identify and show the texture. !!! error - If the entry in the ``textures`` array doesn't contain a valid ``path`` field, RePak + If the entry in the `textures` array doesn't contain a valid `path` field, RePak will output one of the following errors to the console: - ``Required field 'path' not found for a texture in uimg asset '%s'. Exiting...`` + `Required field 'path' not found for a texture in uimg asset '%s'. Exiting...` - ``'path' field is not of required type 'string' for a texture in uimg asset '%s'. - Exiting...`` + `'path' field is not of required type 'string' for a texture in uimg asset '%s'. + Exiting...` - where ``%s`` is the ``path`` field of the UI Image Atlas + where `%s` is the `path` field of the UI Image Atlas -#### ``width`` and ``height`` +#### `width` and `height` -An entry in the ``textures`` array must have both a ``width`` and a ``height`` field, +An entry in the `textures` array must have both a `width` and a `height` field, these values should both be integers. !!! error - If the entry in the ``textures`` array doesn't contain a valid ``width`` or a valid - ``height`` field, RePak will output one of the following errors to the console: + If the entry in the `textures` array doesn't contain a valid `width` or a valid + `height` field, RePak will output one of the following errors to the console: - ``Required field 'width' not found for texture '%s' in uimg asset '%s'. Exiting...`` + `Required field 'width' not found for texture '%s' in uimg asset '%s'. Exiting...` - ``Required field 'height' not found for texture '%s' in uimg asset '%s'. - Exiting...`` + `Required field 'height' not found for texture '%s' in uimg asset '%s'. + Exiting...` - ``'width' field is not of required type 'number' for texture '%s' in uimg asset - '%s'. Exiting...`` + `'width' field is not of required type 'number' for texture '%s' in uimg asset + '%s'. Exiting...` - ``'height' field is not of required type 'number' for texture '%s' in uimg asset - '%s'. Exiting...`` + `'height' field is not of required type 'number' for texture '%s' in uimg asset + '%s'. Exiting...` - where the first ``%s`` is the ``path`` field of the texture, and the second ``%s`` - is the ``path`` field of the UI Image Atlas + where the first `%s` is the `path` field of the texture, and the second `%s` + is the `path` field of the UI Image Atlas -#### ``posX`` and ``posY`` +#### `posX` and `posY` -An entry in the ``textures`` array must have both a ``posX`` and a ``posY`` field, these +An entry in the `textures` array must have both a `posX` and a `posY` field, these values should both be integers. These fields determine the location of the top-left pixel in the UI texture. !!! error - If the entry in the ``textures`` array doesn't contain a valid ``posX`` or a valid - ``posY`` field, RePak will output one of the following errors to the console: + If the entry in the `textures` array doesn't contain a valid `posX` or a valid + `posY` field, RePak will output one of the following errors to the console: - ``Required field 'posX' not found for texture '%s' in uimg asset '%s'. Exiting...`` + `Required field 'posX' not found for texture '%s' in uimg asset '%s'. Exiting...` - ``Required field 'posY' not found for texture '%s' in uimg asset '%s'. Exiting...`` + `Required field 'posY' not found for texture '%s' in uimg asset '%s'. Exiting...` - ``'posX' field is not of required type 'number' for texture '%s' in uimg asset '%s'. - Exiting...`` + `'posX' field is not of required type 'number' for texture '%s' in uimg asset '%s'. + Exiting...` - ``'posY' field is not of required type 'number' for texture '%s' in uimg asset '%s'. - Exiting...`` + `'posY' field is not of required type 'number' for texture '%s' in uimg asset '%s'. + Exiting...` - where the first ``%s`` is the ``path`` field of the texture, and the second ``%s`` - is the ``path`` field of the UI Image Atlas + where the first `%s` is the `path` field of the texture, and the second `%s` + is the `path` field of the UI Image Atlas diff --git a/docs/Modding/repak/map.md b/docs/Modding/repak/map.md index 3b91f6de..78ddf7ba 100644 --- a/docs/Modding/repak/map.md +++ b/docs/Modding/repak/map.md @@ -4,7 +4,7 @@ ### 1. Bare Minimum - No Assets -``example1.json`` +`example1.json` ```json @@ -25,14 +25,14 @@ !!! note This example map file is honestly pretty useless. It has no assets, because there is - no ``files`` field. + no `files` field. - It also will have the name ``new.rpak`` and will be created in the ``./build`` + It also will have the name `new.rpak` and will be created in the `./build` folder. ### 2. Single Texture + Single Starpak -``example2.json`` +`example2.json` ```json @@ -68,20 +68,20 @@ ``` !!! note - This example map file creates an RPak named ``example2.rpak`` which contains 1 + This example map file creates an RPak named `example2.rpak` which contains 1 texture asset. This texture will have it's higher resolution mip levels stored in example2.starpak !!! note The texture will replace any vanilla textures that have the same path. ( - ``textures/models/my_texture`` ) + `textures/models/my_texture` ) This is useful for creating basic skins and camos. ### 3. Multiple Textures + Multiple Starpaks -``example3.json`` +`example3.json` ```json @@ -130,16 +130,16 @@ !!! note - This example map file creates an RPak named ``example3.rpak`` which contains 3 + This example map file creates an RPak named `example3.rpak` which contains 3 texture assets. These textures each have their higher resolution mip levels stored in starpaks. - ``my_texture_col`` and ``mp_texture_nml`` use ``example3.starpak``, as they do not - specify their own ``starpakPath``. This makes them use the default ``starpakPath`` + `my_texture_col` and `mp_texture_nml` use `example3.starpak`, as they do not + specify their own `starpakPath`. This makes them use the default `starpakPath` that is defined at the file scope, instead of in the individual textures. - ``my_texture_spc`` uses ``example3-spc.starpak``, as it specifies it's own - ``starpakPath``. + `my_texture_spc` uses `example3-spc.starpak`, as it specifies it's own + `starpakPath`. !!! note @@ -149,97 +149,97 @@ ## Structure: -### ``name`` +### `name` -The ``name`` field of a map file determines the name of the resulting RPak. +The `name` field of a map file determines the name of the resulting RPak. -The ``name`` is appended with ``.rpak`` and defaults to ``new`` if no ``name`` is -provided. This results in a default RPak called ``new.rpak``. +The `name` is appended with `.rpak` and defaults to `new` if no `name` is +provided. This results in a default RPak called `new.rpak`. !!! warning - In the event that no ``name`` is provided in the map file, RePak will output the + In the event that no `name` is provided in the map file, RePak will output the following warning to the console: - ``Map file should have a 'name' field containing the string name for the new rpak, - but none was provided. Defaulting to 'new.rpak' and continuing...\n`` + `Map file should have a 'name' field containing the string name for the new rpak, + but none was provided. Defaulting to 'new.rpak' and continuing...\n` ### `assetsDir` -The ``assetsDir`` field of a map file determines the root path which the program -combines with the ``path`` for assets in order to find the correct file. This path may +The `assetsDir` field of a map file determines the root path which the program +combines with the `path` for assets in order to find the correct file. This path may be a relative path, or an absolute path. -The ``assetsDir`` provided in the map file is appended with a slash ( ``\`` ) if +The `assetsDir` provided in the map file is appended with a slash ( `\` ) if necessary !!! warning - If no ``assetsDir`` is provided, it defaults to the working directory ( ``.\`` ) as + If no `assetsDir` is provided, it defaults to the working directory ( `.\` ) as well as outputting the following warning to the console: - ``No assetsDir field provided. Assuming that everything is relative to the working - directory.\n`` + `No assetsDir field provided. Assuming that everything is relative to the working + directory.\n` ### `outputDir` -The ``outputDir`` field of a map file determines the folder that the program will write +The `outputDir` field of a map file determines the folder that the program will write the RPak and StaRPak files to once they have been created. This path may be a relative path, or an absolute path. -The ``outputDir`` provided in the map file is appended with a slash ( ``\`` ) if +The `outputDir` provided in the map file is appended with a slash ( `\` ) if necessary -If no ``outputDir`` is provided in the map file, RePak defaults to ``.\build\`` +If no `outputDir` is provided in the map file, RePak defaults to `.\build\` -### ``version`` +### `version` -The ``version`` field of a map file determines the RPak version that RePak will create. +The `version` field of a map file determines the RPak version that RePak will create. !!! error - If no ``version`` field is provided, RePak will output the following error and the + If no `version` field is provided, RePak will output the following error and the program will stop: - ``Map file doesn't specify an RPak version\nUse 'version: 7' for Titanfall 2 or - 'version: 8' for Apex\n`` + `Map file doesn't specify an RPak version\nUse 'version: 7' for Titanfall 2 or + 'version: 8' for Apex\n` !!! error - If an invalid ``version`` field is provided, RePak will output the following error + If an invalid `version` field is provided, RePak will output the following error and the program will stop: - ``Invalid RPak version specified\nUse 'version: 7' for Titanfall 2 or 'version: 8' - for Apex\n`` + `Invalid RPak version specified\nUse 'version: 7' for Titanfall 2 or 'version: 8' + for Apex\n` -#### List of known ``version`` values: +#### List of known `version` values: -- ``6``: Titanfall 2: Tech Test **[UNSUPPORTED]** -- ``7``: Titanfall 2 -- ``8``: Apex Legends +- `6`: Titanfall 2: Tech Test **[UNSUPPORTED]** +- `7`: Titanfall 2 +- `8`: Apex Legends -### ``starpakPath`` +### `starpakPath` -The ``starpakPath`` field of a map file determines the default starpak path for textures +The `starpakPath` field of a map file determines the default starpak path for textures (and other streamed assets) to use. !!! note - If the starpak name ends in ``_hotswap.starpak`` (e.g. ``my_thing_hotswap.starpak``) + If the starpak name ends in `_hotswap.starpak` (e.g. `my_thing_hotswap.starpak`) then Titanfall 2 will view it as optional. This allows the starpak to be moved, removed, or replaced while the game is running and streaming the texture. This can be useful for debugging. !!! note - RePak will not throw any errors if no ``starpakPath`` field is specified, however - the individual textures may throw errors if they do not have a ``starpakPath`` + RePak will not throw any errors if no `starpakPath` field is specified, however + the individual textures may throw errors if they do not have a `starpakPath` specified -### ``files`` +### `files` -The ``files`` field of a map file is an array of JSON objects, each one representing an +The `files` field of a map file is an array of JSON objects, each one representing an RPak asset. -RePak will not throw any errors if no ``files`` field is specified, however the +RePak will not throw any errors if no `files` field is specified, however the resulting RPak will contain no assets, rendering it useless. diff --git a/docs/Modding/squirrel/async.md b/docs/Modding/squirrel/async.md index f14a9fd6..1355aaf3 100644 --- a/docs/Modding/squirrel/async.md +++ b/docs/Modding/squirrel/async.md @@ -4,17 +4,17 @@ Squirrel allows scripts to spin off function calls in a thread. All subsequential function calls will be threaded as well. -In threaded functions, it's possible to halt a threaded function with ``wait`` statements, signals, flags and by suspending a thread object. +In threaded functions, it's possible to halt a threaded function with `wait` statements, signals, flags and by suspending a thread object. -You can use the ``IsNewThread()`` function to determine if the current function is threaded off. +You can use the `IsNewThread()` function to determine if the current function is threaded off. For more information, check out the [squirrel documentation on threads](http://www.squirrel-lang.org/squirreldoc/reference/language/threads.html) and [sq functions of threads](http://www.squirrel-lang.org/squirreldoc/reference/language/builtin_functions.html#thread). rsquirrel is very similar to vanilla squirrel in this regard. -A thread is considered finished, after the threaded function returned a value. This may be ``null``. +A thread is considered finished, after the threaded function returned a value. This may be `null`. ### Spinning off a thread -To create a new coroutine, call a function with the ``thread`` keyword before. +To create a new coroutine, call a function with the `thread` keyword before. ```squirrel @@ -22,7 +22,7 @@ To create a new coroutine, call a function with the ``thread`` keyword before. thread MyFunction() ``` -To get a thread object, use the ``newthread`` function. +To get a thread object, use the `newthread` function. ```squirrel @@ -39,7 +39,7 @@ To get a thread object, use the ``newthread`` function. ### wait -The ``wait`` statement halts threads for a set amount of time specified after the ``wait`` keyword. Integers and floats are accepted as times in seconds. +The `wait` statement halts threads for a set amount of time specified after the `wait` keyword. Integers and floats are accepted as times in seconds. ```squirrel void function WaitExample( float n ) @@ -51,11 +51,11 @@ The ``wait`` statement halts threads for a set amount of time specified after th thread WaitExample( 0.5 ) // thread will halt for a total 1.5 seconds ``` -To wait a single frame, don't use ``wait 0`` since it doesn't actually wait a game frame. For example, if you have a client loop that does wait 0 even if the game is paused the loop will still run. Use ``WaitFrame()`` instead. +To wait a single frame, don't use `wait 0` since it doesn't actually wait a game frame. For example, if you have a client loop that does wait 0 even if the game is paused the loop will still run. Use `WaitFrame()` instead. -When using infinite loops it's important to work with ``wait`` statements to avoid the game freezing. +When using infinite loops it's important to work with `wait` statements to avoid the game freezing. -If you want to wait until a thread is finished, you can spin off the thread that you wait for with the ``waitthread`` keyword. +If you want to wait until a thread is finished, you can spin off the thread that you wait for with the `waitthread` keyword. ```squirrel @@ -73,7 +73,7 @@ If you want to wait until a thread is finished, you can spin off the thread that ### OnThreadEnd -Use the ``OnThreadEnd`` function to execute a callback after a thread has ended. This is useful for cleanup functions that remove entities after they're used or similar. +Use the `OnThreadEnd` function to execute a callback after a thread has ended. This is useful for cleanup functions that remove entities after they're used or similar. ```squirrel @@ -134,7 +134,7 @@ Signals and flags allow threads to wait for events before running some code. !!! cpp-function "void Signal( string signal, table results = null )" - Trigger a signal on this entity. The passed ``results`` will be returned by ``WaitSignal``. + Trigger a signal on this entity. The passed `results` will be returned by `WaitSignal`. !!! cpp-function "void EndSignal( string signal )" @@ -146,7 +146,7 @@ Signals and flags allow threads to wait for events before running some code. !!! cpp-function "void ConnectOutput( string signal, void functionref( entity trigger, entity activator, entity caller, var value ) callback )" - Register a callback that executes when the ``signal`` has been fired on this Entity + Register a callback that executes when the `signal` has been fired on this Entity !!! cpp-function "void DisconnectOutput( string event, void functionref( entity trigger, entity activator, entity caller, var value ) callback )" @@ -154,7 +154,7 @@ Signals and flags allow threads to wait for events before running some code. !!! cpp-function "void AddOutput( string outputName, string | entity target, string inputName, string parameter = "", float delay = 0, float maxFires = 0 )" - Connects an output on this entity to an input on another entity via code. The ``target`` can be a name or a named entity. + Connects an output on this entity to an input on another entity via code. The `target` can be a name or a named entity. !!! cpp-function "void Fire( string signal, string param = "", float delay = 0, entity activator = null, entity caller = null )" @@ -168,7 +168,7 @@ It's also possible to trigger and catch signals with methods that aren't propert !!! cpp-function "void Signal( var obj, string signal, table results = null )" - Trigger a signal on ``ent``. The passed ``results`` will be returned by ``WaitSignal``. + Trigger a signal on `ent`. The passed `results` will be returned by `WaitSignal`. !!! cpp-function "table WaitSignal( entity ent, ... )" @@ -182,7 +182,7 @@ It's also possible to trigger and catch signals with methods that aren't propert !!! cpp-function "void EndSignal( var obj, string signal )" - Ends this thread when the identifier is signaled on ``ent`` + Ends this thread when the identifier is signaled on `ent` #### Example @@ -229,15 +229,15 @@ For example, if we want to tell a player not to give up after being killed sever thread DontGiveUp( player ) ``` -In this example, the ``DontGiveUp`` method is launched at the same time as ``WatchForDeaths``; but it will not +In this example, the `DontGiveUp` method is launched at the same time as `WatchForDeaths`; but it will not run until player died 42 times. -When you want your thread to die on a given event, you can use ``entity.EndSignal( "OnMultipleDeaths" )``; when said signal +When you want your thread to die on a given event, you can use `entity.EndSignal( "OnMultipleDeaths" )`; when said signal is set, thread will end (after calling any `OnThreadEnd` methods). ### Flags -``Flags`` work pretty much the same way as ``Signals``, except they can be set up without target entity: +`Flags` work pretty much the same way as `Signals`, except they can be set up without target entity: !!! cpp-function "void FlagInit( string flag, bool isSet = false )" @@ -261,7 +261,7 @@ is set, thread will end (after calling any `OnThreadEnd` methods). !!! cpp-function "void FlagSetOnFlag( string flagset, string flagwait, float delay = 0 )" - Set ``flagset`` after ``flagwait`` is set and the delay is met. + Set `flagset` after `flagwait` is set and the delay is met. !!! cpp-function "void FlagClear( string flag )" @@ -273,7 +273,7 @@ is set, thread will end (after calling any `OnThreadEnd` methods). !!! cpp-function "void FlagClearOnFlag( string flagclear, string flagwait )" - Reset ``flagclear`` when ``flagwait`` is set. + Reset `flagclear` when `flagwait` is set. !!! cpp-function "void FlagWaitClearWithTimeout( string flag, float timeOut )" @@ -299,15 +299,15 @@ is set, thread will end (after calling any `OnThreadEnd` methods). !!! cpp-function "bool FlagExists( string flag )" - Returns ``true`` if the flag is initialized + Returns `true` if the flag is initialized !!! cpp-function "array GetFlagsFromString( string str )" - Splits the flag on ``" "`` + Splits the flag on `" "` !!! cpp-function "array GetFlagsFromField( entity ent, var field )" - Splits the value of the keyvalues of the entity on the index ``field`` on ``" "`` + Splits the value of the keyvalues of the entity on the index `field` on `" "` #### Example diff --git a/docs/Modding/squirrel/class.md b/docs/Modding/squirrel/class.md index 9fa57416..c38a0601 100644 --- a/docs/Modding/squirrel/class.md +++ b/docs/Modding/squirrel/class.md @@ -9,7 +9,7 @@ ## Declaring Classes -To declare a class, first add the ``untyped`` keyword and the class as a variable at +To declare a class, first add the `untyped` keyword and the class as a variable at file level. ```squirrel @@ -18,10 +18,10 @@ file level. var ExampleClass ``` -The ``untyped`` declaration is required because instances have an unknown type and it's +The `untyped` declaration is required because instances have an unknown type and it's not possible to use classes as types. -``var [classname]`` represents the class. After declaring the class inside of a function +`var [classname]` represents the class. After declaring the class inside of a function you can use it in the script. You can use any type that can hold vars to store classes. Refer to [Namespaces](#namespaces) for more info. @@ -46,9 +46,9 @@ executed on object creation. You can require parameters in the constructor. Keep in mind that you have to pass those when creating an object. -Function parameters are passed as type ``var``, but the type keyword is not required. -``constructor( parameter ){}; func( parameter ){};`` and ``constructor( var parameter -){}; func( var parameter ){};`` are both correct. +Function parameters are passed as type `var`, but the type keyword is not required. +`constructor( parameter ){}; func( parameter ){};` and `constructor( var parameter +){}; func( var parameter ){};` are both correct. ```squirrel @@ -68,10 +68,10 @@ Function parameters are passed as type ``var``, but the type keyword is not requ ``` Usually objects have properties. To define them, just add their identifier into the -class without type declaration. The properties will be of type ``var``. However, you are -required to set a default value of a property. This may be ``null``. +class without type declaration. The properties will be of type `var`. However, you are +required to set a default value of a property. This may be `null`. -Every object has a reference to itself called ``this``. You can change parameters of an +Every object has a reference to itself called `this`. You can change parameters of an object by reference. ```squirrel @@ -86,12 +86,12 @@ object by reference. } ``` -You can't use the class name as a type. Use ``var`` instead. You can't ``expect`` them +You can't use the class name as a type. Use `var` instead. You can't `expect` them either. ## Declaring Functions of Classes -Functions of a class have to return a value of type ``var``. This may be ``null``. +Functions of a class have to return a value of type `var`. This may be `null`. Define functions like this: ```squirrel @@ -121,11 +121,11 @@ Define functions like this: ## Inserting Properties Into Classes It's possible to insert more properties into a class at runtime. To achieve this, use -the ``<-`` operator. +the `<-` operator. ```squirrel - // Using ``ExampleClass`` and ``exampleObject`` from example above + // Using `ExampleClass` and `exampleObject` from example above ExampleClass.newProperty <- "New property in class" // The value of the new index may be of any type. ExampleClass.newFunc <- function(){return "Function return value";} @@ -147,7 +147,7 @@ the ``<-`` operator. } ``` -Inserting functions is also possible using the ``::`` operator +Inserting functions is also possible using the `::` operator ```squirrel @@ -182,7 +182,7 @@ For example, extending functionality of the CPlayer class might look like this: } ``` -This will allow scripts to run the ``AFK`` method on CPlayer entities, which will kick a +This will allow scripts to run the `AFK` method on CPlayer entities, which will kick a player after 3 Make sure to load this script **after** the class has been declared and **before** it's @@ -223,7 +223,7 @@ Like the example above shows you can manipulate properties of a class directly. no way to make a private property. Methods from a class can be accessed without an instance. Note that the class itself -doesn't have a reference to itself, meaning that the ``this`` keyword refers to the root +doesn't have a reference to itself, meaning that the `this` keyword refers to the root table. ```squirrel @@ -337,7 +337,7 @@ And in a similar fashion in structs: !!! warning - Respawn's fork doesn't appear to support inheritance. Using the ``extend`` keyword + Respawn's fork doesn't appear to support inheritance. Using the `extend` keyword won't compile. ```squirrel diff --git a/docs/Modding/squirrel/cpp_api/objecthandling.md b/docs/Modding/squirrel/cpp_api/objecthandling.md index 2e408941..022451a2 100644 --- a/docs/Modding/squirrel/cpp_api/objecthandling.md +++ b/docs/Modding/squirrel/cpp_api/objecthandling.md @@ -10,7 +10,7 @@ !!! cpp-class "SquirrelManager" - You can access all sq functions only with a ``SquirrelManager`` instance. You have one available inside the ``ADD_SQFUNC`` macro. + You can access all sq functions only with a `SquirrelManager` instance. You have one available inside the `ADD_SQFUNC` macro. ## Pushing Objects to the stack @@ -42,8 +42,8 @@ - `HSquirrelVM* sqvm` the target VM - `SQChar* sVal` the string that will be pushed - - `int len` length of the string ``sVal`` - . If the parameter length is less than 0 the VM will calculate the length using ``strlen`` + - `int len` length of the string `sVal` + . If the parameter length is less than 0 the VM will calculate the length using `strlen` pushes a string to the stack @@ -52,8 +52,8 @@ - `HSquirrelVM* sqvm` the target VM - `SQChar* sVal` the string that will be pushed - - `int len` length of the string ``sVal`` - . If the parameter length is less than 0 the VM will calculate the length using ``strlen`` + - `int len` length of the string `sVal` + . If the parameter length is less than 0 the VM will calculate the length using `strlen` pushes an asset to the stack @@ -81,7 +81,7 @@ pushes the current root table into the stack !!! note - ``sq_pushnull`` (``0x33D0``) and more aren't included in ``squirrel.h`` right now but may be in the future. + `sq_pushnull` (`0x33D0`) and more aren't included in `squirrel.h` right now but may be in the future. ## Getting Objects from the stack @@ -137,7 +137,7 @@ !!! note - This function (``server.dll+0x5920```) is not available in the launcher or plugins at the moment. + This function (`server.dll+0x5920```) is not available in the launcher or plugins at the moment. You can open a PR if you need it now. @@ -170,7 +170,7 @@ - `SQObject* returnObj` reference to the object to hold the function object - `SQChar* signature` - returns ``0`` if the function was found. + returns `0` if the function was found. ```cpp @@ -193,7 +193,7 @@ - `CSquirrelVM* sqvm` The target vm - `SQObject* pInstance` Instance holding an entity - - `char** ppEntityConstant` Entity constant like `ref``__sq_GetEntityConstant_CBaseEntity ` + - `char** ppEntityConstant` Entity constant like `ref`__sq_GetEntityConstant_CBaseEntity ` !!! cpp-function "char** __sq_GetEntityConstant_CBaseEntity()" @@ -207,7 +207,7 @@ - `SQInteger iStackPos` Stack position of the object - `SQObject* obj` Pointer that will hold the object - ``obj`` will be overwritten to hold the squirrel object. + `obj` will be overwritten to hold the squirrel object. This example adds a native function with the `ADD_SQFUNC` macro. The function takes a function reference as a callback and calls it immediately. @@ -232,7 +232,7 @@ - `HSquirrelVM* sqvm` the target vm - `SQInteger stackpos` stack position of the object - Returns an ``SQRESULT`` that indicates whether or not the access was successful. + Returns an `SQRESULT` that indicates whether or not the access was successful. pops a key from the stack and performs a get operation on the object at the position idx in the stack; and pushes the result in the stack. diff --git a/docs/Modding/squirrel/cpp_api/objectmanipulation.md b/docs/Modding/squirrel/cpp_api/objectmanipulation.md index fc9eddc8..1e312351 100644 --- a/docs/Modding/squirrel/cpp_api/objectmanipulation.md +++ b/docs/Modding/squirrel/cpp_api/objectmanipulation.md @@ -8,7 +8,7 @@ - `HSquirrelVM* sqvm` the target vm - `SQInteger size` initial size of the array - Returns a ``SQRESULT`` + Returns a `SQRESULT` creates a new array and pushes it to the stack @@ -32,7 +32,7 @@ - `HSquirrelVM* sqvm` the target vm - `SQInteger stackpos` stack position of the array to append to - - Returns a ``SQRESULT`` + - Returns a `SQRESULT` pops a value from the stack and pushes it to the back of the array at the position idx in the stack @@ -43,7 +43,7 @@ - `HSquirrelVM* sqvm` the target vm - Returns a ``SQRESULT`` + Returns a `SQRESULT` creates a new table and pushes it onto the stack. @@ -52,7 +52,7 @@ - `HSquirrelVM* sqvm` the target vm - `SQInteger stackpos` the index of the table to insert into - - `SQBool bstatic` if ``SQTrue`` creates a static member. This parameter is only used if the target object is a class. + - `SQBool bstatic` if `SQTrue` creates a static member. This parameter is only used if the target object is a class. pops a key and a value from the stack and performs a set operation on the table or class that is at position idx in the stack, if the slot does not exist it will be created. @@ -97,7 +97,7 @@ - `HSquirrelVM* sqvm` The target vm - `int fieldCount` total number of fields the struct contains - Creates and pushes a struct instance with ``fieldCount`` to the stack. + Creates and pushes a struct instance with `fieldCount` to the stack. !!! cpp-function "SQRESULT::SQRESULT_NULL sealstructslot(HSquirrelVM* sqvm, int fieldIndex)" @@ -105,7 +105,7 @@ - `HSquirrelVM* sqvm` The target vm - `int fieldIndex` Index of the field to fill - Pops a value from the stack and fills the field at ``fieldIndex`` from the struct object that needs to be at the top of the stack. + Pops a value from the stack and fills the field at `fieldIndex` from the struct object that needs to be at the top of the stack. ```cpp diff --git a/docs/Modding/squirrel/cpp_api/sq_functions.md b/docs/Modding/squirrel/cpp_api/sq_functions.md index 5a5c1040..afee9801 100644 --- a/docs/Modding/squirrel/cpp_api/sq_functions.md +++ b/docs/Modding/squirrel/cpp_api/sq_functions.md @@ -3,7 +3,7 @@ ## Adding Squirrel Functions {#sq-api-register-native-functions-c-macro} -You can use the ``ADD_SQFUNC`` macro defined in ``squirrelautobind.h`` to easily add new Squirrel functions for specific contexts. +You can use the `ADD_SQFUNC` macro defined in `squirrelautobind.h` to easily add new Squirrel functions for specific contexts. Inside the macro you have access to the Squirrel Manager of the context the function has been called from and the SQVM. @@ -31,7 +31,7 @@ Return a string from a native registered function: } ``` -Return a complex ``ornull`` type: +Return a complex `ornull` type: ```cpp @@ -58,18 +58,18 @@ Return a complex ``ornull`` type: Replacing functions is not possible in plugins -You can use the ``REPLACE_SQFUNC`` macro to replace an existing sq function. +You can use the `REPLACE_SQFUNC` macro to replace an existing sq function. !!! cpp-function "macro REPLACE_SQFUNC(funcName, runOnContext)" - `funcName` The name of the function to replace - `runOnContext` The contexts that have access to this function -It's also possible to add an override directly with the ``AddFuncOverride`` function of the ``SquirrelManager`` class. +It's also possible to add an override directly with the `AddFuncOverride` function of the `SquirrelManager` class. !!! cpp-function "void AddFuncOverride(std::string name, SQFunction func)" - - `std``string name` The name of the function to override + - `std`string name` The name of the function to override - `SQFunc func` A function object that replaces the logic ```cpp @@ -84,17 +84,17 @@ It's also possible to add an override directly with the ``AddFuncOverride`` func Scriptcontexts are used to define the VMs that have access to a native function. Available Contexts are -- ``ScriptContext::SERVER`` - The SERVER sqvm -- ``ScriptContext::CLIENT`` - The CLIENT sqvm -- ``ScriptContext::UI`` - The UI vm +- `ScriptContext::SERVER` - The SERVER sqvm +- `ScriptContext::CLIENT` - The CLIENT sqvm +- `ScriptContext::UI` - The UI vm ## Script Returns -Squirrel functions need to return a ``SQRESULT``. Valid results are +Squirrel functions need to return a `SQRESULT`. Valid results are -- ``SQRESULT_NULL`` - This function returns ``null``. Nothing is left over on the stack. -- ``SQRESULT_NOTNULL`` - This functions returns the last item on the stack. -- ``SQRESULT_ERROR`` - This function has thrown an error. +- `SQRESULT_NULL` - This function returns `null`. Nothing is left over on the stack. +- `SQRESULT_NOTNULL` - This functions returns the last item on the stack. +- `SQRESULT_ERROR` - This function has thrown an error. ## Calling {#sq-api-calling-functions} @@ -165,7 +165,7 @@ Squirrel functions need to return a ``SQRESULT``. Valid results are - `HSquirrelVM* sqvm` the target vm - `SQInteger args` number of arguments to call this function with - ``_call`` adds one to the ``args`` count for ``this``. + `_call` adds one to the `args` count for `this`. !!! note @@ -198,7 +198,7 @@ Squirrel functions need to return a ``SQRESULT``. Valid results are calls a closure or a native closure. The function pops all the parameters and leave the closure in the stack; if retval is true the return value of the closure is pushed. If the execution of the function is suspended through sq_suspendvm(), the closure and the arguments will not be automatically popped from the stack. - When using to create an instance, push a dummy parameter to be filled with the newly-created instance for the constructor's ``this`` parameter. + When using to create an instance, push a dummy parameter to be filled with the newly-created instance for the constructor's `this` parameter. ## Errors @@ -207,9 +207,9 @@ Squirrel functions need to return a ``SQRESULT``. Valid results are - `HSquirrelVM* sqvm` the target vm - `SQChar* error` string thrown - - Returns ``SQRESULT_ERROR`` + - Returns `SQRESULT_ERROR` - Throws an error with ``error`` being the thrown object. + Throws an error with `error` being the thrown object. ```cpp diff --git a/docs/Modding/squirrel/cpp_api/stack.md b/docs/Modding/squirrel/cpp_api/stack.md index 3c11d235..e70c1931 100644 --- a/docs/Modding/squirrel/cpp_api/stack.md +++ b/docs/Modding/squirrel/cpp_api/stack.md @@ -32,7 +32,7 @@ The Squirrel API offers several functions to push and retrieve data from the Sta !!! note - This function (``server.dll+0x7000```) is not available in the launcher or plugins at the moment. + This function (`server.dll+0x7000```) is not available in the launcher or plugins at the moment. You can open a PR if you need it now. diff --git a/docs/Modding/squirrel/functions.md b/docs/Modding/squirrel/functions.md index fb28518c..6a047b54 100644 --- a/docs/Modding/squirrel/functions.md +++ b/docs/Modding/squirrel/functions.md @@ -4,9 +4,9 @@ Functions are an integral part of any programming language. They allow to repeat ## Declaring Functions -Functions in squirrel are defined with this syntax: `` function () `` +Functions in squirrel are defined with this syntax: ` function () ` -For example, a simple function that returns either ``true`` or ``false`` would look like this: +For example, a simple function that returns either `true` or `false` would look like this: ```squirrel @@ -35,9 +35,9 @@ You can return anything, however the type of the returned variable needs to matc Keep in mind that no code after a return statement will get executed. -If you don't want to return any value, use ``void`` as the return type. This indicates that your function returns ``null``. +If you don't want to return any value, use `void` as the return type. This indicates that your function returns `null`. -If nothing is returned by a function, ``null`` will get returned implicitly. +If nothing is returned by a function, `null` will get returned implicitly. ```squirrel @@ -57,7 +57,7 @@ If nothing is returned by a function, ``null`` will get returned implicitly. } ``` -In ``untyped`` files you may leave out the return type. In those cases the return type will default to ``var``. +In `untyped` files you may leave out the return type. In those cases the return type will default to `var`. ## Parameters @@ -80,7 +80,7 @@ Parameters are the input a function gets when called. They are local variables w ## Optional parameters -Sometimes you need parameters that are optional for a function, like extra options. If a parameter name is followed by ``= ``, that parameter is not required to call the function. +Sometimes you need parameters that are optional for a function, like extra options. If a parameter name is followed by `= `, that parameter is not required to call the function. Optional parameters need to be the last parameters of a function. @@ -106,9 +106,9 @@ Optional parameters need to be the last parameters of a function. ## vargs -With vargs you can pass a function an unlimited amount of parameters. The parameters will be inside a pseudo array called ``vargv``. The length of the vargs the function receives will be stored inside a variable called ``vargc``. +With vargs you can pass a function an unlimited amount of parameters. The parameters will be inside a pseudo array called `vargv`. The length of the vargs the function receives will be stored inside a variable called `vargc`. -You can denote a function to have vargs with adding ``...`` to the end of the parameter list. +You can denote a function to have vargs with adding `...` to the end of the parameter list. ```squirrel diff --git a/docs/Modding/squirrel/index.md b/docs/Modding/squirrel/index.md index b49594cf..1b4dfb6b 100644 --- a/docs/Modding/squirrel/index.md +++ b/docs/Modding/squirrel/index.md @@ -17,13 +17,13 @@ For Notepad++, define a custom language for Squirrel. Luckily, [samisalreadytake written a squirrel highlighter](https://gist.github.com/samisalreadytaken/5bcf322332074f31545ccb6651b88f2d#file-squirrel-xml). 1. Download Squirrel.xml -2. At the top, edit ``ext="nut"`` to ``ext="nut gnut"`` so it works with gnut files as +2. At the top, edit `ext="nut"` to `ext="nut gnut"` so it works with gnut files as well 3. Open Notepad++ 4. Navigate to Language > User Defined Language > Define your language 5. Click import, and select Squirrel.xml -(If the colors/style are not to your taste) 1. Select ``Squirrel`` in User Language at +(If the colors/style are not to your taste) 1. Select `Squirrel` in User Language at the top 2. Navigate through the tabs to find what you want to change 3. Click its '`Styler`' button and make the changes you wish to diff --git a/docs/Modding/squirrel/networking.md b/docs/Modding/squirrel/networking.md index 300a5b52..996fbd02 100644 --- a/docs/Modding/squirrel/networking.md +++ b/docs/Modding/squirrel/networking.md @@ -1,16 +1,16 @@ # Communicating between CLIENT, UI and SERVER scripts -All VMs (``CLIENT``, ``UI``, ``SERVER``) are seperate from each other and do not share any variables, even when running on the same machine. +All VMs (`CLIENT`, `UI`, `SERVER`) are seperate from each other and do not share any variables, even when running on the same machine. However, there are different interfaces to communicate between all VMs. -## ``SERVER`` to ``CLIENT`` vm +## `SERVER` to `CLIENT` vm ### Remote Functions -Remote functions allow the ``SERVER`` vm to call a function from the ``CLIENT`` vm with parameters. +Remote functions allow the `SERVER` vm to call a function from the `CLIENT` vm with parameters. -To use remote functions, you have to make a registration on both the ``CLIENT`` and the ``SERVER`` vm with ``Remote_RegisterFunction``. +To use remote functions, you have to make a registration on both the `CLIENT` and the `SERVER` vm with `Remote_RegisterFunction`. Northstar provides the @@ -20,13 +20,13 @@ callback in which you can use the !!! cpp-function "Remote_RegisterFunction(string identifier)" -function. It's not possible to register remote functions after ``Remote_EndRegisteringFunctions`` has been called. The callback exists to allow multiple mods to register remote vars. +function. It's not possible to register remote functions after `Remote_EndRegisteringFunctions` has been called. The callback exists to allow multiple mods to register remote vars. !!! warning - You can only pass parameters of the types ``null``, ``int``, ``float`` or ``bool``. + You can only pass parameters of the types `null`, `int`, `float` or `bool`. - It is possible to communicate entities using eHandles. To get an eHandle, use the ``entity.GetEncodedEHandle()`` function. To get the corresponding entity of a handle, use ``entity ent = GetEntityFromEncodedEHandle( eHandle )``. eHandles are of type ``int``. + It is possible to communicate entities using eHandles. To get an eHandle, use the `entity.GetEncodedEHandle()` function. To get the corresponding entity of a handle, use `entity ent = GetEntityFromEncodedEHandle( eHandle )`. eHandles are of type `int`. #### Example @@ -51,7 +51,7 @@ mod.json extract: sh_spaceships.nut: -The networked ``CLIENT`` function has to be global +The networked `CLIENT` function has to be global ```squirrel @@ -80,7 +80,7 @@ The networked ``CLIENT`` function has to be global #endif //CLIENT ``` -Calling the ``CLIENT`` function ``Server_GetNetworkedVariable`` on ``SERVER`` vm: +Calling the `CLIENT` function `Server_GetNetworkedVariable` on `SERVER` vm: ```squirrel @@ -97,13 +97,13 @@ Calling the ``CLIENT`` function ``Server_GetNetworkedVariable`` on ``SERVER`` vm ### Server to Client command callbacks -Allows the ``SERVER`` vm to create a ``ServerToClientStringCommand`` on a player which is linked to a Callback locally +Allows the `SERVER` vm to create a `ServerToClientStringCommand` on a player which is linked to a Callback locally #### Register a server command !!! note - this has to be executed on the ``Before`` Client callback + this has to be executed on the `Before` Client callback the formatting for the server command is like a normal console command. Arguments are seperated by spaces @@ -132,7 +132,7 @@ and execute with the function serverside: } ``` -## ``SERVER`` to ``UI`` vm +## `SERVER` to `UI` vm !!! cpp-function "Remote_CallFunction_UI( entity player, string functionName, ... )" @@ -145,7 +145,7 @@ and execute with the function serverside: Remote_CallFunction_UI( player, "ScriptCallback_UnlockAchievement", achievementID ) ``` -## ``CLIENT`` to ``SERVER`` vm +## `CLIENT` to `SERVER` vm ### Client to Server command callbacks @@ -153,13 +153,13 @@ Register a client command callback serverside with !!! cpp-function "AddClientCommandCallback( string command, bool functionref( entity player /*CPlayer*/, array "args ) callback ) -``player`` is the player that called the command clientside. The callback function should return ``true`` if the command was accepted and ``false`` if it was invalid. +`player` is the player that called the command clientside. The callback function should return `true` if the command was accepted and `false` if it was invalid. -The ``CLIENT`` vm can execute commands with the function: +The `CLIENT` vm can execute commands with the function: !!! cpp-function "player.ClientCommand( string command )" -These will be handled by the ``SERVER`` if the command is registered. +These will be handled by the `SERVER` if the command is registered. ### ClientCommand Notifications @@ -182,14 +182,14 @@ Since version 1.5 mods can receive notifications when a client command has been Please refer to :ref:`list_client_commands` for a list of native client commands you could catch. -### ``CLIENT`` to ``UI`` vm +### `CLIENT` to `UI` vm -Create a global function in the ``UI`` vm and call it in the ``CLIENT`` vm with the function: +Create a global function in the `UI` vm and call it in the `CLIENT` vm with the function: !!! cpp-function "RunUIScript( string identifier, ... ) " -You can also pass parameters to the function. ``identifier`` is the name of the function you want to call. +You can also pass parameters to the function. `identifier` is the name of the function you want to call. ## Example @@ -206,14 +206,14 @@ You can also pass parameters to the function. ``identifier`` is the name of the #endif ``` -## ``UI`` to ``CLIENT`` vm +## `UI` to `CLIENT` vm -Create a global function in the ``CLIENT`` vm and call it in the ``UI`` vm with the function: +Create a global function in the `CLIENT` vm and call it in the `UI` vm with the function: !!! cpp-function "RunClientScript( string identifier, ... )" -You can also pass parameters to the function. ``identifier`` is the name of the function you want to call. +You can also pass parameters to the function. `identifier` is the name of the function you want to call. #### Example diff --git a/docs/Modding/squirrel/statements.md b/docs/Modding/squirrel/statements.md index 0fa5f5fc..75257833 100644 --- a/docs/Modding/squirrel/statements.md +++ b/docs/Modding/squirrel/statements.md @@ -2,23 +2,23 @@ ## If statements -If statements use a similar style to most programming languages and will execute their asigned code if the test placed inside returns the boolean value true. If I wanted to have something occur if, and only if, our previous ``ReturnTrueOrFalse`` function returned true, then you can use: +If statements use a similar style to most programming languages and will execute their asigned code if the test placed inside returns the boolean value true. If I wanted to have something occur if, and only if, our previous `ReturnTrueOrFalse` function returned true, then you can use: ```squirrel if( ReturnTrueOrFalse() ) ``` -Conditional operators can also be used to make comparisons, such as ``==`` (equals), ``<`` (less than), ``<=`` (less than or equal), ``!=`` (not equal), etc., returning true if their condition is satisfied. For example, to execute code if a dice roll landed on 5: +Conditional operators can also be used to make comparisons, such as `==` (equals), `<` (less than), `<=` (less than or equal), `!=` (not equal), etc., returning true if their condition is satisfied. For example, to execute code if a dice roll landed on 5: ```squirrel if( RandomInt( 6 ) + 1 == 5 ) ``` -Like other languages, if statements can be connected to ``else if`` and ``else`` statements. ``else if`` statements must be used immediately after an ``if`` or ``else if`` and will only check their condition if the preceding statements failed. ``else`` statements behave similarly, but always run if the preceding statements failed and must be last. +Like other languages, if statements can be connected to `else if` and `else` statements. `else if` statements must be used immediately after an `if` or `else if` and will only check their condition if the preceding statements failed. `else` statements behave similarly, but always run if the preceding statements failed and must be last. Squirrel supports ternary operations like most languages. The value of the expression depends if a condition is truthy or not. However, if not used carefully this can worsen readability. -The Syntax is ``condition ? if_condition_true : if_condition_false``. This is especially useful when declaring variables or passing parameters. +The Syntax is `condition ? if_condition_true : if_condition_false`. This is especially useful when declaring variables or passing parameters. ```squirrel @@ -63,7 +63,7 @@ A do while loop is the same as a while loop but the condition is checked **after A for loop also runs until a condition is met however it provides you with a counter variable. -The Syntax is as follows: ``for( int counter; condition; behaviour_after_body_execution )`` +The Syntax is as follows: `for( int counter; condition; behaviour_after_body_execution )` ```squirrel @@ -83,7 +83,7 @@ The Syntax is as follows: ``for( int counter; condition; behaviour_after_body_ex ### Foreach Loop -A foreach loop iterates over a ``table`` or an ``array`` and executes for each entry. The loop provides you with an optional counter for arrays or key for tables. +A foreach loop iterates over a `table` or an `array` and executes for each entry. The loop provides you with an optional counter for arrays or key for tables. ```squirrel @@ -108,7 +108,7 @@ A foreach loop iterates over a ``table`` or an ``array`` and executes for each e ## Implicit conditional behavior -Conditional statements, such as while loops and if statements, also implictly cast non-boolean inputs to booleans. For numbers, this means 0 is considered false and anything else is considered true. For instance variables like arrays and entities, ``null`` is considered false and anything else is considered true. For example, these inputs are considered true by the if statements: +Conditional statements, such as while loops and if statements, also implictly cast non-boolean inputs to booleans. For numbers, this means 0 is considered false and anything else is considered true. For instance variables like arrays and entities, `null` is considered false and anything else is considered true. For example, these inputs are considered true by the if statements: ```squirrel @@ -121,12 +121,12 @@ Conditional statements, such as while loops and if statements, also implictly ca if(somelist) ``` -Be aware that empty arrays and strings, ``[]`` and ``""``, are considered true by this logic. +Be aware that empty arrays and strings, `[]` and `""`, are considered true by this logic. ## Formatting of actions -So great, we can loop and check things, but what can we do with this information? Squirrel uses ``{}`` to denote the contents of a series of actions caused by such a statement. +So great, we can loop and check things, but what can we do with this information? Squirrel uses `{}` to denote the contents of a series of actions caused by such a statement. -For example, lets make our ``ReturnTrueOrFalse`` function, that randomly picks either true or false, first: +For example, lets make our `ReturnTrueOrFalse` function, that randomly picks either true or false, first: ```squirrel @@ -135,7 +135,7 @@ For example, lets make our ``ReturnTrueOrFalse`` function, that randomly picks e } ``` -Note that while functions always need ``{}``, single-line ``if``/``else`` statements and loops do not: +Note that while functions always need `{}`, single-line `if`/`else` statements and loops do not: ```squirrel diff --git a/docs/Modding/squirrel/statements/controlflow.md b/docs/Modding/squirrel/statements/controlflow.md index 858b49c1..2ab25ca7 100644 --- a/docs/Modding/squirrel/statements/controlflow.md +++ b/docs/Modding/squirrel/statements/controlflow.md @@ -4,7 +4,7 @@ Squirrel supports most basic control flow statements. ## If -``if`` statements check if a condition evaluates to ``true``. +`if` statements check if a condition evaluates to `true`. ```squirrel @@ -12,4 +12,4 @@ Squirrel supports most basic control flow statements. body ``` -``null``, ``0`` and ``0.0`` evaluate to ``false``. +`null`, `0` and `0.0` evaluate to `false`. diff --git a/docs/Modding/squirrel/types/arrays.md b/docs/Modding/squirrel/types/arrays.md index bf292c74..69a7edac 100644 --- a/docs/Modding/squirrel/types/arrays.md +++ b/docs/Modding/squirrel/types/arrays.md @@ -4,15 +4,15 @@ Unlike the data types previously covered, arrays can hold multiple values. Their size is dynamic and you can add and remove elements at will. -The type keyword is ``array``. +The type keyword is `array`. By default, uninitialized arrays are empty. -Arrays are always zero indexed with ``[ ]``. The indexes are always numbers. If you index an array with a key that does not exist, an error will get thrown. +Arrays are always zero indexed with `[ ]`. The indexes are always numbers. If you index an array with a key that does not exist, an error will get thrown. ## Literals -Array literals are a comma or newline seperated sequence of expressions delimited by an opening bracket ``[`` and a corresponding closing bracket ``]``. +Array literals are a comma or newline seperated sequence of expressions delimited by an opening bracket `[` and a corresponding closing bracket `]`. ```squirrel @@ -45,7 +45,7 @@ Primitive arrays are arrays that can hold any value. Their content is therefore Complex Arrays are arrays that can only hold values that have a specific type. -The content type needs to be specified within ``<`` and ``>`` brackets. +The content type needs to be specified within `<` and `>` brackets. There is no way to define a complex array that holds multiple different types. @@ -62,13 +62,13 @@ There is no way to define a complex array that holds multiple different types. Static arrays are a different kind of complex type. Like complex arrays they can only hold values of one specific type. However unlike complex arrays static arrays have a set length that cannot be changed. -The typing for static arrays is ``type[size]``, where ``type`` is the content type of the array and ``size`` is an **integer literal** of the total size of the array. +The typing for static arrays is `type[size]`, where `type` is the content type of the array and `size` is an **integer literal** of the total size of the array. Uninitialized static arrays have their size by default and all content values are the **default values of their content type**. You can index and change content values like with regular arrays. -When initializing a static array you can omit all values after your initial values with ``...``. All following values will get default initialized with the content's default. +When initializing a static array you can omit all values after your initial values with `...`. All following values will get default initialized with the content's default. ```squirrel @@ -82,7 +82,7 @@ When initializing a static array you can omit all values after your initial valu ## Compatability -It is not possible to cast or convert an array between their different forms. For example you can't assign an ``array`` variable to a different variable that has the type ``array`` or the other way around. +It is not possible to cast or convert an array between their different forms. For example you can't assign an `array` variable to a different variable that has the type `array` or the other way around. Instead you need to create an entirely new array with the target type or add all contents manually. @@ -96,4 +96,4 @@ Instead you need to create an entirely new array with the target type or add all target.append( v ) ``` -Furthermore it's important to understand that ``array`` and ``array`` behave the same but **are not identical**. +Furthermore it's important to understand that `array` and `array` behave the same but **are not identical**. diff --git a/docs/Modding/squirrel/types/booleans.md b/docs/Modding/squirrel/types/booleans.md index 4513749c..8b0cb1cc 100644 --- a/docs/Modding/squirrel/types/booleans.md +++ b/docs/Modding/squirrel/types/booleans.md @@ -1,8 +1,8 @@ # Booleans -Booleans are a primitive type that can be either ``true`` or ``false`` +Booleans are a primitive type that can be either `true` or `false` -The type name and keyword for Booleans is ``bool``. Booleans default initialize as ``false``. +The type name and keyword for Booleans is `bool`. Booleans default initialize as `false`. ```squirrel diff --git a/docs/Modding/squirrel/types/entities.md b/docs/Modding/squirrel/types/entities.md index a92ff1c1..2455105a 100644 --- a/docs/Modding/squirrel/types/entities.md +++ b/docs/Modding/squirrel/types/entities.md @@ -2,13 +2,13 @@ Entities are a primitive type that can refer to any in-game object. -The type keyword is ``entity``. +The type keyword is `entity`. Entities are always class instances of classes that are defined by native code. The classes differ between the CLIENT or UI, and SERVER vm. You can not specify which entity class a variable is supposed to hold so you need to be careful you know what entity is expected where. -If you need to check the class of an entity at runtime you can do so with the ``instanceof`` operator. +If you need to check the class of an entity at runtime you can do so with the `instanceof` operator. ```squirrel @@ -18,7 +18,7 @@ If you need to check the class of an entity at runtime you can do so with the `` } ``` -Entities are ``null`` initialized and there are no literals for entities. +Entities are `null` initialized and there are no literals for entities. ```squirrel diff --git a/docs/Modding/squirrel/types/floats.md b/docs/Modding/squirrel/types/floats.md index 0cd42c7f..e1f84b92 100644 --- a/docs/Modding/squirrel/types/floats.md +++ b/docs/Modding/squirrel/types/floats.md @@ -2,13 +2,13 @@ Floats are 32 bit floating point numbers that can be any decimal number. -An unitilized float will have the default value ``0.0``. +An unitilized float will have the default value `0.0`. -The type keyword for floats is ``float``. +The type keyword for floats is `float`. ## Literals -Float literals need to contain a ``.`` to distinguish them from integer literals. +Float literals need to contain a `.` to distinguish them from integer literals. They may omit the decimal before the period, however after the period a value is required. diff --git a/docs/Modding/squirrel/types/functionrefs.md b/docs/Modding/squirrel/types/functionrefs.md index 20d3c663..d33108e1 100644 --- a/docs/Modding/squirrel/types/functionrefs.md +++ b/docs/Modding/squirrel/types/functionrefs.md @@ -2,7 +2,7 @@ Function references are a complex type that can reference any function or closure. -The type keyword is ``functionref`` and needs to include any parameter types and optionally return types. +The type keyword is `functionref` and needs to include any parameter types and optionally return types. ```squirrel @@ -13,7 +13,7 @@ The type keyword is ``functionref`` and needs to include any parameter types and } ``` -You can call functionrefs like a regular function. The return type of a functionref will default to ``var`` if omitted. Omitting the return type is only possible in ``untyped`` files. +You can call functionrefs like a regular function. The return type of a functionref will default to `var` if omitted. Omitting the return type is only possible in `untyped` files. Parameter names are optional in functionrefs. Otherwise the parameter syntax is like in regular functions. diff --git a/docs/Modding/squirrel/types/integers.md b/docs/Modding/squirrel/types/integers.md index 72298993..9ee3b20a 100644 --- a/docs/Modding/squirrel/types/integers.md +++ b/docs/Modding/squirrel/types/integers.md @@ -2,9 +2,9 @@ Integers in Squirrel are 32 bit signed integers and can be any whole number (in the 32 bit confines). -An Integer is a primitive type with a default value of ``0``. +An Integer is a primitive type with a default value of `0`. -The type keyword for Integers is ``int``. +The type keyword for Integers is `int`. ## Literals @@ -20,7 +20,7 @@ Integers can be represented with multiple different literals. - Hexadecimal - If any number is prefixed with ``0x``, it is a hexadecimal literal. + If any number is prefixed with `0x`, it is a hexadecimal literal. ``` squirrel @@ -29,7 +29,7 @@ Integers can be represented with multiple different literals. - Octal - Numbers starting with a ``0`` are octal literals. + Numbers starting with a `0` are octal literals. ``` squirrel diff --git a/docs/Modding/squirrel/types/ornull.md b/docs/Modding/squirrel/types/ornull.md index aedcc013..0159d9af 100644 --- a/docs/Modding/squirrel/types/ornull.md +++ b/docs/Modding/squirrel/types/ornull.md @@ -1,11 +1,11 @@ # ornull -``ornull`` is a type suffix that flags the variable to be able to contain ``null``. +`ornull` is a type suffix that flags the variable to be able to contain `null`. This is required for nesting structs inside themselves to ensure they are fixed size. -``ornull`` makes any type complex and stops you from using any inbuilt functions or passing it to a function that does not expect that exact ``ornull`` type. +`ornull` makes any type complex and stops you from using any inbuilt functions or passing it to a function that does not expect that exact `ornull` type. -To use the value of an ``ornull`` variable you need to ensure that it is not ``null`` and then cast to the correct type. +To use the value of an `ornull` variable you need to ensure that it is not `null` and then cast to the correct type. ```squirrel @@ -21,9 +21,9 @@ To use the value of an ``ornull`` variable you need to ensure that it is not ``n print( n ) // 3 ``` -Being required to cast the value of ``ornull`` variables makes it impossible to use it with types that cannot be casted like complex arrays. You can still make complex ornull variables, just be aware that the content type can never be recasted. +Being required to cast the value of `ornull` variables makes it impossible to use it with types that cannot be casted like complex arrays. You can still make complex ornull variables, just be aware that the content type can never be recasted. -You can use ``ornull`` types in complex type as well, for example in complex arrays. +You can use `ornull` types in complex type as well, for example in complex arrays. ```squirrel @@ -32,7 +32,7 @@ You can use ``ornull`` types in complex type as well, for example in complex arr a.append( null ) ``` -Additionally, ``ornull`` is useful for adding optional parameters to functions that need to preserve backwards compatability. +Additionally, `ornull` is useful for adding optional parameters to functions that need to preserve backwards compatability. ```squirrel @@ -45,4 +45,4 @@ Additionally, ``ornull`` is useful for adding optional parameters to functions t ## Default Values -``ornull``-ing a type will make a variable always default initia will make a variable always default initialize with ``null`` instead of the types respective default value.lize with ``null`` instead of the types respective default value. +`ornull`-ing a type will make a variable always default initia will make a variable always default initialize with `null` instead of the types respective default value.lize with `null` instead of the types respective default value. diff --git a/docs/Modding/squirrel/types/strings.md b/docs/Modding/squirrel/types/strings.md index 40fa1f02..4c4d8b52 100644 --- a/docs/Modding/squirrel/types/strings.md +++ b/docs/Modding/squirrel/types/strings.md @@ -4,9 +4,9 @@ Unlike in other languages, strings in squirrel are primitive types and immutable The default value of strings is an empty string with a length of 0. -The type keyword for strings is ``string``. +The type keyword for strings is `string`. -To create strings, simply write the text of the literals in ``"`` quotes. +To create strings, simply write the text of the literals in `"` quotes. ```squirrel string s = "this is an example string literal" @@ -15,7 +15,7 @@ To create strings, simply write the text of the literals in ``"`` quotes. ## Verbatim Strings -Verbatim strings do not escape sequences. They begin with a ``@`` token before a regular string literal. +Verbatim strings do not escape sequences. They begin with a `@` token before a regular string literal. Verbatim strings can also extend over multiple lines. If they do they include any white space between the matching string quotes. @@ -44,13 +44,13 @@ Assets and strings are internally the same but at compile time they are differen Assets are used to reference a specific resource (often in rpak files). -The type keyword for assets is ``asset``. +The type keyword for assets is `asset`. -Asset literals are regular string literals prefixed with the ``$`` token. Verbatim strings can't be an asset. +Asset literals are regular string literals prefixed with the `$` token. Verbatim strings can't be an asset. ```squirrel asset a = $"my/resource" ``` -Northstar added the ``StringToAsset`` function that allows converting any string into an asset. +Northstar added the `StringToAsset` function that allows converting any string into an asset. diff --git a/docs/Modding/squirrel/types/structs.md b/docs/Modding/squirrel/types/structs.md index 9554ca23..614389e9 100644 --- a/docs/Modding/squirrel/types/structs.md +++ b/docs/Modding/squirrel/types/structs.md @@ -18,9 +18,9 @@ The fields are typed like any regular variable. } ``` -You can then use ``MyStruct`` as a type anywhere in the file. +You can then use `MyStruct` as a type anywhere in the file. Structs are default initialized by assigning each field it's appropriate default value. -Struct fields can be indexed by writing ``instance.field``, just like with tables. +Struct fields can be indexed by writing `instance.field`, just like with tables. ```squirrel @@ -32,7 +32,7 @@ Structs are passed by reference so if a function changes a field that field is c Struct instances can also get initiaized with different default values if required. -Similar like in static arrays, you can omit any fields that should have their type's default value with ``...``. +Similar like in static arrays, you can omit any fields that should have their type's default value with `...`. ```squirrel @@ -65,7 +65,7 @@ Struct fields can be any type, this includes previously declared structs as well ### Self Nesting Structs -Structs can contain fields of their own type, however they need to be **null initialized**. You can achieve this by specifying their type as ``ornull``. +Structs can contain fields of their own type, however they need to be **null initialized**. You can achieve this by specifying their type as `ornull`. ```squirrel diff --git a/docs/Modding/squirrel/types/tables.md b/docs/Modding/squirrel/types/tables.md index 31c6b14a..09351ba5 100644 --- a/docs/Modding/squirrel/types/tables.md +++ b/docs/Modding/squirrel/types/tables.md @@ -6,9 +6,9 @@ In other languages tables might be called Hashmaps, Maps or Objects. Entries are added with a key that can subsequently be used to read that object from the table back. -The type keyword is ``table``. +The type keyword is `table`. -To index an array with a string you can write ``t.index``, or with an expression just like in arrays with ``t.["index"]``. +To index an array with a string you can write `t.index`, or with an expression just like in arrays with `t.["index"]`. ```squirrel @@ -19,11 +19,11 @@ To index an array with a string you can write ``t.index``, or with an expression ## Literals -Table literals are comma or newline seperated expressions that are delimited by ``{`` and ``}``. +Table literals are comma or newline seperated expressions that are delimited by `{` and `}`. -Each entry needs to have a key, seperated from the initial value with a ``=``. +Each entry needs to have a key, seperated from the initial value with a `=`. -Table keys will be by default strings if you just write their identifier in the literal. However they can also be any expression if wrapped with ``[`` and ``]``. +Table keys will be by default strings if you just write their identifier in the literal. However they can also be any expression if wrapped with `[` and `]`. ```squirrel @@ -40,7 +40,7 @@ Table keys will be by default strings if you just write their identifier in the Like arrays primitive tables can hold any type, both as values and keys. -Any value of key of the table will therefore be ``var`` if retrieved. +Any value of key of the table will therefore be `var` if retrieved. ## Complex Tables diff --git a/docs/Modding/squirrel/types/var.md b/docs/Modding/squirrel/types/var.md index 2e1bae46..b0d5da04 100644 --- a/docs/Modding/squirrel/types/var.md +++ b/docs/Modding/squirrel/types/var.md @@ -1,6 +1,6 @@ # Var -``var`` stands for a variable of any type. Any **primitive** can be ``var``, however complex types can never be ``var``. +`var` stands for a variable of any type. Any **primitive** can be `var`, however complex types can never be `var`. ```squirrel @@ -11,6 +11,6 @@ v = {} ``` -in ``untyped`` files you can also use the ``local`` keyword instead of ``var``. However the keyword is deprecated and should not be used. +in `untyped` files you can also use the `local` keyword instead of `var`. However the keyword is deprecated and should not be used. -If possible, usage of ``var`` should be avoided and other static types should be used instead to benefit from the type checking of squirrel. +If possible, usage of `var` should be avoided and other static types should be used instead to benefit from the type checking of squirrel. diff --git a/docs/Modding/squirrel/types/vectors.md b/docs/Modding/squirrel/types/vectors.md index 13d8e9c5..60ed2006 100644 --- a/docs/Modding/squirrel/types/vectors.md +++ b/docs/Modding/squirrel/types/vectors.md @@ -4,11 +4,11 @@ Vectors are a primitive data type to describe velocities or positions of objects Usually the positions are absolute in the game world, but that may depend on the function. -Vectors store 3 float values that can be accessed with the ``x``, ``y`` and ``z`` keys. +Vectors store 3 float values that can be accessed with the `x`, `y` and `z` keys. ## Literals -A vector literal is a comma seperated list of expressions that evaluate to either a **float** or **integer** delimited by ``<`` and ``>`` brackets. +A vector literal is a comma seperated list of expressions that evaluate to either a **float** or **integer** delimited by `<` and `>` brackets. ```squirrel