From 5524ce849b74c6a19af4542c17e38463988a3604 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Thu, 25 Jan 2024 19:42:20 +0100 Subject: [PATCH] moved initial properties of npc to initial_properties --- talking_npc.lua | 60 +++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/talking_npc.lua b/talking_npc.lua index 0b82bcd..87dd1c9 100644 --- a/talking_npc.lua +++ b/talking_npc.lua @@ -26,38 +26,40 @@ end npc_talk.talking_npc_entity_prototype = { - -- so far, this is more or less the redefinition of the standard player model - physical = true, - collisionbox = {-0.30, 0.0,-0.30, 0.30,1.8,0.30}, - visual = "mesh"; - visual_size = {x=1, y=1, z=1}, - mesh = npc_talk.talking_npc_mesh, - textures = {npc_talk.talking_npc_texture}, - inventory_image = npc_talk.talking_npc_inventory_image, + initial_properties = { + -- so far, this is more or less the redefinition of the standard player model + physical = true, + collisionbox = {-0.30, 0.0,-0.30, 0.30,1.8,0.30}, + visual = "mesh"; + visual_size = {x=1, y=1, z=1}, + mesh = npc_talk.talking_npc_mesh, + textures = {npc_talk.talking_npc_texture}, + inventory_image = npc_talk.talking_npc_inventory_image, - description = 'Talking NPC (right-click to talk)', - -- the NPC needs an owner - owner = "", + description = 'Talking NPC (right-click to talk)', + -- the NPC needs an owner + owner = "", - armor_groups = {immortal=1}, - hp_max = 100, -- just to be sure + armor_groups = {immortal=1}, + hp_max = 100, -- just to be sure - -- this mob only has to stand around and talk to players - animation = { - stand_START = 0, - stand_END = 79, - sit_START = 81, - sit_END = 160, - sleep_START = 162, - sleep_END = 166, - walk_START = 168, - walk_END = 187, - mine_START = 189, - mine_END = 198, - walkmine_START = 200, - walkmine_END = 219, - }, - animation_speed = 30, + -- this mob only has to stand around and talk to players + animation = { + stand_START = 0, + stand_END = 79, + sit_START = 81, + sit_END = 160, + sleep_START = 162, + sleep_END = 166, + walk_START = 168, + walk_END = 187, + mine_START = 189, + mine_END = 198, + walkmine_START = 200, + walkmine_END = 219, + }, + animation_speed = 30, + }, -- end of initial_properties get_staticdata = function(self) return npc_talk.talking_npc_get_staticdata(self)