Skip to content

Commit

Permalink
Updated Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bleonheart committed May 16, 2024
1 parent 1e02ed6 commit e1f0aed
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 154 deletions.
6 changes: 4 additions & 2 deletions config.ld
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ end


new_type("hooks", "Hooks", true)
new_type("items", "Items", true)
new_type("faction", "Factions", true)
new_type("configurations", "Configurations", true)
new_type("factions", "Factions", true)
new_type("panel", "Panels", true)
tparam_alias("inventory", "Inventory")
tparam_alias("item", "Item")
tparam_alias("date", "date")
Expand All @@ -61,4 +63,4 @@ tparam_alias("tab", "table")
tparam_alias("material", "material")
tparam_alias("vector", "vector")
tparam_alias("angle", "angle")
tparam_alias("int", "integer")
tparam_alias("int", "integer")
68 changes: 34 additions & 34 deletions skeleton/schema/config/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,41 @@ This is meant to override Lilia's configuration options.
-- Each command is represented by a table with fields defining its functionality.
-- @realm shared
-- @table Lilia_Config_List
-- @field WalkSpeed: Controls how fast characters walk | integer.
-- @field RunSpeed: Controls how fast characters run | integer.
-- @field WalkRatio: Defines the walk speed ratio when holding the Alt key | float.
-- @field AllowExistNames: Determines whether duplicated character names are allowed | boolean.
-- @field GamemodeName: Specifies the name of the gamemode | string.
-- @field Color: Sets the theme color used throughout the gamemode | color.
-- @field Font: Specifies the core font used for UI elements | string.
-- @field GenericFont: Specifies the secondary font used for UI elements | string.
-- @field MoneyModel: Defines the model used for representing money in the game | string.
-- @field MaxCharacters: Sets the maximum number of characters per player | integer.
-- @field DataSaveInterval: Time interval between data saves | integer.
-- @field WalkSpeed: Controls how fast characters walk | **integer**
-- @field RunSpeed: Controls how fast characters run | **integer**
-- @field WalkRatio: Defines the walk speed ratio when holding the Alt key | **number**
-- @field AllowExistNames: Determines whether duplicated character names are allowed | **boolean**
-- @field GamemodeName: Specifies the name of the gamemode | **string**
-- @field Color: Sets the theme color used throughout the gamemode | **Color**
-- @field Font: Specifies the core font used for UI elements | **string**
-- @field GenericFont: Specifies the secondary font used for UI elements | **string**
-- @field MoneyModel: Defines the model used for representing money in the game | **string**
-- @field MaxCharacters: Sets the maximum number of characters per player | **integer**
-- @field DataSaveInterval: Time interval between data saves | **integer**
-- @field CharacterDataSaveInterval: Time interval between character data saves.
-- @field MoneyLimit: Sets the limit of money a player can have [0 for infinite] | integer.
-- @field invW: Defines the width of the default inventory | integer.
-- @field invH: Defines the height of the default inventory | integer.
-- @field DefaultMoney: Specifies the default amount of money a player starts with | integer.
-- @field MaxChatLength: Sets the maximum length of chat messages | integer.
-- @field CurrencySymbol: Specifies the currency symbol used in the game | string.
-- @field SpawnTime: Time to respawn after death | integer.
-- @field MaxAttributes: Maximum attributes a character can have | integer.
-- @field EquipDelay: Time delay between equipping items | integer.
-- @field DropDelay: Time delay between dropping items | integer.
-- @field TakeDelay: Time delay between taking items | integer.
-- @field CurrencySingularName: Singular name of the in-game currency | string.
-- @field CurrencyPluralName: Plural name of the in-game currency | string.
-- @field SchemaYear: Year in the gamemode's schema | integer.
-- @field AmericanDates: Determines whether to use the American date format | boolean.
-- @field AmericanTimeStamp: Determines whether to use the American timestamp format | boolean.
-- @field MinDescLen: Minimum length required for a character's description | integer.
-- @field TimeToEnterVehicle: Time [in seconds] required to enter a vehicle | integer.
-- @field CarEntryDelayEnabled: Determines if the car entry delay is applicable | boolean.
-- @field Notify: Contains notification sound and volume settings | table.
-- @field Notify[1]: Notification sound file path | string.
-- @field Notify[2]: Notification volume | integer.
-- @field Notify[3]: Notification pitch | integer.
-- @field MoneyLimit: Sets the limit of money a player can have [0 for infinite] | **integer**
-- @field invW: Defines the width of the default inventory | **integer**
-- @field invH: Defines the height of the default inventory | **integer**
-- @field DefaultMoney: Specifies the default amount of money a player starts with | **integer**
-- @field MaxChatLength: Sets the maximum length of chat messages | **integer**
-- @field CurrencySymbol: Specifies the currency symbol used in the game | **string**
-- @field SpawnTime: Time to respawn after death | **integer**
-- @field MaxAttributes: Maximum attributes a character can have | **integer**
-- @field EquipDelay: Time delay between equipping items | **integer**
-- @field DropDelay: Time delay between dropping items | **integer**
-- @field TakeDelay: Time delay between taking items | **integer**
-- @field CurrencySingularName: Singular name of the in-game currency | **string**
-- @field CurrencyPluralName: Plural name of the in-game currency | **string**
-- @field SchemaYear: Year in the gamemode's schema | **integer**
-- @field AmericanDates: Determines whether to use the American date format | **boolean**
-- @field AmericanTimeStamp: Determines whether to use the American timestamp format | **boolean**
-- @field MinDescLen: Minimum length required for a character's description | **integer**
-- @field TimeToEnterVehicle: Time [in seconds] required to enter a vehicle | **integer**
-- @field CarEntryDelayEnabled: Determines if the car entry delay is applicable | **boolean**
-- @field Notify: Contains notification sound and volume settings | **table**
-- @field Notify[1]: Notification sound file path | **string**
-- @field Notify[2]: Notification volume | **integer**
-- @field Notify[3]: Notification pitch | **integer**
lia.config.WalkSpeed = 130
lia.config.RunSpeed = 235
lia.config.WalkRatio = 0.5
Expand Down
49 changes: 26 additions & 23 deletions skeleton/schema/factions/custom.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
--- Attributes of the custom faction.
-- @faction Custom

--- A list of the current fields in the faction.
-- @realm shared
-- @table FactionInfo
-- @field name The name of the faction | string.
-- @field desc The description of the faction | string.
-- @field color The color representing the faction | Color.
-- @field isDefault Whether the faction is set as default | boolean.
-- @field models The models used by members of the faction | table.
-- @field weapons The weapons available to members of the faction | table.
-- @field pay The payment amount associated with the faction | number.
-- @field payTimer The timer or schedule for payments | number.
-- @field limit The limit of players in this faction at a given time | number.
-- @field oneCharOnly Whether a player can have only one character in the faction | boolean.
-- @field health The default health of players in the faction | number.
-- @field armor The default armor value of players in the faction | number.
-- @field scale The scale affecting the size of the player model | number.
-- @field runSpeed The default running speed of players in the faction | number.
-- @field runSpeedMultiplier Whether to multiply runSpeed by the default speed | boolean.
-- @field walkSpeed The default walking speed of players in the faction | number.
-- @field walkSpeedMultiplier Whether to multiply walkSpeed by the default walk speed | boolean.
-- @field jumpPower The default jump power of players in the faction | number.
-- @field jumpPowerMultiplier Whether to multiply jumpPower by the default jump power | boolean.
-- @field bloodcolor The blood color of players in the faction | number.
-- @field bodyGroups The bodygroups for player models upon spawn | table.
-- @field index The Unique ID of the faction | number.
-- @table FactionDetails
-- @field name The name of the faction | **string**
-- @field desc The description of the faction | **string**
-- @field color The color representing the faction | **Color**
-- @field isDefault Whether the faction is set as default | **boolean**
-- @field models The models used by members of the faction | **table**
-- @field weapons The weapons available to members of the faction | **table**
-- @field pay The payment amount associated with the faction | **number**
-- @field payTimer The timer or schedule for payments | **number**
-- @field limit The limit of players in this faction at a given time | **number**
-- @field oneCharOnly Whether a player can have only one character in the faction | **boolean**
-- @field health The default health of players in the faction | **number**
-- @field armor The default armor value of players in the faction | **number**
-- @field scale The scale affecting the size of the player model | **number**
-- @field runSpeed The default running speed of players in the faction | **number**
-- @field runSpeedMultiplier Whether to multiply runSpeed by the default speed | **boolean**
-- @field walkSpeed The default walking speed of players in the faction | **number**
-- @field walkSpeedMultiplier Whether to multiply walkSpeed by the default walk speed | **boolean**
-- @field jumpPower The default jump power of players in the faction | **number**
-- @field jumpPowerMultiplier Whether to multiply jumpPower by the default jump power | **boolean**
-- @field bloodcolor The blood color of players in the faction | **number**
-- @field bodyGroups The bodygroups for player models upon spawn | **table**
-- @field index The Unique ID of the faction | **number**
FACTION.name = "Custom Faction"
FACTION.desc = "A Custom Faction!"
FACTION.color = Color(255, 56, 252)
Expand Down
47 changes: 25 additions & 22 deletions skeleton/schema/factions/default.lua
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
--- Attributes of the default faction.
-- @faction Default

--- A list of the current fields in the faction.
-- @realm shared
-- @table FactionInfo
-- @field name The name of the faction | string.
-- @field desc The description of the faction | string.
-- @field color The color representing the faction | Color.
-- @field isDefault Whether the faction is set as default | boolean.
-- @field models The models used by members of the faction | table.
-- @field pay The payment amount associated with the faction | number.
-- @field payTimer The timer or schedule for payments | number.
-- @field limit The limit of players in this faction at a given time | number.
-- @field oneCharOnly Whether a player can have only one character in the faction | boolean.
-- @field health The default health of players in the faction | number.
-- @field armor The default armor value of players in the faction | number.
-- @field scale The scale affecting the size of the player model | number.
-- @field runSpeed The default running speed of players in the faction | number.
-- @field runSpeedMultiplier Whether to multiply runSpeed by the default speed | boolean.
-- @field walkSpeed The default walking speed of players in the faction | number.
-- @field walkSpeedMultiplier Whether to multiply walkSpeed by the default walk speed | boolean.
-- @field jumpPower The default jump power of players in the faction | number.
-- @field jumpPowerMultiplier Whether to multiply jumpPower by the default jump power | boolean.
-- @field bloodcolor The blood color of players in the faction | number.
-- @field bodyGroups The bodygroups for player models upon spawn | table.
-- @field index The Unique ID of the faction | number.
-- @table FactionDetails
-- @field name The name of the faction | **string**
-- @field desc The description of the faction | **string**
-- @field color The color representing the faction | **Color**
-- @field isDefault Whether the faction is set as default | **boolean**
-- @field models The models used by members of the faction | **table**
-- @field pay The payment amount associated with the faction | **number**
-- @field payTimer The timer or schedule for payments | **number**
-- @field limit The limit of players in this faction at a given time | **number**
-- @field oneCharOnly Whether a player can have only one character in the faction | **boolean**
-- @field health The default health of players in the faction | **number**
-- @field armor The default armor value of players in the faction | **number**
-- @field scale The scale affecting the size of the player model | **number**
-- @field runSpeed The default running speed of players in the faction | **number**
-- @field runSpeedMultiplier Whether to multiply runSpeed by the default speed | **boolean**
-- @field walkSpeed The default walking speed of players in the faction | **number**
-- @field walkSpeedMultiplier Whether to multiply walkSpeed by the default walk speed | **boolean**
-- @field jumpPower The default jump power of players in the faction | **number**
-- @field jumpPowerMultiplier Whether to multiply jumpPower by the default jump power | **boolean**
-- @field bloodcolor The blood color of players in the faction | **number**
-- @field bodyGroups The bodygroups for player models upon spawn | **table**
-- @field index The Unique ID of the faction | **number**
FACTION.name = "Default"
FACTION.desc = "The Default Faction."
FACTION.color = Color(51, 117, 232)
Expand Down
35 changes: 0 additions & 35 deletions skeleton/schema/items/base/medical.lua

This file was deleted.

7 changes: 0 additions & 7 deletions skeleton/schema/items/medical/bandages.lua

This file was deleted.

7 changes: 0 additions & 7 deletions skeleton/schema/items/medical/medkit.lua

This file was deleted.

52 changes: 31 additions & 21 deletions skeleton/schema/items/universalammo.lua
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
--- Attributes of the ammunition item.


--- Structure of UniversalAmmunition Item.
-- @items UniversalAmmunition

--- This table defines the fields of the universal ammo item.
-- @table UniversalAmmo
-- @realm shared
-- @table ItemInfo
-- @field name The name of the item | string.
-- @field desc The description of the item | string.
-- @field model The model of the item | string.
-- @field width The width of the item in inventory | number.
-- @field height The height of the item in inventory | number.
-- @field health The amount of health the item restores | number.
-- @field ammoAmount The amount of ammunition in the box | number.
-- @field category The category of the item | string.
-- @field allowedWeapons The list of weapons that can use this ammunition | table.
-- @field name The name of the item | **string**
-- @field desc The description of the item | **string**
-- @field model The model of the item | **string**
-- @field width The width of the item in inventory | **number**
-- @field height The height of the item in inventory | **number**
-- @field health The amount of health the item restores | **number**
-- @field ammoAmount The amount of ammunition in the box | **number**
-- @field category The category of the item | **string**
-- @field blacklistedWeapons The list of weapons that can't use this ammunition | **table**
ITEM.name = "Box of Ammunition"
ITEM.desc = "A box that contains sixty bullets.\nUse items with the gun you want loaded out."
ITEM.model = "models/Items/BoxSRounds.mdl"
ITEM.ammoAmount = 60
ITEM.category = "Ammunition"
ITEM.allowedWeapons = {""}
if CLIENT then
function ITEM:paintOver(item, w, h)
draw.SimpleText(item.ammoAmount, "DermaDefault", w, h - 5, color_white, TEXT_ALIGN_RIGHT, TEXT_ALIGN_BOTTOM, 1, color_black)
end
end

ITEM.blacklistedWeapons = {""}
ITEM.functions.use = {
name = "Load",
tip = "useTip",
Expand All @@ -30,7 +29,12 @@ ITEM.functions.use = {
local client = item.player
local weapon = client:GetActiveWeapon()
if not IsValid(weapon) then return false end
if not table.hasvalue(item.allowedWeapons, weapon:GetClass()) then
if not IsValid(item.entity) then
client:notify("This item needs to be at the ground!")
return false
end

if table.hasvalue(item.allowedWeapons, weapon:GetClass()) then
client:PrintMessage(HUD_PRINTTALK, "This weapon may not be resupplied.")
client:EmitSound("Player.DenyWeaponSelection")
return false
Expand All @@ -45,6 +49,12 @@ ITEM.functions.use = {
local client = item.player
local weapon = client:GetActiveWeapon()
if not IsValid(weapon) then return false end
return not IsValid(item.entity)
return true
end
}

if CLIENT then
function ITEM:paintOver(item, w, h)
draw.SimpleText(item.ammoAmount, "DermaDefault", w, h - 5, color_white, TEXT_ALIGN_RIGHT, TEXT_ALIGN_BOTTOM, 1, color_black)
end
}
end
7 changes: 4 additions & 3 deletions skeleton/schema/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
This is meant to define the Schema's default information.
]]
-- @configurations Schema

--- A list of schema fields that define the gamemode you are making.
-- These options are defined by the 'SCHEMA' table.
-- @realm shared
-- @table SchemaInfo
-- @field name Controls the name of the schema | string.
-- @field author Specifies the author of the schema | string.
-- @field desc Defines the description of the schema | string.
-- @field name Controls the name of the schema | **string**
-- @field author Specifies the author of the schema | **string**
-- @field desc Defines the description of the schema | **string**
SCHEMA.name = "Sample Schema Name"
SCHEMA.author = "Sample Schema Author"
SCHEMA.desc = "Sample Schema Description"

0 comments on commit e1f0aed

Please sign in to comment.