aboutsummaryrefslogtreecommitdiff
path: root/gamemode/config/sv_newplayer.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/config/sv_newplayer.lua')
-rw-r--r--gamemode/config/sv_newplayer.lua31
1 files changed, 26 insertions, 5 deletions
diff --git a/gamemode/config/sv_newplayer.lua b/gamemode/config/sv_newplayer.lua
index 229c11e..403e933 100644
--- a/gamemode/config/sv_newplayer.lua
+++ b/gamemode/config/sv_newplayer.lua
@@ -1,29 +1,50 @@
+--- Holds the data new players should be spawned with.
+-- If new inventories central to the gamemode are added,
+-- players should probably spawn with them. Add the
+-- inventory to np.data.
+--@server sv_newplayer.lua
+--@alias np
+
local np = {}
local inv = nrequire("inventory/inventory.lua")
nrequire("inventorysystem/equipment/sh_equipment.lua")
nrequire("inventorysystem/shapedinventory/sh_shaped.lua")
-nrequire("inventorysystem/prayers/sh_prayers.lua")
+nrequire("inventorysystem/abilities/sh_abilities.lua")
nrequire("inventorysystem/skills/sh_skills.lua")
nrequire("inventorysystem/quests/sh_quests.lua")
local log = nrequire("log.lua")
--local itm = nrequire("inventory/item.lua")
-local data = {
+--- The data that players spawn with.
+-- @table data
+-- @field inventories
+-- @usage
+-- local np = nrequire("config/sv_newplayer.lua")
+-- local inv = nrequire("inventory/inventory.lua")
+-- local invtbl = np.data.inventories
+-- invtbl[#invtbl + 1] = {"My New Inventory",inv.CreateInventory("MyInventory"):Serialize()}
+np.data = {
inventories = {
{"Equipment", inv.CreateInventory("Equipment"):Serialize()},
{"Shaped Inventory",inv.CreateInventory("Shaped Inventory"):Serialize()},
- {"Prayers",inv.CreateInventory("Prayers"):Serialize()},
+ {"Abilities",inv.CreateInventory("Abilities"):Serialize()},
{"Skills",inv.CreateInventory("Skills"):Serialize()},
{"Quests",inv.CreateInventory("Quests"):Serialize()},
},
}
+--- Function called with a new player needs default data.
+-- By default, this function just returns np.data
+-- You can overwrite it to return any other table though.
+-- @treturn table The new data to return
np.newdata = function()
log.debug("newdata asked for")
- log.debug(table.ToString(data,"data",true))
- return data
+ log.debug(table.ToString(np.data,"data",true))
+ return np.data
end
+--- Function to return metadata for a player.
+-- This just returns a server and location for the player to spawn.
np.newmeta = function()
log.debug("newmeta asked for")
return {