clarksallador wrote:i have the latest update .. but still cannot kill a mob
your problem sounds for me familiar. Go to post 936.
clarksallador wrote:i have the latest update .. but still cannot kill a mob
deivan wrote:Is a very nice idea to a mod, have your code in some place to download Jonathan?
trader_inventory = {
goods = {
{ "mob_archer:archer 1","default:tree 4",nil},
{ "mob_guard:guard 1","default:tree 4",nil},
},
random_names = {"Honest Hank","Hungry Hungry Hans","Flip Flop Franz","Tough Tom","Frantic Fritz","Timid Thomas","Marvelous Martin","Furry Frank","Bobblehead Bobby","Sticky Stinky Steve"},
}
} --TODO call punch instead of manually setting health for player too
if target:is_player() then
local target_health = target:get_hp()
--do damage
target:set_hp(target_health -damage_done)
else
--Jonathan added
local target_health = target:get_hp()
target:set_hp(target_health -damage_done)
if target:get_hp() <= 0 then
target:remove()
end
--Jonathan commented out
-- target:punch(entity.object, 1.0, {
-- full_punch_interval=1.0,
-- groupcaps={
-- fleshy={times={ [1]=1/(damage_done-2),
-- [2]=1/(damage_done-1),
-- [3]=1/damage_done}},
-- snappy={times={ [1]=1/(damage_done-2),
-- [2]=1/(damage_done-1),
-- [3]=1/damage_done}},
-- }
-- }, nil)
endy=mob_pos.y+dir.y, if self.timer>0.2 then
--Jonathan changed radius area from 2 to 1.
local objs = minetest.env:get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil and
obj ~= self.owner then
if obj:get_luaentity().name ~= "mobf:arrow_entity" and
obj:get_luaentity().name ~= "__builtin:item" then
--Jonathan added
local target_health = obj:get_hp()
obj:set_hp(target_health -self.damage)
if obj:get_hp() <= 0 then
obj:remove()
end
--Jonathan commented out
-- obj:punch(self.object, 1.0, {
-- full_punch_interval=1.0,
-- groupcaps={
-- fleshy={times={ [1]=1/(self.damage-2),
-- [2]=1/(self.damage-1),
-- [3]=1/self.damage}},
-- snappy={times={ [1]=1/(self.damage-2),
-- [2]=1/(self.damage-1),
-- [3]=1/self.damage}},
-- }
-- }, nil)
self.object:remove()
end
else
--Jonathan added
local target_health = obj:get_hp()
obj:set_hp(target_health -self.damage)
if obj:get_hp() <= 0 then
obj:remove()
end
--Jonathan commented out
--punch a player
-- obj:punch(self.object, 1.0, {
-- full_punch_interval=1.0,
-- groupcaps={
-- fleshy={times={ [1]=1/(self.damage-2),
-- [2]=1/(self.damage-1),
-- [3]=1/self.damage}},
-- snappy={times={ [1]=1/(self.damage-2),
-- [2]=1/(self.damage-1),
-- [3]=1/self.damage}},
-- }
-- }, nil)
self.object:remove()
end
end
enddeivan wrote:Nice. I will test it ASAP. :D
-*-
I don't found the "mob_archer:archer" or the other one in my sources, have another version fo this mod?
sapier wrote:Prerelease Download
Primary : Version 2.0.82 - finding a way out
local objs = minetest.env:get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)local objs = minetest.env:get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1)windmere33 wrote:Whenever I spawn vombies, or just see them, they are never on fire...is it disabled by default?
15:38:42: ERROR[main]: ServerEnvironment::deactivateFarObjects(): id=9 m_static_exists=true but static data doesn't actually exist in (46,1,-58)
WARNING: StaticObjectList::remove(): id=9 not found
15:38:42: ERROR[main]: ServerEnvironment::deactivateFarObjects(): id=11 m_static_exists=true but static data doesn't actually exist in (45,1,-56)
WARNING: StaticObjectList::remove(): id=11 not found
15:38:42: ERROR[main]: ServerEnvironment::deactivateFarObjects(): id=12 m_static_exists=true but static data doesn't actually exist in (45,1,-56)
WARNING: StaticObjectList::remove(): id=12 not found
15:38:42: ERROR[main]: ServerEnvironment::deactivateFarObjects(): id=17 m_static_exists=true but static data doesn't actually exist in (44,1,-57)
WARNING: StaticObjectList::remove(): id=17 not found
15:38:42: ERROR[main]: ServerEnvironment::deactivateFarObjects(): id=33 m_static_exists=true but static data doesn't actually exist in (46,1,-58)
WARNING: StaticObjectList::remove(): id=33 not found
15:38:42: ERROR[main]: ServerEnvironment::deactivateFarObjects(): id=82 m_static_exists=true but static data doesn't actually exist in (52,-1,-53)
WARNING: StaticObjectList::remove(): id=82 not found
15:38:43: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error running function 'on_step': ...est/.minetest/mods/minetest/animals/mobf/weapons.lua:52: bad argu
ment #1 to 'punch' (userdata expected, got nil)
15:38:43: ERROR[main]: stack traceback:
In thread b6d92700:
/build/buildd/minetestc55-0.4.6/src/main.cpp:1967: int main(int, char**): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD b6d92700:
#0 int main(int, char**)
(Leftover data: #1 Dedicated server branch)
(Leftover data: #2 virtual void ServerMap::save(ModifiedState))
(Leftover data: #3 virtual void ServerMap::saveBlock(MapBlock*))
(Leftover data: #4 void ItemStack::serialize(std::ostream&) const)
Users browsing this forum: No registered users and 23 guests