Added NPC base

master
E. Almqvist 5 years ago
parent dda29f599f
commit 4853798226
  1. 19
      entities/entities/q_npc/init.lua
  2. 6
      gamemode/engine/lib/sh_node.lua
  3. 4
      gamemode/engine/vars/sh_vars.lua
  4. 3
      gamemode/engine/vars/sv_vars.lua
  5. 9
      gamemode/settings/sh_nodes.lua
  6. 6
      gamemode/settings/sv_nodes_locations.lua

@ -11,16 +11,15 @@ AddCSLuaFile( "shared.lua" )
include( "shared.lua" ) include( "shared.lua" )
function ENT:Initialize() function ENT:Initialize()
-- just the usual npc stuff
self:PhysicsInit( SOLID_BSP ) self:SetModel( "models/kleiner.mdl" )
self:SetMoveType( MOVETYPE_VPHYSICS ) self:SetHullType( HULL_HUMAN )
self:SetSolid( SOLID_VPHYSICS ) self:SetHullSizeNormal()
self:SetCollisionGroup( COLLISION_GROUP_NONE )
self:SetModel("models/kleiner.mdl") -- mingebad model :)
local physObj = self:GetPhysicsObject() self:SetNPCState( NPC_STATE_IDLE )
if( IsValid( physObj ) ) then self:SetSolid( SOLID_BBOX )
physObj:EnableMotion( false ) self:CapabilitiesAdd( CAP_ANIMATEDFACE + CAP_TURN_HEAD )
end self:SetUseType( SIMPLE_USE )
self:DropToFloor()
end end

@ -16,14 +16,14 @@ end
function Quantum.Node.Create( nodeid, tbl ) function Quantum.Node.Create( nodeid, tbl )
local node = { local node = {
name = tbl.name || "Unknown Node", name = tbl.name || "Unknown Node",
model = tbl.model, model = tbl.model || "error", -- will create the infamous error model
type = tbl.type || Quantum.NodeType.resource, type = tbl.type || Quantum.NodeType.resource,
toolids = tbl.toolids || {}, -- if it's empty then you can use all sweps/tools toolids = tbl.toolids || {}, -- if it's empty then you can use all sweps/tools
canGather = tbl.canGather || false, canGather = tbl.canGather || false,
give = tbl.give || {}, give = tbl.give || {},
giveprobability = tbl.giveprobability || 1, giveprobability = tbl.giveprobability || 1,
health = tbl.health || Quantum.Server.DefaultNodeHealth, health = tbl.health || Quantum.DefaultNodeHealth,
respawn = tbl.respawn || Quantum.Server.DefaultNodeRespawnTimer respawn = tbl.respawn || Quantum.DefaultNodeRespawnTimer
} }
node.id = nodeid node.id = nodeid

@ -64,6 +64,10 @@ Quantum.NodeType = {
npc = "q_npc" npc = "q_npc"
} }
Quantum.DefaultNodeHealth = 10
Quantum.DefaultNodeRespawnTimer = 30
---- Property vars ---- ---- Property vars ----
Quantum.DoorSounds = { Quantum.DoorSounds = {

@ -5,6 +5,3 @@
-- \ \ / ____ \| | | | | | | | __/ (__| | | | / / -- \ \ / ____ \| | | | | | | | __/ (__| | | | / /
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
Quantum.Server.DefaultNodeHealth = 10
Quantum.Server.DefaultNodeRespawnTimer = 30

@ -5,6 +5,15 @@
-- \ \ / ____ \| | | | | | | | __/ (__| | | | / / -- \ \ / ____ \| | | | | | | | __/ (__| | | | / /
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
-- NPC Nodes --
Quantum.Node.Create( "generalvendor", {
type = Quantum.NodeType.NPC,
canGather = false,
name = "General Goods Vendor",
model = "models/kleiner.mdl",
} )
-- Resource Nodes --
local miningTools = { "tool_pickaxe" } local miningTools = { "tool_pickaxe" }
Quantum.Node.Create( "stone", { Quantum.Node.Create( "stone", {

@ -5,6 +5,8 @@
-- \ \ / ____ \| | | | | | | | __/ (__| | | | / / -- \ \ / ____ \| | | | | | | | __/ (__| | | | / /
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
Quantum.Node.Register( "stone", Vector( 14877.728515625, -916.02612304688, 768 ), Angle( 0, -139.03350830078, 0 ) ) -- NPC nodes --
Quantum.Node.Register( "generalvendor", Vector( 12737.1484375, -12749.354492188, -287 ), Angle( 0, 90, 0 ) )
-- Resource nodes --
Quantum.Node.Register( "stone", Vector( 14877.728515625, -916.02612304688, 768 ), Angle( 0, -139.03350830078, 0 ) )
Loading…
Cancel
Save