diff --git a/docs/developers/basics/creating-an-addon.md b/docs/developers/basics/creating-an-addon.md index 0c28548..53173ea 100644 --- a/docs/developers/basics/creating-an-addon.md +++ b/docs/developers/basics/creating-an-addon.md @@ -6,19 +6,19 @@ The first step to get started with `lua` or any coding in general is the choice of an editor. I recommend the use of [Visual Studio Code](https://code.visualstudio.com/). However any editor can be used, even the default Microsoft editor works. -Additionally a [linter](https://en.wikipedia.org/wiki/Lint_(software)) is a nice to have tool to make sure the code is clean and works. The [glualint](https://marketplace.visualstudio.com/items?itemName=goz3rr.vscode-glualint) linter is perfect for the development of TTT addons since it combines normal lua linting with code completition of gmod functions (you have to follow the installation steps found in glualint description). +Additionally a [linter]() is a nice to have tool to make sure the code is clean and works. The [glualint](https://marketplace.visualstudio.com/items?itemName=goz3rr.vscode-glualint) linter is perfect for the development of TTT addons since it combines normal lua linting with code completition of gmod functions (you have to follow the installation steps found in glualint description). Additionally there are other lua addons available. All addons can be easily installed from inside VSCode itself with a single click. ???+ abstract "Ready to Use Editor With Version Control and GMod Linting" - ![My VSCode](../../assets/images/article/vscode.png) +![My VSCode](../../assets/images/article/vscode.png) ### Version Control It is generally recommended to use [Git](https://git-scm.com/) for the management of projects. Especially if they are software related. We're using [GitHub](http://github.com/) as our hosting platform, however you are free to use any alternative that you like. GitHub also offers an easy to use client that is really beginner friendly. It is called [GitHub Desktop](https://desktop.github.com/). ???+ abstract "Easy to Use Graphical Interface for GitHub" - ![My Addons Folder](../../assets/images/article/github.png) +![My Addons Folder](../../assets/images/article/github.png) Once your software is set up, you can create your first repository. Personally I do not like to create my local repository folders inside the garrysmod `addons/` folder since I prefer to have all my projects inside one folder to keep them organised. This creates a problem though, since it is really tedious to copy the contents from the `addons/` folder to your projects folder and back. [Symbolic links](https://en.wikipedia.org/wiki/Symbolic_link) are a neat solution for this. Personally on windows I use a graphical interface ([tutorial on setup and use](https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/)), however it is up to your own preferences. @@ -27,7 +27,7 @@ Once your software is set up, you can create your first repository. Personally I All your addon files have to be placed into `GarrysMod/garrysmod/addons` and are automatically loaded when the game is started. Adding a new addon folder into this directory needs a restart of the game however. ???+ abstract "`addons/` Folder With Many Addons as Symbolic Links Inside" - ![My Addons Folder](../../assets/images/article/folder.png) +![My Addons Folder](../../assets/images/article/folder.png) See [this source](https://wiki.facepunch.com/gmod/Lua_Folder_Structure) for a detailed overview over the standard Garry's Mod project structure. @@ -41,7 +41,7 @@ Files have to be placed in `lua/terrortown/autorun` to be loaded. However those #### Language -Language files are a means to make translations for users easier by putting translations into their own folder and therefore keeping things cleans. Translations have to be placed in `lua/terrortown/lang/`. A more in depth documenation can be found in the [language support](/developers/content-creation/language-support/) section. +Language files are a means to make translations for users easier by putting translations into their own folder and therefore keeping things cleans. Translations have to be placed in `lua/terrortown/lang/`. A more in depth documenation can be found in the [language support](/developers/content-creation/language-support.md) section. #### Items @@ -49,7 +49,7 @@ While TTT2 is still compatible with old TTT items, it has its own item loader. I #### VSkins -VSkins are an easy way of changing the appearance of the vgui elements. They are automatically loaded if placed inside `lua/terrortown/vskins/`. A more in depth documenation can be found in the [vskin](/developers/content-creation/vskin/) section. +VSkins are an easy way of changing the appearance of the vgui elements. They are automatically loaded if placed inside `lua/terrortown/vskins/`. A more in depth documenation can be found in the [vskin](/developers/content-creation/vskin.md) section. #### Events @@ -59,7 +59,7 @@ Every time someting happens in the game, an event is triggered. Those events can #### Roles -Custom role files have to be placed inside `lua/terrortown/entities/roles`. A more in depth documenation can be found in the [creating a role](/developers/content-creation/creating-a-role/) section. +Custom role files have to be placed inside `lua/terrortown/entities/roles`. A more in depth documenation can be found in the [creating a role](/developers/content-creation/creating-a-role.md) section. ## Publishing your Addon @@ -69,39 +69,39 @@ The most easy way of publishing your addon is with the [GMPublisher](https://git In order to upload your addon to the Steam Workshop, you need to first compile it into a .gma file. -1. Your addon file must contain an "addon.json" within the `/` directory of your folder. This consists of a key:value pair table with information used by the Steam -Workshop to create tags for uploads. +1. Your addon file must contain an "addon.json" within the `/` directory of your folder. This consists of a key:value pair table with information used by the Steam + Workshop to create tags for uploads. It should have a structure like this: - ???+ abstract "Example addon.json file" - ![addon_json.png](../../assets/images/article/addon_json.png) + ???+ abstract "Example addon.json file" + ![addon_json.png](../../assets/images/article/addon_json.png) - Type is the category which this addon fits into best. One of: - "ServerContent", "gamemode", "map", "weapon", "vehicle", "npc", "tool", "effects", "model". + Type is the category which this addon fits into best. One of: + "ServerContent", "gamemode", "map", "weapon", "vehicle", "npc", "tool", "effects", "model". - Tags are what describes your addon best. Choose two of: - "fun", "roleplay", "scenic", "movie", "realism", "cartoon", "water", "comic", "build". + Tags are what describes your addon best. Choose two of: + "fun", "roleplay", "scenic", "movie", "realism", "cartoon", "water", "comic", "build". - Ignore is what files (you can use the \* as a wildcard to ignore file extensions - e.g. \*.txt) you dont want gmad to compile for use in the resulting .gma file. + Ignore is what files (you can use the \* as a wildcard to ignore file extensions - e.g. \*.txt) you dont want gmad to compile for use in the resulting .gma file. -1. Navigate to your GarrysMod bin directory. (Usually in `Steam/steamapps/common/GarrysMod/bin`). +1. Navigate to your GarrysMod bin directory. (Usually in `Steam/steamapps/common/GarrysMod/bin`). -1. Drag and drop your addon folder onto gmad.exe. This will generate a .gma file and place it into the same directory that your original folder came from. +1. Drag and drop your addon folder onto gmad.exe. This will generate a .gma file and place it into the same directory that your original folder came from. Alternatively you can use the cmd which gives you better error messages. Navigate to the GMod bin folder on the cmd and type gmad.exe, this gives you the gmad usage info. Input the directory to your addon folder and specify the output file directory and name. ???+ abstract "gmad help output" - ![gmad_info.png](../../assets/images/article/gmad_info.png) + ![gmad_info.png](../../assets/images/article/gmad_info.png) -1. Navigate to the bin folder via cmd to use gmpublish.exe. +1. Navigate to the bin folder via cmd to use gmpublish.exe. -1. Type `gmpublish.exe` to view usage information, input your icon and `*.gma` paths in their respective fields. +1. Type `gmpublish.exe` to view usage information, input your icon and `*.gma` paths in their respective fields. ???+ abstract "gmpublish help output" - ![gmpublish_info.png](../../assets/images/article/gmpublish_info.png) + ![gmpublish_info.png](../../assets/images/article/gmpublish_info.png) -1. You have now published your addon onto the steam workshop. Visit the addon in the workshop via the link that gmpublish gives you to add information to it and make it public. +1. You have now published your addon onto the steam workshop. Visit the addon in the workshop via the link that gmpublish gives you to add information to it and make it public. ## Helpful Resources -* [The Garry's Mod wiki](https://wiki.facepunch.com/) +- [The Garry's Mod wiki](https://wiki.facepunch.com/) diff --git a/docs/developers/content-creation/creating-a-class.md b/docs/developers/content-creation/creating-a-class.md index a725356..efd143b 100644 --- a/docs/developers/content-creation/creating-a-class.md +++ b/docs/developers/content-creation/creating-a-class.md @@ -1,6 +1,6 @@ # Creating a Class -Make sure to check out our [basics guide](/developers/basics/creating-an-addon/) if you have general questions about creating addons for TTT2. +Make sure to check out our [basics guide](/developers/basics/creating-an-addon.md) if you have general questions about creating addons for TTT2. To create a class, the function `CLASS.AddClass(name, classData, conVarData)` has to be called on both client and server. @@ -35,14 +35,14 @@ The `classData` argument is a table that contains all the important class settin ### General Class Settings ???+ example "Setting the Class Color" - The class color is stored in the color variable. This color value is used to display the class in the HUD and in other places like targetID. +The class color is stored in the color variable. This color value is used to display the class in the HUD and in other places like targetID. ```lua classData.color = -- [default: Color(255, 155, 0, 255)] ``` ???+ example "Setting the Language" - The language for the class consists of two parts: The name and the description. At least the name should be set, but it is good practise to set the description as well. +The language for the class consists of two parts: The name and the description. At least the name should be set, but it is good practise to set the description as well. The existing language identifiers can be found [inside these files](https://github.com/TTT-2/TTT2/tree/master/gamemodes/terrortown/gamemode/shared/lang). Currently these identifiers exist: `English`, `Deutsch`, `Русский`, `Polski`, `Italiano` @@ -51,14 +51,14 @@ The `classData` argument is a table that contains all the important class settin ``` ???+ example "Setting a Class to Be Passive" - By default, classes are active. This means that they have an ability that is enabled on keypress and can only be used once activated. Besides these active feature, classes can have passive features as well (like armor for a class). However, if your class should only have passive features, set this variable to `true`. +By default, classes are active. This means that they have an ability that is enabled on keypress and can only be used once activated. Besides these active feature, classes can have passive features as well (like armor for a class). However, if your class should only have passive features, set this variable to `true`. ```lua classData.passive = -- [default: false] ``` ???+ example "Surpress Keep on Respawn" - If `true`, the player won't get the class back on respawn, no matter how the ConVar `ttt_classes_keep_on_respawn` is set. +If `true`, the player won't get the class back on respawn, no matter how the ConVar `ttt_classes_keep_on_respawn` is set. ```lua classData.surpressKeepOnRespawn = -- [default: false] @@ -67,7 +67,7 @@ The `classData` argument is a table that contains all the important class settin See [the Vendetta](https://github.com/TTT-2/ttt2h-pack-default/blob/master/lua/classes/classes/class_vendetta.lua) for an example. ???+ example "Class is Active During Death" - Should be set to `true`, if the class is getting active after the players death and should not get removed after death. This information is important for other addons like "TTTC Class Dropper". +Should be set to `true`, if the class is getting active after the players death and should not get removed after death. This information is important for other addons like "TTTC Class Dropper". ```lua classData.activeDuringDeath = -- [default: false] @@ -76,7 +76,7 @@ The `classData` argument is a table that contains all the important class settin See [the Vendetta](https://github.com/TTT-2/ttt2h-pack-default/blob/master/lua/classes/classes/class_vendetta.lua) for an example. ???+ example "Deactivate Automatic Class Handling" - The class system handles each feature in predefined functions. However you might want to create a really custom class that does not rely on any standard implementations. By setting this variable to `true`, none of the following functions and tables will be used. +The class system handles each feature in predefined functions. However you might want to create a really custom class that does not rely on any standard implementations. By setting this variable to `true`, none of the following functions and tables will be used. ```lua classData.deactivated = -- [default: false] @@ -87,28 +87,28 @@ The `classData` argument is a table that contains all the important class settin ### Passive Ability ???+ example "Passive Weapons" - A table of weapons given to the player once the class is set, they are automatically removed when the class is removed from the player. You can use the hook `TTTCPreventClassEquipment` to prevent the weapon hand-out and `TTTCPreventClassRemovement` to prevent the weapon removal to happen. +A table of weapons given to the player once the class is set, they are automatically removed when the class is removed from the player. You can use the hook `TTTCPreventClassEquipment` to prevent the weapon hand-out and `TTTCPreventClassRemovement` to prevent the weapon removal to happen. ```lua classData.passiveWeapons = {} ``` ???+ example "Passive Items" - A table of items given to the player once the class is set, they are automatically removed when the class is removed from the player. You can use the hook `TTTCPreventClassEquipment` to prevent the item hand-out and `TTTCPreventClassRemovement` to prevent the item removal to happen. +A table of items given to the player once the class is set, they are automatically removed when the class is removed from the player. You can use the hook `TTTCPreventClassEquipment` to prevent the item hand-out and `TTTCPreventClassRemovement` to prevent the item removal to happen. ```lua classData.passiveItems = {} ``` ???+ example "On Class Set Callback" - A function that is called when this class is given to a player after class change or on respawn. You can use the hook `TTTCPreventClassEquipment` to prevent this function to happen. +A function that is called when this class is given to a player after class change or on respawn. You can use the hook `TTTCPreventClassEquipment` to prevent this function to happen. ```lua classData.OnSet = function(ply) -- [default: nil] ``` ???+ example "On Class Unset Callback" - A function that is called when this class is removed from a player. You can use the hook `TTTCPreventClassRemovement` to prevent this function to happen. +A function that is called when this class is removed from a player. You can use the hook `TTTCPreventClassRemovement` to prevent this function to happen. ```lua classData.OnUnset = function(ply) -- [default: nil] @@ -117,21 +117,21 @@ The `classData` argument is a table that contains all the important class settin ### Active Ability ???+ example "Active Weapons" - A table of weapons given to the player once the class is activated, they are automatically removed when the class is deactivated or removed from the player. +A table of weapons given to the player once the class is activated, they are automatically removed when the class is deactivated or removed from the player. ```lua classData.weapons = {} ``` ???+ example "Passive Items" - A table of items given to the player once the class is activated, they are automatically removed when the class is deactivated or removed from the player. +A table of items given to the player once the class is activated, they are automatically removed when the class is deactivated or removed from the player. ```lua classData.items = {} ``` ???+ example "Active Time" - The time how long the ability is enabled after the player activated it. If set to `0`, `onActivate` isn't called. You have to use `onDeactivated` in this case. This can be used for classes that have no active ability, but an ability that triggers an event. +The time how long the ability is enabled after the player activated it. If set to `0`, `onActivate` isn't called. You have to use `onDeactivated` in this case. This can be used for classes that have no active ability, but an ability that triggers an event. ```lua classData.time = -- [default: 60] @@ -140,63 +140,63 @@ The `classData` argument is a table that contains all the important class settin See [the Nebula](https://github.com/TTT-2/ttt2h-pack-default/blob/master/lua/classes/classes/class_nebula.lua) for an example of an event ability with a time of `0`. ???+ example "Cooldown Time" - The cooldown time after the usage of the active ability. +The cooldown time after the usage of the active ability. ```lua classData.cooldown = -- [default: 60] ``` ???+ example "Charging Time" - Defines how long the activation key must be pressed to activate the ability, `nil` for instant activation. +Defines how long the activation key must be pressed to activate the ability, `nil` for instant activation. ```lua classData.charging = -- [default: nil] ``` ???+ example "Max Activation Amount Per Round" - Defines how many times an ability can be activated per round, `nil` for infinite times. +Defines how many times an ability can be activated per round, `nil` for infinite times. ```lua classData.amount = -- [default: nil] ``` ???+ example "Endless Class Ability" - If `true`, the time of an ability is infinite and `time` is ignored. +If `true`, the time of an ability is infinite and `time` is ignored. ```lua classData.endless = -- [default: false] ``` ???+ example "Unstoppable Class Ability" - If `true`, the player can not disable the ability once they pressed the ability key. +If `true`, the player can not disable the ability once they pressed the ability key. ```lua classData.unstoppable = -- [default: false] ``` ???+ example "Avoid Weapon Reset" - By default, all weapons from the player inventory get removed once they activate their class ability. These weapons are given back after the ability is deactivated. If set to `true`, the player keeps his weapons while the class ability is active. +By default, all weapons from the player inventory get removed once they activate their class ability. These weapons are given back after the ability is deactivated. If set to `true`, the player keeps his weapons while the class ability is active. ```lua classData.avoidWeaponReset = -- [default: false] ``` ???+ example "On Class Activate Callback" - A function that is called on activation of an ability. If `avoidWeaponReset` is set to `false` weapons will be removed prior to this function call. +A function that is called on activation of an ability. If `avoidWeaponReset` is set to `false` weapons will be removed prior to this function call. ```lua classData.OnAbilityActivate = function(ply) -- [default: nil] ``` ???+ example "On Class Deactivate Callback" - A function that is called on deactivation of an ability. If `avoidWeaponReset` is set to `false` weapons will be given back prior to this function call. +A function that is called on deactivation of an ability. If `avoidWeaponReset` is set to `false` weapons will be given back prior to this function call. ```lua classData.OnAbilityDeactivate = function(ply) -- [default: nil] ``` ???+ example "On Class Prepare Callback" - A function that is called prior to `OnAbilityActivate`. If this function is set, the ability will be activated on the next ability-key press. This can be used to have a two step activation procedure +A function that is called prior to `OnAbilityActivate`. If this function is set, the ability will be activated on the next ability-key press. This can be used to have a two step activation procedure ```lua classData.OnStartPrepareAbilityActivation = function(ply) -- [default: nil] @@ -205,7 +205,7 @@ The `classData` argument is a table that contains all the important class settin See [the Frost](https://github.com/TTT-2/ttt2h-pack-default/blob/master/lua/classes/classes/class_frost.lua) for an example. ???+ example "On Class Finish Prepare Callback" - This function will only be called if `OnStartPrepareAbilityActivation` was set. It is called on the second press of the ability key and is done directly before `OnAbilityActivate`. If the ability was canceled in this process, this function is called prior to `OnAbilityDeactivate`. +This function will only be called if `OnStartPrepareAbilityActivation` was set. It is called on the second press of the ability key and is done directly before `OnAbilityActivate`. If the ability was canceled in this process, this function is called prior to `OnAbilityDeactivate`. ```lua classData.OnFinishPrepareAbilityActivation = function(ply) -- [default: nil] @@ -213,16 +213,15 @@ The `classData` argument is a table that contains all the important class settin See [the Frost](https://github.com/TTT-2/ttt2h-pack-default/blob/master/lua/classes/classes/class_frost.lua) for an example. - ???+ example "On Class Charge Callback" - This function is called once every frame after while a player is in the charging process, if the function is set and it returns `nil` or `false`, the charging process is stopped. +This function is called once every frame after while a player is in the charging process, if the function is set and it returns `nil` or `false`, the charging process is stopped. ```lua classData.OnCharge = function(ply) -- [default: nil] ``` ???+ example "Check Class Activation Callback" - This function is called when the ability should be activated. Activation fails if the function is set and it returns `nil` or `false`. +This function is called when the ability should be activated. Activation fails if the function is set and it returns `nil` or `false`. ```lua classData.CheckActivation = function(ply) -- [default: nil] @@ -233,7 +232,7 @@ The `classData` argument is a table that contains all the important class settin The `conVarData` table holds all default values for the convars to modify the class. ???+ example "Class Random" - This defines the spawn chance of a class. +This defines the spawn chance of a class. ```lua conVarData.random = -- [default: 100] diff --git a/docs/developers/content-creation/creating-a-hud-theme.md b/docs/developers/content-creation/creating-a-hud-theme.md index 073aba3..393052d 100644 --- a/docs/developers/content-creation/creating-a-hud-theme.md +++ b/docs/developers/content-creation/creating-a-hud-theme.md @@ -2,9 +2,9 @@ ## Basics -A HUD theme is just a normal addon for TTT2 and therefore is in no way different than other addons. Check out the [getting started guide](/developers/basics/creating-an-addon) to learn more about creation of addons. +A HUD theme is just a normal addon for TTT2 and therefore is in no way different than other addons. Check out the [getting started guide](/developers/basics/creating-an-addon.md) to learn more about creation of addons. -If you want to create a HUD element with the TTT2 system for one of your addons, check out [this article](/developers/content-creation/creating-a-hudelement/). +If you want to create a HUD element with the TTT2 system for one of your addons, check out [this article](/developers/content-creation/creating-a-hudelement.md). ## Basic Setup diff --git a/docs/developers/content-creation/creating-a-weapon.md b/docs/developers/content-creation/creating-a-weapon.md index b899134..9367391 100644 --- a/docs/developers/content-creation/creating-a-weapon.md +++ b/docs/developers/content-creation/creating-a-weapon.md @@ -16,17 +16,17 @@ Your weapon's lua file must be in this format: Your `*.vmt` and `*.vtf` icon files (what gets shown in the buy menu) will need to be stored in this format: -* `/materials/vgui/ttt/_icon.vtf` -* `/materials/vgui/ttt/_icon.vmt` +- `/materials/vgui/ttt/_icon.vtf` +- `/materials/vgui/ttt/_icon.vmt` -The basics about creating icons can be found [here](/developers/content-creation/icon-and-design-guideline/). +The basics about creating icons can be found [here](/developers/content-creation/icon-and-design-guideline.md). ### Model Files Model files for the SWEP will also need to be stored in the addon folder, unless you're using the default ones which come with source games. It's advised that even if you're using non-GMod models that you include them in the addon because not all users will own CS:S or Half life, etc. -* `/materials/models//.vmt` -* `/models/` +- `/materials/models//.vmt` +- `/models/` Documentation on how to create models will be uploaded soon. @@ -39,7 +39,7 @@ Custom sounds for your SWEP will need to be stored in this folder if you're not `/gamemodes/terrortown/content/sound/` ???+ note - Sounds types accepted are: `*.wav`, `*.mp3` and `*.ogg`. +Sounds types accepted are: `*.wav`, `*.mp3` and `*.ogg`. GMod default sound paths are found [here](https://wiki.facepunch.com/gmod/Common_Sounds). @@ -52,9 +52,9 @@ Each language file will need to be stored in this format: `/lua/terrortown/lang//.lua` ???+ note - The language identifier should be unique to prevent clashes with other addons' translations. +The language identifier should be unique to prevent clashes with other addons' translations. -See the [Language Support](/developers/content-creation/language-support/) page for more information on this topic. +See the [Language Support](/developers/content-creation/language-support.md) page for more information on this topic. See the [Creating An Addon](/developers/basics/creating-an-addon.md/#project-structure) page for more info on folder structure. @@ -132,7 +132,7 @@ SWEP.Primary.Recoil = 1.5 ``` ???+ note - All of these attributes can also be applied to SWEP.Secondary which is right click by default. +All of these attributes can also be applied to SWEP.Secondary which is right click by default. ```lua SWEP.HoldType = "ar2" @@ -176,19 +176,19 @@ SWEP.Kind = WEAPON_EQUIP1 ``` | `SWEP.Kind` | `WEAPON_MELEE` | `WEAPON_PISTOL` | `WEAPON_HEAVY` | `WEAPON_NADE` | `WEAPON_CARRY` | -| :---: | :---: | :---: | :---: | :---: | :---: | -| `SWEP.Slot` | 1 | 2 | 3 | 4 | 5 | +| :---------: | :------------: | :-------------: | :------------: | :-----------: | :------------: | +| `SWEP.Slot` | 1 | 2 | 3 | 4 | 5 | | `SWEP.Kind` | `WEAPON_UNARMED` | `WEAPON_SPECIAL` | `WEAPON_EXTRA` | `WEAPON_CLASS` | -| :---: | :---: | :---: | :---: | :---: | -| `SWEP.Slot` | 6 | 7 | 8 | 9 | +| :---------: | :--------------: | :--------------: | :------------: | :------------: | +| `SWEP.Slot` | 6 | 7 | 8 | 9 | ```lua -- Which roles can purchase this swep (table) SWEP.CanBuy = {ROLE_TRAITOR} ``` -This data is stored in a table, its the roles which can purchase it in the buy menu. Convention is that the keyword for each role is ROLE_. However the serveradmin can change those values at a later point in the shopeditor found ingame. +This data is stored in a table, its the roles which can purchase it in the buy menu. Convention is that the keyword for each role is ROLE\_. However the serveradmin can change those values at a later point in the shopeditor found ingame. ## Template diff --git a/docs/developers/content-creation/using-event-system.md b/docs/developers/content-creation/using-event-system.md index 4d55e66..a3fbaa5 100644 --- a/docs/developers/content-creation/using-event-system.md +++ b/docs/developers/content-creation/using-event-system.md @@ -3,10 +3,10 @@ The event system is a powerful feature of TTT2 that allows content creators to display rich event information in the round end screen, assign scores or add data to the log. In the following article it is explained how it can be used. ???+ abstract "Round end screen with events" - ![Icon Padding](../../assets/images/article/roundend.png) +![Icon Padding](../../assets/images/article/roundend.png) ???+ note - If you just plan on modifying the scoring of your role, check out the [role scoring variables](/developers/content-creation/creating-a-role/) first. +If you just plan on modifying the scoring of your role, check out the [role scoring variables](/developers/content-creation/creating-a-role.md) first. ## Registering an event @@ -17,7 +17,7 @@ An event is registered by simply placing an event file in the event folder of yo A basic event needs only the `Trigger(...)` function (which can have an arbitrary amount of parameters). However it is recommended to also define an `icon`, `title` and the `GetText()` function. `Serialize()` is recommended as well because it logs the event to the log file. `CalculateScore()` is used if the event should generate score. ???+ note - The event name is derived from the file name and stored in a global variable that can be accessed with `EVENT_`. +The event name is derived from the file name and stored in a global variable that can be accessed with `EVENT_`. Custom defined language strings (`title`, ...) do not have to use the `` notation, but it is recommended to do so. @@ -74,7 +74,7 @@ function EVENT:Serialize() end ``` -The icon is a simple white on transparent graphic with a resolution of 512x512 and a few empty pixels all the way around. Check out the [icon and design guideline](/developers/content-creation/icon-and-design-guideline/) to see how to create these icons. +The icon is a simple white on transparent graphic with a resolution of 512x512 and a few empty pixels all the way around. Check out the [icon and design guideline](/developers/content-creation/icon-and-design-guideline.md) to see how to create these icons. #### Localization @@ -119,7 +119,7 @@ events.Trigger(EVENT_, somePlayer) ## Networking -Event data is automatically networked from the server to the client after the round has ended. However not everything is synced. While there are multiple entries that are synced, you should only modify the `self.event` table if you want to add synced data. Data directly added to the class (e.g. `self.myData = xyz`) is **not** synced. +Event data is automatically networked from the server to the client after the round has ended. However not everything is synced. While there are multiple entries that are synced, you should only modify the `self.event` table if you want to add synced data. Data directly added to the class (e.g. `self.myData = xyz`) is **not** synced. ### Karma @@ -131,8 +131,9 @@ function EVENT:ShouldKarmaChangeSynchronize() return true end ``` + ???+ note - Synchronization is used in the finish-event to display the latest karma changes on roundendscreen. +Synchronization is used in the finish-event to display the latest karma changes on roundendscreen. ## Cancel or replace an event @@ -154,7 +155,7 @@ end ``` ???+ note - You shouldn't replace `EVENT_ROLECHANGE` because this event is used to generate the rolechange list in the round end screen. +You shouldn't replace `EVENT_ROLECHANGE` because this event is used to generate the rolechange list in the round end screen. [[Check out this example of a modified kill event that replaces the normal kill event]](https://github.com/TTT-2/ttt2-role_hit/blob/master/lua/terrortown/events/target_kill.lua) diff --git a/docs/developers/content-creation/using-karma.md b/docs/developers/content-creation/using-karma.md index 3bfe308..d19c6be 100644 --- a/docs/developers/content-creation/using-karma.md +++ b/docs/developers/content-creation/using-karma.md @@ -3,7 +3,7 @@ The mysterious karma system is mostly untouched in TTT2, but karma can now be easily added or subtracted and those changes are shown at the roundendscreen. ???+ abstract "Round end screen with detailed Karma" - ![Icon Padding](../../assets/images/article/roundend_karma.png) +![Icon Padding](../../assets/images/article/roundend_karma.png) ## Adding Karma @@ -18,10 +18,10 @@ This karma change gets applied to the base karma at the next round, before karma function KARMA.DoKarmaChange(ply, amount, reason) ``` -???+ note - As an example the reason "karma_teamkill_tooltip" gets localized as seen in the picture at the top. +???+ note +As an example the reason "karma_teamkill_tooltip" gets localized as seen in the picture at the top. - [Check out how to work with language localization.](/developers/content-creation/language-support/) + [Check out how to work with language localization.](/developers/content-creation/language-support.md) ```txt karma_teamkill_tooltip = "Teamkills" diff --git a/docs/general/migrating.md b/docs/general/migrating.md index 48d937b..1978efa 100644 --- a/docs/general/migrating.md +++ b/docs/general/migrating.md @@ -2,7 +2,7 @@ # General Info -When migrating from a different TTT version to TTT2, not many things have to be considered. Like explained in our [troubleshooting guide](/troubleshooting), you want to check the addonchecker output to make sure no incompatible addons are installed. +When migrating from a different TTT version to TTT2, not many things have to be considered. Like explained in our [troubleshooting guide](/troubleshooting/index.md), you want to check the addonchecker output to make sure no incompatible addons are installed. On a different note it should be mentioned that while it is possible to get a nearly identical experience with the available roles for TTT2, there are [quite a few unique roles available](https://steamcommunity.com/workshop/filedetails/?id=1737053146). @@ -16,29 +16,29 @@ If you want some inspiration for a working TTT2 collection, check out [our offic While migrating from town of terror to TTT2 nothing special has to be considered besides the things mentioned in the chapter about the conversion from vanilla to TTT2. Most of the roles in TTT2 are completely identical to the roles in town of terror. -| _Custom Roles_ | _TTT2_ | -| - | - | -| Survivalist | [Survivalist](https://steamcommunity.com/sharedfiles/filedetails/?id=1357256725) | -| Jester | [Jester](https://steamcommunity.com/sharedfiles/filedetails/?id=1363049665) | -| Phoenix | [Occultist](https://steamcommunity.com/sharedfiles/filedetails/?id=1959850321) | -| Serialkiller | [Serialkiller](https://steamcommunity.com/sharedfiles/filedetails/?id=1363905854) | -| Infected | [Infected](https://steamcommunity.com/sharedfiles/filedetails/?id=1371842074) | +| _Custom Roles_ | _TTT2_ | +| -------------- | --------------------------------------------------------------------------------- | +| Survivalist | [Survivalist](https://steamcommunity.com/sharedfiles/filedetails/?id=1357256725) | +| Jester | [Jester](https://steamcommunity.com/sharedfiles/filedetails/?id=1363049665) | +| Phoenix | [Occultist](https://steamcommunity.com/sharedfiles/filedetails/?id=1959850321) | +| Serialkiller | [Serialkiller](https://steamcommunity.com/sharedfiles/filedetails/?id=1363905854) | +| Infected | [Infected](https://steamcommunity.com/sharedfiles/filedetails/?id=1371842074) | ## Migrating from Custom Roles While migrating from custom roles to TTT2 nothing special has to be considered as well. If you want to keep the same roles however, here's a compiled list of all TTT2 counterparts that are mostly the same. -| _Custom Roles_ | _TTT2_ | -| - | - | -| Glitch | [Spy](https://steamcommunity.com/sharedfiles/filedetails/?id=1683708655) | -| Mercenary | [Survivalist](https://steamcommunity.com/sharedfiles/filedetails/?id=1357256725) | -| Phantom | [Spectre](https://steamcommunity.com/sharedfiles/filedetails/?id=2138979333) | -| Assassin | [Executioner](https://steamcommunity.com/sharedfiles/filedetails/?id=2133752484) | -| Hypnotist | [Mesmerist](https://steamcommunity.com/sharedfiles/filedetails/?id=2137829511) | -| Vampire | - | -| Zombie | - | -| Jester | [Jester](https://steamcommunity.com/sharedfiles/filedetails/?id=1363049665) | -| Swapper | [Jester](https://steamcommunity.com/sharedfiles/filedetails/?id=1363049665) | -| Killer | [Serialkiller](https://steamcommunity.com/sharedfiles/filedetails/?id=1363905854) | +| _Custom Roles_ | _TTT2_ | +| -------------- | --------------------------------------------------------------------------------- | +| Glitch | [Spy](https://steamcommunity.com/sharedfiles/filedetails/?id=1683708655) | +| Mercenary | [Survivalist](https://steamcommunity.com/sharedfiles/filedetails/?id=1357256725) | +| Phantom | [Spectre](https://steamcommunity.com/sharedfiles/filedetails/?id=2138979333) | +| Assassin | [Executioner](https://steamcommunity.com/sharedfiles/filedetails/?id=2133752484) | +| Hypnotist | [Mesmerist](https://steamcommunity.com/sharedfiles/filedetails/?id=2137829511) | +| Vampire | - | +| Zombie | - | +| Jester | [Jester](https://steamcommunity.com/sharedfiles/filedetails/?id=1363049665) | +| Swapper | [Jester](https://steamcommunity.com/sharedfiles/filedetails/?id=1363049665) | +| Killer | [Serialkiller](https://steamcommunity.com/sharedfiles/filedetails/?id=1363905854) | If you also want to make it so only detectives can confirm dead bodies, you'll find some convars regarding this in ulx in the dead player settings. diff --git a/mkdocs.yml b/mkdocs.yml index 1cc8bf2..2669d77 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,67 +1,73 @@ # Project information -site_name: 'TTT2 Documentation' +site_name: "TTT2 Documentation" site_description: "A Garry's Mod gamemode based on Trouble in Terrorist Town" #site_url: 'https://' # Repository -repo_name: 'TTT2' +repo_name: "TTT2" repo_url: https://github.com/TTT-2/TTT2/ -edit_uri: https://github.com/TTT-2/docs/edit/master/docs/ +edit_uri: https://github.com/TTT-2/docs/edit/main/docs/ # Configuration theme: - name: 'material' - language: 'en' + name: "material" + language: "en" features: - tabs - instant palette: - primary: 'indigo' - accent: 'indigo' + primary: "indigo" + accent: "indigo" font: - text: 'Roboto' - code: 'Roboto Mono' + text: "Roboto" + code: "Roboto Mono" + +validation: + links: + absolute_links: relative_to_docs + anchors: warn + unrecognized_links: warn # Navigation nav: - General: - - TTT2: 'index.md' - - Troubleshooting: 'troubleshooting/index.md' - - Role Overview: 'general/roles.md' - - Migrating: 'general/migrating.md' + - TTT2: "index.md" + - Troubleshooting: "troubleshooting/index.md" + - Role Overview: "general/roles.md" + - Migrating: "general/migrating.md" - Server Owners: - - Using TTT2: 'server-owners/index.md' + - Using TTT2: "server-owners/index.md" - Serverinstall Guides: - - 'server-owners/manual-install.md' + - "server-owners/manual-install.md" - Developers: - - Creating new Content: 'developers/index.md' + - Creating new Content: "developers/index.md" - Basics: - - 'developers/basics/creating-an-addon.md' - - 'developers/basics/code-style.md' + - "developers/basics/creating-an-addon.md" + - "developers/basics/code-style.md" - Content Creation: - - 'developers/content-creation/icon-and-design-guideline.md' - - 'developers/content-creation/creating-a-role.md' - - 'developers/content-creation/creating-a-class.md' - - 'developers/content-creation/creating-an-item.md' - - 'developers/content-creation/creating-a-weapon.md' - - 'developers/content-creation/creating-a-hudelement.md' - - 'developers/content-creation/creating-a-hud-theme.md' - - 'developers/content-creation/sidebar-population.md' - - 'developers/content-creation/using-targetid.md' - - 'developers/content-creation/using-event-system.md' - - 'developers/content-creation/using-karma.md' - - 'developers/content-creation/vskin.md' - - 'developers/content-creation/language-support.md' - - 'developers/content-creation/sql-orm.md' + - "developers/content-creation/icon-and-design-guideline.md" + - "developers/content-creation/creating-a-role.md" + - "developers/content-creation/creating-a-class.md" + - "developers/content-creation/creating-an-item.md" + - "developers/content-creation/creating-a-weapon.md" + - "developers/content-creation/creating-a-hudelement.md" + - "developers/content-creation/creating-a-hud-theme.md" + - "developers/content-creation/sidebar-population.md" + - "developers/content-creation/using-targetid.md" + - "developers/content-creation/using-event-system.md" + - "developers/content-creation/using-karma.md" + - "developers/content-creation/vskin.md" + - "developers/content-creation/language-support.md" + - "developers/content-creation/sql-orm.md" # Customization extra: - manifest: 'manifest.webmanifest' + manifest: "manifest.webmanifest" social: - - icon: 'fontawesome/brands/github-alt' - link: 'https://github.com/TTT-2' - - icon: 'fontawesome/brands/steam' - link: 'https://steamcommunity.com/sharedfiles/filedetails/?id=1357204556' + - icon: "fontawesome/brands/github-alt" + link: "https://github.com/TTT-2" + - icon: "fontawesome/brands/steam" + link: "https://steamcommunity.com/sharedfiles/filedetails/?id=1357204556" # Extensions markdown_extensions: