i've been running a stripped down version of just the bats on my server but been having server crash problems.
i prefer the more natural way your bats fly and attack vs the simple mobs api but i have also converted your ape and minotaur models to run on simple mobs api to better control spawn location and population. awesome models love their animation!
i compile and run dev version of server so that maybe that is issue i'm also running your newest code. i have also added drop on death to the mob.lua that seems to work fine and have also omitted the code line 162
minetest.chat_send_all("dir:" .. minetest.pos_to_string(direction))
here is crash info
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
2015-07-06 01:46:06: ERROR[main]: UNRECOVERABLE error occurred. Stopping server. Please fix the following error:
2015-07-06 01:46:06: ERROR[main]: C:\minetest\bin\..\games\twt\mods\defense/pathfinder.lua:274: attempt to index local 'node' (a nil value)
2015-07-06 01:46:06: ERROR[main]: stack traceback:
2015-07-06 01:46:06: ERROR[main]: C:\minetest\bin\..\games\twt\mods\defense/pathfinder.lua:274: in function 'cost_method'
2015-07-06 01:46:06: ERROR[main]: C:\minetest\bin\..\games\twt\mods\defense/pathfinder.lua:196: in function 'update'
2015-07-06 01:46:06: ERROR[main]: C:\minetest\bin\..\games\twt\mods\defense/pathfinder.lua:284: in function <C:\minetest\bin\..\games\twt\mods\defense/pathfinder.lua:283>
2015-07-06 01:46:06: ERROR[main]: C:\minetest\bin\..\builtin\game\register.lua:341: in function <C:\minetest\bin\..\builtin\game\register.lua:329>
In thread 668:
/cygdrive/d/DEV/minetest/minetest/src/server.cpp:505: step: A fatal error occurred: C:\minetest\bin\..\games\twt\mods\defense/pathfinder.lua:274: attempt to index local 'node' (a nil value)
stack traceback:
C:\minetest\bin\..\games\twt\mods\defense/pathfinder.lua:274: in function 'cost_method'
C:\minetest\bin\..\games\twt\mods\defense/pathfinder.lua:196: in function 'update'
C:\minetest\bin\..\games\twt\mods\defense/pathfinder.lua:284: in function <C:\minetest\bin\..\games\twt\mods\defense/pathfinder.lua:283>
C:\minetest\bin\..\builtin\game\register.lua:341: in function <C:\minetest\bin\..\builtin\game\register.lua:329>
Debug stacks:
DEBUG STACK FOR THREAD 394:
#0 Thread
DEBUG STACK FOR THREAD 48c:
#0 Thread
#1 Receive
(Leftover data: #2 SendBlocks)
(Leftover data: #3 GetNextBlocks)
(Leftover data: #4 serialize)
(Leftover data: #5 loadBlock)
DEBUG STACK FOR THREAD 668:
#0 main
#1 Dedicated server branch
#2 dedicated_server_loop
#3 step
DEBUG STACK FOR THREAD 970:
#0 Thread
(Leftover data: #1 loadBlock)
(Leftover data: #2 loadBlock)
(Leftover data: #3 deSerialize)
DEBUG STACK FOR THREAD bd4:
#0 Thread
(Leftover data: #1 loadBlock)
(Leftover data: #2 loadBlock)
(Leftover data: #3 deSerialize)
bravo on your work, again i love the way the bats fly and hunt. a feature i'd like to see is bat avoiding water or at least taking water damage.
lastly can you explain the code used to spawn and which variables can be modified to reduce number of mobs
defense.director = {}
local director = defense.director
director.call_interval = 1.0
director.intensity_decay = 0.93
director.max_entities = 50
director.spawn_list = {
{
description = "Unggoy group",
name = "defense:unggoy",
intensity_min = 0.0,
intensity_max = 0.6,
group_min = 1,
group_max = 4,
probability = 0.4,
day_start = 0,
spawn_time = 14.0,
spawn_location = "ground",
},