forked from mtcontrib/mobs_redo
tweaked pathfinding with 2 modes, 1 to find, 2 to build/break
This commit is contained in:
parent
e4a919da02
commit
c6d4b95768
4
api.lua
4
api.lua
|
@ -14,7 +14,6 @@ local remove_far = minetest.setting_getbool("remove_far_mobs")
|
||||||
|
|
||||||
-- pathfinding settings
|
-- pathfinding settings
|
||||||
local enable_pathfinding = true
|
local enable_pathfinding = true
|
||||||
local enable_pathfind_digging = false
|
|
||||||
local stuck_timeout = 3 -- how long before mob gets stuck in place and starts searching
|
local stuck_timeout = 3 -- how long before mob gets stuck in place and starts searching
|
||||||
local stuck_path_timeout = 10 -- how long will mob follow path before giving up
|
local stuck_path_timeout = 10 -- how long will mob follow path before giving up
|
||||||
|
|
||||||
|
@ -811,10 +810,9 @@ function smart_mobs(self, s, p, dist, dtime)
|
||||||
if not self.path.way then
|
if not self.path.way then
|
||||||
|
|
||||||
self.path.following = false
|
self.path.following = false
|
||||||
-- self.path.stuck = true
|
|
||||||
|
|
||||||
-- lets make way by digging/building if not accessible
|
-- lets make way by digging/building if not accessible
|
||||||
if enable_pathfind_digging then
|
if self.pathfinding == 2 then
|
||||||
|
|
||||||
-- add block and remove one block above so
|
-- add block and remove one block above so
|
||||||
-- there is room to jump if needed
|
-- there is room to jump if needed
|
||||||
|
|
2
api.txt
2
api.txt
|
@ -73,7 +73,7 @@ This functions registers a new mob as a Minetest entity.
|
||||||
'on_die' a function that is called when the mob is killed the parameters are (self, pos)
|
'on_die' a function that is called when the mob is killed the parameters are (self, pos)
|
||||||
'floats' 1 to float in water, 0 to sink
|
'floats' 1 to float in water, 0 to sink
|
||||||
'on_rightclick' its same as in minetest.register_entity()
|
'on_rightclick' its same as in minetest.register_entity()
|
||||||
'pathfinding' when true mobs will use pathfinder feature to locate player (only works with dogfight attack)
|
'pathfinding' set to 1 for mobs to use pathfinder feature to locate player, set to 2 so they can build/break also (only works with dogfight attack)
|
||||||
'attack_type' the attack type of a monster
|
'attack_type' the attack type of a monster
|
||||||
'dogfight' follows player in range and attacks when in reach
|
'dogfight' follows player in range and attacks when in reach
|
||||||
'shoot' shoots defined arrows when player is within range
|
'shoot' shoots defined arrows when player is within range
|
||||||
|
|
Loading…
Reference in New Issue
Block a user