Mobkit - Entity API [mobkit][alpha]

Gundul
Member
 
Posts: 499
Joined: Thu Aug 27, 2015 10:55
Location: Europe/Asia
GitHub: berengma
IRC: Gundul

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

by Gundul » Sun Jul 14, 2019 22:03

Well done. Zombieworld is up to date now.

just one thing in your wildlife mod:

Code: Select all
local function herbivore_brain(self)

   if self.object:get_hp() <=100 then   


same for the predators. You forgot to change to your new api I guess :)

Like this all wildlife mobs die as soon as they spawn :D
My servers: Jungle, Lilly in the valley, ZombieTest
 

User avatar
runs
Member
 
Posts: 675
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

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

by runs » Sun Jul 14, 2019 22:50

Gundul wrote:Well done. Zombieworld is up to date now.

just one thing in your wildlife mod:

Code: Select all
local function herbivore_brain(self)

   if self.object:get_hp() <=100 then   


same for the predators. You forgot to change to your new api I guess :)

Like this all wildlife mobs die as soon as they spawn :D


Change to:
Code: Select all
 if self.hp <= 0 then
 

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

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

by Termos » Sun Jul 14, 2019 22:56

Damnation! The files must have mixed up somehow during the upload,
reuploaded again, please check.
 

User avatar
runs
Member
 
Posts: 675
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

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

by runs » Mon Jul 15, 2019 00:12

mobkit.heal(luaent,dmg) can increase over max_hp and mobkit.hurt(luaent,dmg) below 0.

Well, no problem, I do a check. But it'd be cool if you put a note in mobkit_api.txt
 

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

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

by Termos » Mon Jul 15, 2019 07:49

runs wrote:mobkit.heal(luaent,dmg) can increase over max_hp and mobkit.hurt(luaent,dmg) below 0.

No no, heal shouldn't increase over max hp, this is a bug sorry.
As to hurt, shouldn't really matter, you can choose.
 

User avatar
Stix
Member
 
Posts: 1368
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: nil
In-game: Stix [+alts]

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

by Stix » Wed Jul 17, 2019 19:49

I tried downloading wildlife from the ContentDB and got the error "no proper mod or modpack found" perhaps it needs to be reuploaded?
Hey, what can i say? I'm the bad guy.
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

User avatar
runs
Member
 
Posts: 675
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

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

by runs » Wed Jul 17, 2019 21:52

Stix wrote:I tried downloading wildlife from the ContentDB and got the error "no proper mod or modpack found" perhaps it needs to be reuploaded?


ContentDB is bugged from a day ago. :-(
 

User avatar
runs
Member
 
Posts: 675
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

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

by runs » Thu Jul 18, 2019 15:21

Some requests:
-iddle animations, more than one, and randomly selected, as the textures. Mobs redo have 5 max for each animation, but i do not understand this limit.
-when runaway apply the run animation, if not existed, then the walk one.
 

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

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

by Termos » Thu Jul 18, 2019 21:17

runs wrote:-iddle animations, more than one, and randomly selected, as the textures. Mobs redo have 5 max for each animation, but i do not understand this limit.

Should work already, I added that a couple versions ago, doesn't it?
I'm sure I've seen it working in Petz.

runs wrote:-when runaway apply the run animation, if not existed, then the walk one.

For now I recommend copying relevant behaviors over to your mod and modifying them there.
I'll think about adding a fallback to animate() for the next version.
 

User avatar
runs
Member
 
Posts: 675
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

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

by runs » Thu Jul 18, 2019 23:10

Termos wrote:
runs wrote:-iddle animations, more than one, and randomly selected, as the textures. Mobs redo have 5 max for each animation, but i do not understand this limit.

Should work already, I added that a couple versions ago, doesn't it?
I'm sure I've seen it working in Petz.

runs wrote:-when runaway apply the run animation, if not existed, then the walk one.

For now I recommend copying relevant behaviors over to your mod and modifying them there.
I'll think about adding a fallback to animate() for the next version.


Sorry, it works hahaha

OK I will do so.
 

User avatar
runs
Member
 
Posts: 675
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

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

by runs » Sat Jul 27, 2019 10:37

A request:

Code: Select all
-- Memory functions.
-- Stuff in memory is serialized, never try to remember objectrefs.
function mobkit.remember(self,key,val)
  self.memory[key]=val
  return val
end


What about adding a 'return' to the remember function? With this, you could set a var and saved it at the same time.
 

Gundul
Member
 
Posts: 499
Joined: Thu Aug 27, 2015 10:55
Location: Europe/Asia
GitHub: berengma
IRC: Gundul

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

by Gundul » Wed Jul 31, 2019 04:34

Yesterday server crashed once.
Fist time in a very long period that this happened:

Code: Select all
2019-07-30 18:50:36: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'zombiestrd' in callback luaentity_Step(): .minetest/mods/petz/mobkit/init.lua:56: attempt to index local 'vec' (a nil value)
2019-07-30 18:50:36: ERROR[Main]: stack traceback:
2019-07-30 18:50:36: ERROR[Main]:       .minetest/mods/petz/mobkit/init.lua:56: in function 'pos_shift'
2019-07-30 18:50:36: ERROR[Main]:       .minetest/mods/petz/mobkit/init.lua:389: in function 'is_neighbor_node_reachable'
2019-07-30 18:50:36: ERROR[Main]:       .minetest/mods/petz/mobkit/init.lua:444: in function 'get_next_waypoint'
2019-07-30 18:50:36: ERROR[Main]:       .minetest/mods/petz/mobkit/init.lua:529: in function 'goto_next_waypoint'
2019-07-30 18:50:36: ERROR[Main]:       .minetest/mods/zombiestrd/init.lua:132: in function 'func'
2019-07-30 18:50:36: ERROR[Main]:       /home/mars/.minetest/mods/petz/mobkit/init.lua:648: in function 'execute_queues'
2019-07-30 18:50:36: ERROR[Main]:       .minetest/mods/petz/mobkit/init.lua:1322: in function </home/mars/.minetest/mods/petz/mobkit/init.lua:1213>

My servers: Jungle, Lilly in the valley, ZombieTest
 

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

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

by Termos » Thu Aug 01, 2019 21:38

Gundul wrote:2019-07-30 18:50:36: ERROR[Main]: .minetest/mods/zombiestrd/init.lua:132: in function 'func'

Not sure how to help, looks like this version of zombiestrd has been modified, there's a comment at line 132 in the original.

runs wrote:What about adding a 'return' to the remember function? With this, you could set a var and saved it at the same time.

Sure, the next version.
 

Gundul
Member
 
Posts: 499
Joined: Thu Aug 27, 2015 10:55
Location: Europe/Asia
GitHub: berengma
IRC: Gundul

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

by Gundul » Sat Aug 03, 2019 09:03

Termos wrote:
Gundul wrote:2019-07-30 18:50:36: ERROR[Main]: .minetest/mods/zombiestrd/init.lua:132: in function 'func'

Not sure how to help, looks like this version of zombiestrd has been modified, there's a comment at line 132 in the original.

Sorry I always forget that I added code for highscore list etc.

The error happened here:

Code: Select all

-- custom behaviour
-- makes them move in stimulus' general direction for limited time
local function hq_attracted(self,prty,tpos)
        local timer = time() + random(20,30)    -- zombie's attention span
        local func = function(self)
                if time() > timer then return true end
                if mobkit.is_queue_empty_low(self) and self.isonground then
                        local pos = mobkit.get_stand_pos(self)
                        if vector.distance(pos,tpos) > 3 then
                                mobkit.goto_next_waypoint(self,tpos)     *** This is line 132 ***
                        else
                                return true
                        end
                end
        end
        mobkit.queue_high(self,func,prty)
end




I hope that helps.
My servers: Jungle, Lilly in the valley, ZombieTest
 

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

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

by Termos » Sat Aug 03, 2019 17:22

Gundul wrote:Sorry I always forget that I added code for highscore list etc.

Turns out your mobkit has been modified as well.
Identified a possible cause, a small bugfix release coming very soon.
 

User avatar
StarNinjas
Member
 
Posts: 274
Joined: Wed Mar 14, 2018 00:32
Location: aincrad
GitHub: starninjas
IRC: StarNinjas
In-game: J1

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

by StarNinjas » Sat Aug 03, 2019 21:52

Hello, I think you should look into CME and make it more like that, also it would be awesome if you could add support for playereffects, so mobs could inflict magical dmg. Red flash would be cool too.

Anyways really loving this, I hope to make a mod out of it soon.
 

Gundul
Member
 
Posts: 499
Joined: Thu Aug 27, 2015 10:55
Location: Europe/Asia
GitHub: berengma
IRC: Gundul

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

by Gundul » Sun Aug 04, 2019 08:05

Termos wrote:Turns out your mobkit has been modified as well.
Identified a possible cause, a small bugfix release coming very soon.

I am innocent in this case :) But I remember like that runs added something
for his flying petz.

Petz mod, wildlife and zombiestrd are running for 2 months now together with
your mobkit on ZombieTest server. That was the first and only crash in a long
period of time. For being still alpha your mobkit is very stable and reliable.
My servers: Jungle, Lilly in the valley, ZombieTest
 

User avatar
runs
Member
 
Posts: 675
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

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

by runs » Sun Aug 04, 2019 09:44

Gundul wrote:
Termos wrote:Turns out your mobkit has been modified as well.
Identified a possible cause, a small bugfix release coming very soon.

I am innocent in this case :) But I remember like that runs added something
for his flying petz.

Petz mod, wildlife and zombiestrd are running for 2 months now together with
your mobkit on ZombieTest server. That was the first and only crash in a long
period of time. For being still alpha your mobkit is very stable and reliable.


Thermos is right, bugs has t be reported with original mobkit.

I've only changed two lines:

-- dumb friction
if self.isonground and not(self.can_fly) then


and


self.isinliquid = false
if not(self.can_fly) then
self.object:set_acceleration({x=0,y=mobkit.gravity,z=0})
end
 

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

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

by Termos » Sun Aug 04, 2019 12:54

runs wrote:-- dumb friction
if self.isonground and not(self.can_fly) then

I've seen your flying behavior, it seems to use the collisionbox-too-tall trick ;), that's why it's affected by friction.

Ultimately flying must be a separate behavior based on different principles than walking, and that much node awareness is redundant when flying anyway.
I feel flying must be synced with animation, alas, I've run into problems with that. I'd appreciate any help.

I hope I did something wrong there, because fixing engine bugs seems to take forever.

StarNinjas wrote:Hello, I think you should look into CME and make it more like that, also it would be awesome if you could add support for playereffects, so mobs could inflict magical dmg. Red flash would be cool too.

Mobkit is an api and has no dependencies, that means it supports anything that can be done using minetest api and is compatible with other mods, including playereffects, red flashes and other colors as well.
 

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

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

by Termos » Mon Aug 05, 2019 16:44

Small bugfix release
0.10.31

- mobkit.remember now also returns the passed value.
- mobkit.hurt and mobkit.heal now keep it in <0,max_hp> range
- fixed possible crash when a mob is commanded to go to its' own position.
Last edited by Termos on Wed Aug 07, 2019 11:54, edited 1 time in total.
 

User avatar
runs
Member
 
Posts: 675
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

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

by runs » Tue Aug 06, 2019 10:06

Thanx for the new version.

I feel flying must be synced with animation, alas, I've run into problems with that. I'd appreciate any help.


I can't be much help, I don't know much, to say almost nothing, of animations.
 

User avatar
StarNinjas
Member
 
Posts: 274
Joined: Wed Mar 14, 2018 00:32
Location: aincrad
GitHub: starninjas
IRC: StarNinjas
In-game: J1
 

User avatar
runs
Member
 
Posts: 675
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

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

by runs » Wed Aug 07, 2019 00:21

Hi Thermos I report you an error in line 346

luaent.hp = min(self.max_hp,(luaent.hp or 0) + dmg)

it should be:

luaent.hp = min(luaent.max_hp,(luaent.hp or 0) + dmg)
 

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

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

by Termos » Wed Aug 07, 2019 10:03

runs wrote:Hi Thermos I report you an error in line 346

Examples don't use heal, that's why it slipped through testing, thanks.

Ver 0.10.32
 

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

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

by Termos » Wed Aug 07, 2019 11:49

StarNinjas wrote:@Termos could you show me how?

Short answer, you code using minetest api and other mods of your choice as you normally would.

Mobkit is an api, that is a set of functions and standards for modders to help them code their own entities. It is not a self contained mod and it does't define any entities itself.
Well, there are example mods included, but they are just that, examples, their main function is to provide example code for modders.

The api doesn't depend nor is aware of any other mods, and will never be, that's why you can use any other mod/api alongside it, including playereffects.

For details on how to use mobkit see mobkit_api.txt and examples.
 

PreviousNext

Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 5 guests