summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-08-24 18:08:43 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2017-08-24 18:08:43 -0400
commitcda70b47f13623d086188f686c005a017ccc5b25 (patch)
treeb3ecc32afbc1f96097ffac57279569b3cc31d7dd
parentd370c6c0f7d9249065bcdb9b2c7b80c3fe6470a6 (diff)
downloadartery_editor-cda70b47f13623d086188f686c005a017ccc5b25.tar.gz
artery_editor-cda70b47f13623d086188f686c005a017ccc5b25.tar.bz2
artery_editor-cda70b47f13623d086188f686c005a017ccc5b25.zip
Vairious updates
-rw-r--r--lua/autorun/town.lua8
-rw-r--r--lua/autorun/zone_huntingground.lua3
-rw-r--r--lua/entities/info_edit_huntablespawn/cl_init.lua (renamed from lua/entities/info_huntablespawn/cl_init.lua)0
-rw-r--r--lua/entities/info_edit_huntablespawn/init.lua41
-rw-r--r--lua/entities/info_edit_huntablespawn/shared.lua (renamed from lua/entities/info_huntablespawn/shared.lua)0
-rw-r--r--lua/entities/info_huntablespawn/init.lua18
6 files changed, 51 insertions, 19 deletions
diff --git a/lua/autorun/town.lua b/lua/autorun/town.lua
index 40131df..0d36f41 100644
--- a/lua/autorun/town.lua
+++ b/lua/autorun/town.lua
@@ -80,6 +80,14 @@ local fakes = {
GetItemByName = function(string)
return {}
end
+ },
+ ["sv_huntingspawner.lua"] = {
+ CreateSpawnNode = function(tbl)
+ local pos = tbl.Position
+ local e = ents.Create("info_edit_huntablespawn")
+ e:SetPos(pos)
+ e:Spawn()
+ end
}
}
fakes["core/npc/sv_npcsystem.lua"] = fakes["sv_npcsystem.lua"]
diff --git a/lua/autorun/zone_huntingground.lua b/lua/autorun/zone_huntingground.lua
index 57847ca..b2b76e0 100644
--- a/lua/autorun/zone_huntingground.lua
+++ b/lua/autorun/zone_huntingground.lua
@@ -77,7 +77,7 @@ hook.Add("ShowZoneOptions","artery_huntingground",function(zone,class,DPanel,zon
monsterlb:SizeToContents()
local freqlb = vgui.Create("DLabel",headerbar)
freqlb:Dock(RIGHT)
- freqlb:SetText("Spawn frequency (0-100) : Health")
+ freqlb:SetText("Health : Spawn frequency (0-100)")
freqlb:SetDark(true)
freqlb:SizeToContents()
@@ -114,6 +114,7 @@ hook.Add("ShowZoneOptions","artery_huntingground",function(zone,class,DPanel,zon
local monstertype = vgui.Create("DComboBox",thisbar)
monstertype:Dock(LEFT)
+ if not monsters then find_monsters() end
for i,j in pairs(monsters) do
monstertype:AddChoice(j)
end
diff --git a/lua/entities/info_huntablespawn/cl_init.lua b/lua/entities/info_edit_huntablespawn/cl_init.lua
index 6a96b80..6a96b80 100644
--- a/lua/entities/info_huntablespawn/cl_init.lua
+++ b/lua/entities/info_edit_huntablespawn/cl_init.lua
diff --git a/lua/entities/info_edit_huntablespawn/init.lua b/lua/entities/info_edit_huntablespawn/init.lua
new file mode 100644
index 0000000..777355f
--- /dev/null
+++ b/lua/entities/info_edit_huntablespawn/init.lua
@@ -0,0 +1,41 @@
+if engine.ActiveGamemode() ~= "sandbox" then return end
+
+--[[
+ This entity gives townies things to do
+]]
+AddCSLuaFile( "cl_init.lua" )
+AddCSLuaFile( "shared.lua" )
+
+include("shared.lua")
+
+function ENT:Initialize()
+ self:SetModel("models/props_junk/watermelon01.mdl")
+ self:PhysicsInit( SOLID_VPHYSICS ) -- Make us work with physics,
+ self:SetMoveType( MOVETYPE_VPHYSICS ) -- after all, gmod is a physics
+ self:SetSolid( SOLID_VPHYSICS ) -- Toolbox
+ --self:SetNoDraw(true)
+ --self:SetPos(self.Position)
+end
+
+local function save_huntable_spawns()
+ local all = ents.FindByClass("info_huntablespawn")
+ local buf = [[local h = nrequire("sv_huntingspawner.lua")
+
+]]
+ local codetemplate = "h.CreateSpawnNode({Position = Vector(%d,%d,%d)})"
+ for k,v in pairs(all) do
+ local p = v:GetPos()
+ all[k] = string.format(codetemplate,p.x,p.y,p.z)
+ end
+ buf = buf .. table.concat(all,"\n")
+ local filepath = string.format("artery/maps/%s/huntable_nodes.txt",game.GetMap())
+ print("Writeing file",filepath)
+ file.Write(filepath,buf)
+end
+
+hook.Add("ShutDown","art_save_huntablespawns",function()
+ save_huntable_spawns()
+end)
+concommand.Add("artery_save_huntable_spawns",function(ply,cmd,args)
+ save_huntable_spawns()
+end)
diff --git a/lua/entities/info_huntablespawn/shared.lua b/lua/entities/info_edit_huntablespawn/shared.lua
index 09c731f..09c731f 100644
--- a/lua/entities/info_huntablespawn/shared.lua
+++ b/lua/entities/info_edit_huntablespawn/shared.lua
diff --git a/lua/entities/info_huntablespawn/init.lua b/lua/entities/info_huntablespawn/init.lua
deleted file mode 100644
index c4a0934..0000000
--- a/lua/entities/info_huntablespawn/init.lua
+++ /dev/null
@@ -1,18 +0,0 @@
-if engine.ActiveGamemode() ~= "sandbox" then return end
-
---[[
- This entity gives townies things to do
-]]
-AddCSLuaFile( "cl_init.lua" )
-AddCSLuaFile( "shared.lua" )
-
-include("shared.lua")
-
-function ENT:Initialize()
- self:SetModel("models/Combine_Helicopter/helicopter_bomb01.mdl")
- self:SetMoveType(MOVETYPE_NONE)
- self:SetSolid(SOLID_NONE)
- self:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE)
- --self:SetNoDraw(true)
- --self:SetPos(self.Position)
-end