78 lines
1.9 KiB
Lua
Executable File
78 lines
1.9 KiB
Lua
Executable File
-- This mod provides NPCs using the mobs_redo api
|
|
|
|
local modname = minetest.get_current_modname()
|
|
local modpath = minetest.get_modpath(modname)
|
|
|
|
|
|
-- Load support for translations.
|
|
local S = minetest.get_translator('mobs')
|
|
mobs.translator = S
|
|
|
|
-- Define log level
|
|
mobs.vlog = "info"
|
|
|
|
-- Load support for documentation
|
|
mobs.textstrings = {}
|
|
mobs.textstrings.longdesc = {}
|
|
mobs.textstrings.usagehelp = {}
|
|
|
|
-- General functions, items, nodes
|
|
--dofile(modpath .. "/mobs_textstrings.lua")
|
|
dofile(modpath .. "/mobs_api.lua")
|
|
dofile(modpath .. "/mobs_definitions.lua")
|
|
--dofile(modpath .. "/mobs_craftitems.lua")
|
|
|
|
--
|
|
-- NPCs
|
|
--
|
|
|
|
dofile(modpath .. "/npc_lambda.lua")
|
|
dofile(modpath .. "/npc_custom.lua")
|
|
|
|
|
|
--
|
|
-- Mods Compatibility
|
|
--
|
|
|
|
--dofile(modpath .. "/lucky_block.lua")
|
|
|
|
--
|
|
-- Notification
|
|
--
|
|
|
|
|
|
--
|
|
-- Map generation (for spawner)
|
|
--
|
|
|
|
--dofile(modpath .. "/mobs_mapgen.lua")
|
|
|
|
--
|
|
-- WIP: Make Ncps spawn around beds, or not-owned beds, or maybe use a mod register a mobs_bed instead of using the default...
|
|
-- -- The point is that if you build a village with beds in houses, there will be some npcs there.
|
|
|
|
--minetest.register_abm({
|
|
-- label = "Bed npc spawning",
|
|
-- nodenames = {"default:bed"},
|
|
-- -- neighbors = {"default:water_source", "default:water_flowing"},
|
|
-- interval = 150, -- Operation interval in seconds
|
|
-- chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this
|
|
-- -- catch_up = true, -- If true, catch-up behaviour is enabled --[[
|
|
-- --~ ^ The chance value is temporarily reduced when returning to
|
|
-- --~ an area to simulate time lost by the area being unattended.
|
|
-- --~ ^ Note chance value can often be reduced to 1 ]]
|
|
-- action = function(pos, node, active_object_count, active_object_count_wider)
|
|
-- local meta = minetest.get_meta(pos)
|
|
-- local spawn = meta:get_string("spawn")
|
|
-- --if not spawn then return end
|
|
-- --spawn_pos = math.random()
|
|
-- end,
|
|
--})
|
|
|
|
|
|
--
|
|
-- Notification
|
|
--
|
|
|
|
print ("[MOD] Mobs Redo 'mobs_npc' loaded")
|