From 4adec24c3a2a53f518d817ae8a6ddd0c4c47422c Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Wed, 25 May 2016 22:06:26 -0400 Subject: more work on the structure system --- .../structures/aaaStructureExample.lua | 22 +++++++++++++++ .../structuresystem/structures/stonefurnace.lua | 31 ++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 gamemode/structuresystem/structures/aaaStructureExample.lua create mode 100644 gamemode/structuresystem/structures/stonefurnace.lua (limited to 'gamemode/structuresystem/structures') diff --git a/gamemode/structuresystem/structures/aaaStructureExample.lua b/gamemode/structuresystem/structures/aaaStructureExample.lua new file mode 100644 index 0000000..abe91ba --- /dev/null +++ b/gamemode/structuresystem/structures/aaaStructureExample.lua @@ -0,0 +1,22 @@ +--This file is to help developers add new structures to the game! + +STRUCT = {} + +--A name for this structure, each type of structure must have a different name +STRUCT.Name = "Example Structure" + +--The model for this structure. +STRUCT.Model = "models/props/de_inferno/ClayOven.mdl" + +--The initalize method. Called on both the server and the client +STRUCT.onInitialize = function(self) + print("Initalize called!") +end + +--If this structure is not like every other structures of the same name (for example, if it has an internal inventory) +STRUCT.uniquedata = false + +--Called when a player presses e on this structure, called on both the server and the client. Keep in mind that on the client side, ply may not be the local player! +STRUCT.onUse = function(self,ply) + print("onUse called!") +end diff --git a/gamemode/structuresystem/structures/stonefurnace.lua b/gamemode/structuresystem/structures/stonefurnace.lua new file mode 100644 index 0000000..84c0311 --- /dev/null +++ b/gamemode/structuresystem/structures/stonefurnace.lua @@ -0,0 +1,31 @@ +local STRUCT = {} + +STRUCT.Name = "Stone Furnace" +STRUCT.Model = "models/props/de_inferno/ClayOven.mdl" + +STRUCT.Structure = { + {"models/props/de_inferno/ClayOven.mdl",Vector(0,0,0),Angle(0,0,0)} +} + +STRUCT.onInitialize = function(self) + print("Initalize called!") +end + +STRUCT.uniquedata = false + +STRUCT.onUse = function(self, ply) + print("I am the old use function!") +end + +STRUCT.Recipes = {} + +STRUCT.timemult = 0.5 +STRUCT.skillease = 0.25 + +genericMakeFurnace(STRUCT) +recipieForSmelt(STRUCT.Recipes,"Copper", "Smelt copper ore into copper", "Copper Ore", "Copper", {1,1}, {1,5,10}) + +print("stone furnace's recipies:") +PrintTable(STRUCT.Recipes) + +registerStructure(STRUCT) -- cgit v1.2.3-70-g09d2