[Game] MineClone 2 [0.55.0]

Jacques
New member
 
Posts: 1
Joined: Mon Jun 03, 2019 05:52

Re: [Game] MineClone 2 [0.55.0]

by Jacques » Wed Oct 30, 2019 07:53

I noticed that mobs surrounded by solid blocks are jumping over and over and eventually die because they get stuck in solid walls, especially chickens. I think this check in ENTITIES\mcl_mobs\api.lua is not working:
Code: Select all
   -- this is used to detect if there's a block on top of the block in front of the mob.
   -- If there is, there is no point in jumping as we won't manage.
   local nodTop = node_ok({
      x = pos.x + dir_x,
      y = pos.y + 1.5,
      z = pos.z + dir_z
   }, "air")

   -- we don't attempt to jump if there's a stack of blocks blocking
   if minetest.registered_nodes[nodTop.name] == true then
      return false
   end

and I tested the following changes in my local game
Code: Select all
   -- this is used to detect if there's a block on top of the block in front of the mob.
   -- If there is, there is no point in jumping as we won't manage.
   local nodTop = node_ok({
      x = pos.x + dir_x,
      y = pos.y + 1.5,
      z = pos.z + dir_z
   })

   -- we don't attempt to jump if there's a stack of blocks blocking
   if minetest.registered_nodes[nodTop.name].walkable == true then
      return false
   end


I think that my modification prevents horses to jump 2 blocks high by themselves but I verified that mounted horses are still able to.

Have you noticed similar behaviors with your animals?
 

Midnight Sapphire
New member
 
Posts: 3
Joined: Sun Jun 30, 2019 23:06
 

excavenger
New member
 
Posts: 4
Joined: Thu Sep 26, 2019 08:59

Re: [Game] MineClone 2 [0.55.0]

by excavenger » Tue Nov 05, 2019 17:02

Jacques wrote:I noticed that mobs surrounded by solid blocks are jumping over and over and eventually die because they get stuck in solid walls, especially chickens. I think this check in ENTITIES\mcl_mobs\api.lua is not working:
Code: Select all
   -- this is used to detect if there's a block on top of the block in front of the mob.
   -- If there is, there is no point in jumping as we won't manage.
   local nodTop = node_ok({
      x = pos.x + dir_x,
      y = pos.y + 1.5,
      z = pos.z + dir_z
   }, "air")

   -- we don't attempt to jump if there's a stack of blocks blocking
   if minetest.registered_nodes[nodTop.name] == true then
      return false
   end

and I tested the following changes in my local game
Code: Select all
   -- this is used to detect if there's a block on top of the block in front of the mob.
   -- If there is, there is no point in jumping as we won't manage.
   local nodTop = node_ok({
      x = pos.x + dir_x,
      y = pos.y + 1.5,
      z = pos.z + dir_z
   })

   -- we don't attempt to jump if there's a stack of blocks blocking
   if minetest.registered_nodes[nodTop.name].walkable == true then
      return false
   end


I think that my modification prevents horses to jump 2 blocks high by themselves but I verified that mounted horses are still able to.

Have you noticed similar behaviors with your animals?


I have. Sometimes they also get stuck inside blocks that they should be able to jump over; or they'll clip right trough gaps that they shouldn't be able to. Horses seem able to jump over way more than 2 blocks sometimes.
 

Previous

Return to WIP Games



Who is online

Users browsing this forum: No registered users and 2 guests