Mobkit - Entity API [mobkit][alpha]
- 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]
Cool thx
Don't go to bed tonight, without knowing what would happen if you died. https://thegospelfilm.org/
Re: Mobkit - Entity API [mobkit][alpha]
A request:
- Mobs not jumping fences. To make stables/barns as in Minecraft.
It should be a group called "fence" in MTG :-(
- 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]
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)
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]
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
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]
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))
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]
I'm on the fence about this.runs wrote:- Mobs not jumping fences. To make stables/barns as in Minecraft.
It should be a group called "fence" in MTG :-(
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]
Yes, make fences a little high maybe is the solution.Termos wrote:I'm on the fence about this.runs wrote:- Mobs not jumping fences. To make stables/barns as in Minecraft.
It should be a group called "fence" in MTG :-(
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]
How do I get the look direction of the mob?
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP
Re: Mobkit - Entity API [mobkit][alpha]
Normally I'm not a fan of copying MC, but it seems this is how it's done in MC as well.runs wrote:Yes, make fences a little high maybe is the solution.
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.
The usual, get_yaw(), or get_rotation() if you want it 3d.Extex wrote:How do I get the look direction of the mob?
Re: Mobkit - Entity API [mobkit][alpha]
Request: Mobs affected by fire/lave (damage).
Re: Mobkit - Entity API [mobkit][alpha]
No dependencies rule.runs wrote:Request: Mobs affected by fire/lave (damage).
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]
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.
Re: Mobkit - Entity API [mobkit][alpha]
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]
Yup, definitely, didn't know registering such a node was even possible, it's the colbox that's supposed to be optional.runs wrote:This error can be caused by a node of type nodebox but node_box defined?
___________________________________________________________________________________
Meanwhile, coming up next:
One of the example mods is going to change name to:
Zombies - The Real Deal - Now With Sharks!
Re: Mobkit - Entity API [mobkit][alpha]
oh, cool
:-)
:-)
Re: Mobkit - Entity API [mobkit][alpha]
Yes ! fishes and big ones.Termos wrote: Meanwhile, coming up next:
One of the example mods is going to change name to:
Zombies - The Real Deal - Now With Sharks!
Thank you, now I can't sleep anymore until it is out X)
- 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]
Wow, really just impresses!
Hmm, why are those sharks swimming only around the island and not in random path?
Hmm, why are those sharks swimming only around the island and not in random path?
Re: Mobkit - Entity API [mobkit][alpha]
Because they're hungry and want to eat the guy.Andrey01 wrote:Hmm, why are those sharks swimming only around the island and not in random path?
Also this is what made it possible to record that looping GIF.
Now you got me worried, I barely started working on behaviors, this will take time.Gundul wrote:I can't sleep anymore until it is out X)
Re: Mobkit - Entity API [mobkit][alpha]
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
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
Re: Mobkit - Entity API [mobkit][alpha]
Great, thanks, I'll definitely need that at some point. Modelling is the hardest part for me - Blender interface is crp tbh.Extex wrote:If you ever need a texture artist or modeler I can help
____________________________________________________________________________________
Looks like a nice spot for a swim.
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
- 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]
Can I donwload dev version with those sharks?
Re: Mobkit - Entity API [mobkit][alpha]
Not really. It just takes some getting used to.Termos wrote: Modelling is the hardest part for me - Blender interface is crp tbh.
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP
- 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]
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]
Already one week without sleep and now an even better teaser ... XDTermos wrote: Looks like a nice spot for a swim.
I guess a nervous breakdown is not far anymore ... :)
Who is online
Users browsing this forum: No registered users and 14 guests