Termos wrote:I decided to post some preview code, attachments in the first post.
.
cool! If you complete it, I will use it in the mobs mod I'm working on.
Termos wrote:I decided to post some preview code, attachments in the first post.
.
Termos wrote:Entity property (function). Mobs must have it, inanimate objects not necessarily so. This is where the most important cognitive processes take place: where do we come from, what is the purpose of meaning, and above all - what are we going to do next.
runs wrote:I've tested with my kitty mob:
Sokomine wrote:Termos wrote:Most mods that want to do something with a (more intelligent) mob don't really have to know how to do all the small steps necessary to accomplish the larger goal.
Termos wrote:runs wrote:I've tested with my kitty mob:
-Kitty seems to avoid jumping heights, it can fall but it has to think about that.
With this behavior active, they shouldn't fall down farther than they can jump back up. Would you tell me more about how it happened? What jump_height setting?.
minetest.register_entity("petz:kitty", {
-- common props
physical = true,
rotate = Rotate,
damage = 8,
hp_min = 4,
hp_max = 8,
armor = 200,
--stepheight = 1,
collide_with_objects = true,
collisionbox = CollisionBox,
visual = Visual,
mesh = Mesh,
textures = Textures,
visual_size = VisualSize,
on_step = mobkit.stepfunc, -- required
on_activate = mobkit.actfunc, -- required
-- api props
springiness=0.5,
walk_speed = 1,
jump_height = 5,
brainfunc = function(self) -- dumbest brain possible
if mobkit.is_queue_empty_high(self) then mobkit.hq_roam(self) end
end
})
Termos wrote:Springiness is not intended to be used with mobs, this is probably the cause, my guess is she bounces off the walls, try setting it to zero.
Also, I'd reduce the hitbox size 3 to 4 times to match the model, horizontal dimensions should never exceed 1 anyway.
CollisionBox = {-0.35, -0.5, -0.28, 0.35, -0.125, 0.28}
2019-02-24 10:46:34: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Activate(): /opt/minetest/bin/../games/bogart/mods/mobkit/init.lua:317: attempt to perform arithmetic on a nil value
self.height = self.collisionbox[5] - self.collisionbox[2]
2019-02-24 10:45:25: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): /opt/minetest/bin/../games/bogart/mods/mobkit/init.lua:159: attempt to perform arithmetic on field 'height' (a nil value)
2019-02-24 10:45:25: ERROR[Main]: stack traceback:
2019-02-24 10:45:25: ERROR[Main]: /opt/minetest/bin/../games/bogart/mods/mobkit/init.lua:159: in function 'is_neighbor_node_reachable'
2019-02-24 10:45:25: ERROR[Main]: /opt/minetest/bin/../games/bogart/mods/mobkit/init.lua:290: in function 'func'
2019-02-24 10:45:25: ERROR[Main]: /opt/minetest/bin/../games/bogart/mods/mobkit/init.lua:192: in function 'execute_queues'
2019-02-24 10:45:25: ERROR[Main]: /opt/minetest/bin/../games/bogart/mods/mobkit/init.lua:366: in function </opt/minetest/bin/../games/bogart/mods/mobkit/init.lua:320>
Termos wrote:Ok, the main reason is such a model alignment is not supported.
Probably it should be, as existing models' alignment seems to be all over the place, so now it is.
Tested with redo kitten model, mobkit reuploaded.
Thanks, good testin.
That box of yours is still way too big though, and there are no good reasons for horizontal dimensions not to be equal.
Termos wrote:Proper knockback.
Nothing fancy, giving it an initial velocity is enough.
That it stops when it should and then mobs continue their tasks is a byproduct of physics and behaviors.
Termos wrote:Haha, he's a looker, ain't he?
True, his appearance may not be appealing to everyone's sensibilities,
so for the next clip i went with the Internet gold standard.
They can see me.
Now they are equipped with basic sensory apparata, it's time for more complex behaviors involving other entities and players, like following, running away, hunting, mating etc.
brainfunc = function(self)
if mobkit.is_queue_empty_high(self) then
local plyr = mobkit.get_nearby_player(self)
if plyr then mobkit.hq_follow(self,plyr) end
end
end,
Termos wrote:I gotta feeling somebody's following me
The simplest follower brain which makes them follow the first player they encounter looks like this:
- Code: Select all
brainfunc = function(self)
if mobkit.is_queue_empty_high(self) then
local plyr = mobkit.get_nearby_player(self)
if plyr then mobkit.hq_follow(self,plyr) end
end
end,
Simple enough, huh?
Alas, coding particular behavior functions is not as simple as I would like it to be, yet.
R-One wrote:- would it be possible to integrate a variable that would list the blocks on which the mobs could not walk and jump? for example as fences.
R-One wrote:- Is the mod mobkit zip up-to-date?
R-One wrote:- Is there any integration of different gameplay such as feeding, taming ...?
R-One wrote:- Will it be possible to generate flying or swimming mobs?
Users browsing this forum: Bing Bot [Bot] and 0 guests