Ah gotcha.
Mobkit - Entity API [mobkit][alpha]
- MisterE
- Member
- Posts: 693
- Joined: Sun Feb 16, 2020 21:06
- GitHub: MisterE123
- IRC: MisterE
- In-game: MisterE
Re: Mobkit - Entity API [mobkit][alpha]
you could conceivably write a function to replace grass with air and then call it in the brain function.
Re: Mobkit - Entity API [mobkit][alpha]
Definitely,
I only haven't implemented grazing behavior because I'm to lazy to make a proper model animation.
See mobkit_api.txt for instructions on custom behavior creation, and should you have any specific questions ask them here.
Re: Mobkit - Entity API [mobkit][alpha]
I guess I really don't know what to do. I sort of am not even sure what I am looking at.
Re: Mobkit - Entity API [mobkit][alpha]
-
- Member
- Posts: 204
- Joined: Sun Jul 10, 2016 05:00
- Location: Under Le' Sea
Re: Mobkit - Entity API [mobkit][alpha]
Is it possible for one to set loot drops from Wildlife's deers and wolves?
As an example, could it be possible for me to set it to that they could drop meat, leather, or bones from other mods?
As an example, could it be possible for me to set it to that they could drop meat, leather, or bones from other mods?
Look at that, a signiture box! To bad I have nothing to put in i-... Wait...
Re: Mobkit - Entity API [mobkit][alpha]
Sure.BlueTangs Rock wrote: ↑Wed Sep 22, 2021 06:10Is it possible for one to set loot drops from Wildlife's deers and wolves?
Probably the easiest way is to copy function [yournamespace].hq_die(self) from behaviors2override.lua, and put your drop logic in this block: if timer < 0 then self.object:remove() end. Then use your version instead of mobkit.hq_die()
Wildlife only doesn't do drops because it's supposed to be dependencyless.
- AccidentallyRhine
- Member
- Posts: 252
- Joined: Sun Aug 02, 2015 05:43
Re: Mobkit - Entity API [mobkit][alpha]
These mobs feel less robotic than other mods, especially the flying mobs. Everything worked great on my first world startup but ever since, all the animals just seem to stand in place. They will turn to face me and make noise like they want to attack but never actually do. Deer no longer flee. I'm trying to figure out what might have changed.
Re: Mobkit - Entity API [mobkit][alpha]
unless im missing something, it appears returning true in a behavior doesnt always end it on that step. issue https://github.com/TheTermos/mobkit/issues/37 unless I am missing something.
j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o
- apercy
- Member
- Posts: 643
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: Mobkit - Entity API [mobkit][alpha]
I had this issue when I was using mob_core (a dependency of animalia). Then when I disabled it, all worked fine again.AccidentallyRhine wrote: ↑Fri Dec 10, 2021 21:02These mobs feel less robotic than other mods, especially the flying mobs. Everything worked great on my first world startup but ever since, all the animals just seem to stand in place. They will turn to face me and make noise like they want to attack but never actually do. Deer no longer flee. I'm trying to figure out what might have changed.
- AccidentallyRhine
- Member
- Posts: 252
- Joined: Sun Aug 02, 2015 05:43
Re: Mobkit - Entity API [mobkit][alpha]
It now works with mob_core disabled. Thanks! Animalia wasn't even working anyway since it kept erroring about spawn light level issues so I deactivated it.
- j0j0n4th4n
- Member
- Posts: 249
- Joined: Tue Jan 26, 2021 06:45
Re: Mobkit - Entity API [mobkit][alpha]
Would it be possible to get some mob examples with mobkit?
I'm running into all sort of problems converting some mobs from NSSM into mobkit and somethings are not very clear in the documentation
I'm running into all sort of problems converting some mobs from NSSM into mobkit and somethings are not very clear in the documentation
cdb_894a100ddd76
Re: Mobkit - Entity API [mobkit][alpha]
https://github.com/TheTermos/zombiestrd and https://github.com/TheTermos/wildlife for ones by the author.j0j0n4th4n wrote: ↑Tue Dec 14, 2021 01:51Would it be possible to get some mob examples with mobkit?
I'm running into all sort of problems converting some mobs from NSSM into mobkit and somethings are not very clear in the documentation
https://content.minetest.net/metapackages/mobkit/ shows you all packages that use it
j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o
- j0j0n4th4n
- Member
- Posts: 249
- Joined: Tue Jan 26, 2021 06:45
Re: Mobkit - Entity API [mobkit][alpha]
That did helped, but it also confuse me more =Phttps://github.com/TheTermos/zombiestrd and https://github.com/TheTermos/wildlife for ones by the author.
https://content.minetest.net/metapackages/mobkit/ shows you all packages that use it
The thing is, the example mobs don't really work. I dunno why but the wolf and the zombie don't move at all when they are suppose to wander around, the wolf hunt the deer but after reaching it don't do damage instead both mobs get stuck in air doing their walking animation but not moving from that node. I run it in 5.3 and 5.4 so maybe that is the reason?
cdb_894a100ddd76
Re: Mobkit - Entity API [mobkit][alpha]
works for me :tm:j0j0n4th4n wrote: ↑Tue Dec 14, 2021 15:53
That did helped, but it also confuse me more =P
The thing is, the example mobs don't really work. I dunno why but the wolf and the zombie don't move at all when they are suppose to wander around, the wolf hunt the deer but after reaching it don't do damage instead both mobs get stuck in air doing their walking animation but not moving from that node. I run it in 5.3 and 5.4 so maybe that is the reason?
try having only mobkit and the two demo mods by termos enabled on stock mtg to make sure something else isnt interfering
j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o
- j0j0n4th4n
- Member
- Posts: 249
- Joined: Tue Jan 26, 2021 06:45
Re: Mobkit - Entity API [mobkit][alpha]
Thanks! That worked well, when I disabled mob core the mobs start behaving as I expected them to be. I guess that was a conflict between both modstry having only mobkit and the two demo mods by termos enabled on stock mtg to make sure something else isnt interfering
cdb_894a100ddd76
Re: Mobkit - Entity API [mobkit][alpha]
Code: Select all
2022-02-12 07:51:28: WARNING[Server]: collisionMoveSimple: Loop count exceeded, aborting to avoid infiniite loop
2022-02-12 07:51:45: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): Invalid float vector dimension range 'y' (expected -2.14748e+06 < y < 2.14748e+06 got 4.2413e+09).
2022-02-12 07:51:45: ERROR[Main]: stack traceback:
2022-02-12 07:51:45: ERROR[Main]: [C]: in function 'set_velocity'
2022-02-12 07:51:45: ERROR[Main]: /home/mtlive1/.minetest/mods/mobkit/init.lua:702: in function 'physics'
2022-02-12 07:51:45: ERROR[Main]: /home/mtlive1/.minetest/mods/mobkit/init.lua:843: in function 'stepfunc'
2022-02-12 07:51:45: ERROR[Main]: /home/mtlive1/.minetest/mods/petz/petz/petz/pony_mobkit.lua:121: in function 'func'
Probably in 5.5 error caused for the new vector definition.
Re: Mobkit - Entity API [mobkit][alpha]
The problematic line is the last one (self.object:set_velocity(vnew)) in the following code:
Code: Select all
function mobkit.physics(self)
local vel=self.object:get_velocity()
local vnew = vector.new(vel)
-- dumb friction
if self.isonground and not self.isinliquid then
vnew = {x= vel.x> 0.2 and vel.x*mobkit.friction or 0,
y=vel.y,
z=vel.z > 0.2 and vel.z*mobkit.friction or 0}
end
-- bounciness
if self.springiness and self.springiness > 0 then
if colinfo and colinfo.collides then
for _,c in ipairs(colinfo.collisions) do
if c.old_velocity[c.axis] > 0.1 then
vnew[c.axis] = vnew[c.axis] * self.springiness * -1
end
end
elseif not colinfo then -- MT 5.2 and earlier
for _,k in ipairs({'y','z','x'}) do
if vel[k]==0 and abs(self.lastvelocity[k])> 0.1 then
vnew[k]=-self.lastvelocity[k]*self.springiness
end
end
end
end
self.object:set_velocity(vnew)
- apercy
- Member
- Posts: 643
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: Mobkit - Entity API [mobkit][alpha]
you can make your own physics function and set it instead the default function, as I did in my motorboat mod.runs wrote: ↑Sat Feb 12, 2022 17:13The problematic line is the last one (self.object:set_velocity(vnew)) in the following code:
Code: Select all
function mobkit.physics(self) local vel=self.object:get_velocity() local vnew = vector.new(vel) -- dumb friction if self.isonground and not self.isinliquid then vnew = {x= vel.x> 0.2 and vel.x*mobkit.friction or 0, y=vel.y, z=vel.z > 0.2 and vel.z*mobkit.friction or 0} end -- bounciness if self.springiness and self.springiness > 0 then if colinfo and colinfo.collides then for _,c in ipairs(colinfo.collisions) do if c.old_velocity[c.axis] > 0.1 then vnew[c.axis] = vnew[c.axis] * self.springiness * -1 end end elseif not colinfo then -- MT 5.2 and earlier for _,k in ipairs({'y','z','x'}) do if vel[k]==0 and abs(self.lastvelocity[k])> 0.1 then vnew[k]=-self.lastvelocity[k]*self.springiness end end end end self.object:set_velocity(vnew)
Look at line 302 in "init.lua" file
and the file "motorboat_custom_physics.lua"
https://content.minetest.net/packages/apercy/motorboat/
https://content.minetest.net/packages/apercy/motorboat/
Re: Mobkit - Entity API [mobkit][alpha]
Forget it. The conflict was with another mod.
Re: Mobkit - Entity API [mobkit][alpha]
Thanks, solved.apercy wrote: ↑Sat Feb 12, 2022 18:16you can make your own physics function and set it instead the default function, as I did in my motorboat mod.runs wrote: ↑Sat Feb 12, 2022 17:13The problematic line is the last one (self.object:set_velocity(vnew)) in the following code:
Code: Select all
function mobkit.physics(self) local vel=self.object:get_velocity() local vnew = vector.new(vel) -- dumb friction if self.isonground and not self.isinliquid then vnew = {x= vel.x> 0.2 and vel.x*mobkit.friction or 0, y=vel.y, z=vel.z > 0.2 and vel.z*mobkit.friction or 0} end -- bounciness if self.springiness and self.springiness > 0 then if colinfo and colinfo.collides then for _,c in ipairs(colinfo.collisions) do if c.old_velocity[c.axis] > 0.1 then vnew[c.axis] = vnew[c.axis] * self.springiness * -1 end end elseif not colinfo then -- MT 5.2 and earlier for _,k in ipairs({'y','z','x'}) do if vel[k]==0 and abs(self.lastvelocity[k])> 0.1 then vnew[k]=-self.lastvelocity[k]*self.springiness end end end end self.object:set_velocity(vnew)
Look at line 302 in "init.lua" file
and the file "motorboat_custom_physics.lua"
https://content.minetest.net/packages/apercy/motorboat/
https://content.minetest.net/packages/apercy/motorboat/
Who is online
Users browsing this forum: No registered users and 9 guests