Page 7 of 16

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Wed Aug 07, 2019 17:52
by StarNinjas
Cool thx

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sun Aug 11, 2019 23:18
by runs
A request:

- Mobs not jumping fences. To make stables/barns as in Minecraft.

It should be a group called "fence" in MTG :-(

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sun Aug 11, 2019 23:53
by runs
Well I've found a solution:

function mobkit.is_neighbor_node_reachable(self,neighbor) -- todo: take either number or pos
local offset = neighbors[neighbor]
local pos=mobkit.get_stand_pos(self)
local tpos = mobkit.get_node_pos(mobkit.pos_shift(pos,offset))
if minetest.get_node(tpos).name:find("fence") then return end
local height, liquidflag = mobkit.get_terrain_height(tpos)

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Mon Aug 12, 2019 00:27
by runs
To avoid jumping gates too:
local node_name = minetest.get_node(tpos).name
if node_name:find("fence") then return
elseif node_name:find("gate") and node_name:find("closed") then return end

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Fri Aug 16, 2019 11:05
by runs
Some warnings (global variables that should be local)

line 448
local heightl = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,-1))


line 450
local heightr = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,1))

line 465
local liq
height, pos2, liq = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,-i*self.path_dir))

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sat Aug 17, 2019 19:13
by Termos
runs wrote:- Mobs not jumping fences. To make stables/barns as in Minecraft.
It should be a group called "fence" in MTG :-(

I'm on the fence about this.
Ok, not really, direct support for fences is out of the question, because it'd violate some goals I set for this project, namely
- no dependencies - in the minetest api there's no concept of fences, I'd have to depend on a specific implementation, MTG probably.
- consistency - in the world where the ability to jump 1m+ is mandatory, 1m high fences make little sense.

However, I'll see if I can add a list of names/groups as a parameter to is_neighbor_node_reachable, so you can disallow any specific nodes, not just fences.

If I were to solve this problem in a mod/game, I'd try to make fences 2 nodes high, for example 1+0.3, and make default jump height like 1.25. This I believe would be consistent and in accordance with KISS and WYSIWYG.

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sat Aug 17, 2019 20:33
by runs
Termos wrote:
runs wrote:- Mobs not jumping fences. To make stables/barns as in Minecraft.
It should be a group called "fence" in MTG :-(

I'm on the fence about this.
Ok, not really, direct support for fences is out of the question, because it'd violate some goals I set for this project, namely
- no dependencies - in the minetest api there's no concept of fences, I'd have to depend on a specific implementation, MTG probably.
- consistency - in the world where the ability to jump 1m+ is mandatory, 1m high fences make little sense.

However, I'll see if I can add a list of names/groups as a parameter to is_neighbor_node_reachable, so you can disallow any specific nodes, not just fences.

If I were to solve this problem in a mod/game, I'd try to make fences 2 nodes high, for example 1+0.3, and make default jump height like 1.25. This I believe would be consistent and in accordance with KISS and WYSIWYG.


Yes, make fences a little high maybe is the solution.

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sat Aug 17, 2019 21:58
by Extex
How do I get the look direction of the mob?

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sun Aug 18, 2019 09:11
by Termos
runs wrote:Yes, make fences a little high maybe is the solution.

Normally I'm not a fan of copying MC, but it seems this is how it's done in MC as well.
As far as I remember in MC rabbits can jump fences but players can not, this seems to indicate there too, fences are physical obstacles of certain height rather than an arbitrary restriction forbidding mobs jumping certain nodes.

Extex wrote:How do I get the look direction of the mob?

The usual, get_yaw(), or get_rotation() if you want it 3d.

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sun Aug 25, 2019 09:25
by runs
Request: Mobs affected by fire/lave (damage).

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sun Aug 25, 2019 10:30
by Termos
runs wrote:Request: Mobs affected by fire/lave (damage).

No dependencies rule.
Lava is a game/mod specific thing, minetest api isn't aware of that concept.

I'll think of something to make coding harmful nodes easier, but probably it's easy enough already.
In the brain function, somewhere between hp check and timer block, check if self.isinliquid, find out what node it is and apply damage accordingly, this should end up being a three liner or so.

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Mon Aug 26, 2019 01:31
by runs
yes, I've implement the lava/fire behaviour, but is the same case of fences, it would be cool to define some nodes to avoid by the mobs.

Code: Select all
petz.env_damage = function(self)
   local stand_pos= mobkit.get_stand_pos(self)
   local stand_node_pos = mobkit.get_node_pos(stand_pos)
   local stand_node = mobkit.nodeatpos(stand_node_pos)
   if stand_node.groups.igniter then --if lava or fire
      mobkit.hurt(self, self.dtime)
   end
end

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Mon Aug 26, 2019 09:42
by runs
This error can be caused by a node of type nodebox but node_box defined?

Code: Select all
2019-08-25 17:59:03: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:153: attempt to index field 'node_box' (a nil value)
2019-08-25 17:59:03: ERROR[Main]: stack traceback:
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:153: in function 'get_node_height'
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:184: in function </home/imk/minetest/bin/../mods/petz/mobkit/init.lua:180>
2019-08-25 17:59:03: ERROR[Main]:    (tail call): ?
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:392: in function 'is_neighbor_node_reachable'
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:446: in function 'get_next_waypoint'
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:532: in function 'goto_next_waypoint'
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:991: in function 'func'
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:651: in function 'execute_queues'
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:1325: in function 'stepfunc'
2019-08-25 17:59:03: ERROR[Main]:    ...imk/minetest/bin/../mods/petz/petz/pigeon_mobkit.lua:81: in function <...imk/minetest/bin/../mods/petz/petz/pigeon_mobkit.lua:80>

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Mon Aug 26, 2019 19:58
by Termos
runs wrote:This error can be caused by a node of type nodebox but node_box defined?

Yup, definitely, didn't know registering such a node was even possible, it's the colbox that's supposed to be optional.
___________________________________________________________________________________

Meanwhile, coming up next:
One of the example mods is going to change name to:
Zombies - The Real Deal - Now With Sharks!

Image

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Mon Aug 26, 2019 23:04
by runs
oh, cool

:-)

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Tue Aug 27, 2019 04:39
by Gundul
Termos wrote:Meanwhile, coming up next:
One of the example mods is going to change name to:
Zombies - The Real Deal - Now With Sharks!


Yes ! fishes and big ones.
Thank you, now I can't sleep anymore until it is out X)

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Tue Aug 27, 2019 06:58
by Andrey01
Wow, really just impresses!
Hmm, why are those sharks swimming only around the island and not in random path?

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Tue Aug 27, 2019 10:02
by Termos
Andrey01 wrote:Hmm, why are those sharks swimming only around the island and not in random path?

Because they're hungry and want to eat the guy.
Also this is what made it possible to record that looping GIF.

Gundul wrote:I can't sleep anymore until it is out X)

Now you got me worried, I barely started working on behaviors, this will take time.

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Fri Aug 30, 2019 16:43
by Extex
Cool!
I've had my eye on this mod for a while, This mod has tons of potential!

Can't wait for the sharks!

P.S. If you ever need a texture artist or modeler I can help

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sun Sep 01, 2019 10:48
by Termos
Extex wrote:If you ever need a texture artist or modeler I can help

Great, thanks, I'll definitely need that at some point. Modelling is the hardest part for me - Blender interface is crp tbh.
____________________________________________________________________________________

Looks like a nice spot for a swim.
Image

The first primitive aquatic random roaming behavior. They stay within abr/2 radius around their activation position and try to avoid the shallows and obstacles

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sun Sep 01, 2019 14:15
by twoelk
hmm...
how about some jellyfish teaming up?
viewtopic.php?p=241321#p241321

the gifs look cool btw

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sun Sep 01, 2019 15:55
by Andrey01
Can I donwload dev version with those sharks?

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sun Sep 01, 2019 16:11
by Extex
Termos wrote:Modelling is the hardest part for me - Blender interface is crp tbh.

Not really. It just takes some getting used to.

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Sun Sep 01, 2019 18:24
by ElCeejo
It's cool seeing them actively avoiding shallow water instead of constantly beaching themselves. Can't wait for proper flying and swimming!

Re: Mobkit - Entity API [mobkit][alpha]

PostPosted: Mon Sep 02, 2019 17:25
by Gundul
Termos wrote:Looks like a nice spot for a swim.
Image


Already one week without sleep and now an even better teaser ... XD

I guess a nervous breakdown is not far anymore ... :)