Mobkit - Entity API [mobkit][alpha]

Post Reply
User avatar
StarNinjas
Member
Posts: 411
Joined: Wed Mar 14, 2018 00:32
GitHub: starninjas
IRC: StarNinjas
In-game: J1
Location: Terrarca
Contact:

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

by StarNinjas » Post

Cool thx
Don't go to bed tonight, without knowing what would happen if you died. https://thegospelfilm.org/

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

A request:

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

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

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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)

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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))

Termos
Member
Posts: 417
Joined: Sun Dec 16, 2018 12:50

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

by Termos » Post

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.

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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.

User avatar
Extex
Member
Posts: 244
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

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

by Extex » Post

How do I get the look direction of the mob?
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

Termos
Member
Posts: 417
Joined: Sun Dec 16, 2018 12:50

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

by Termos » Post

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.

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

Request: Mobs affected by fire/lave (damage).

Termos
Member
Posts: 417
Joined: Sun Dec 16, 2018 12:50

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

by Termos » Post

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.

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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
Last edited by runs on Mon Aug 26, 2019 09:43, edited 1 time in total.

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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>

Termos
Member
Posts: 417
Joined: Sun Dec 16, 2018 12:50

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

by Termos » Post

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

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

oh, cool

:-)

u18398

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

by u18398 » Post

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)

User avatar
Andrey01
Member
Posts: 2574
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

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

by Andrey01 » Post

Wow, really just impresses!
Hmm, why are those sharks swimming only around the island and not in random path?

Termos
Member
Posts: 417
Joined: Sun Dec 16, 2018 12:50

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

by Termos » Post

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.

User avatar
Extex
Member
Posts: 244
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

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

by Extex » Post

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
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

Termos
Member
Posts: 417
Joined: Sun Dec 16, 2018 12:50

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

by Termos » Post

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

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

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

by twoelk » Post

hmm...
how about some jellyfish teaming up?
viewtopic.php?p=241321#p241321

the gifs look cool btw

User avatar
Andrey01
Member
Posts: 2574
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

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

by Andrey01 » Post

Can I donwload dev version with those sharks?

User avatar
Extex
Member
Posts: 244
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

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

by Extex » Post

Termos wrote: Modelling is the hardest part for me - Blender interface is crp tbh.
Not really. It just takes some getting used to.
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

User avatar
ElCeejo
Member
Posts: 210
Joined: Thu Feb 28, 2019 23:29
GitHub: ElCeejo
In-game: ElCeejo
Location: Your Mother's house

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

by ElCeejo » Post

It's cool seeing them actively avoiding shallow water instead of constantly beaching themselves. Can't wait for proper flying and swimming!

u18398

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

by u18398 » Post

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 ... :)

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests