[Mod] Mobs Redo [1.48] [mobs]

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

Re: [Mod] Mobs Redo [1.47] [mobs]

by runs » Mon Dec 03, 2018 11:58

TenPlus1 wrote:npc uses the player model so sit and lay down animations are there to use, also the do_custom function can be added to any mob which let's you do anything Inc. flying, you just gotta code it.


And do_custom overrides the default behaviour or inherited it?
 

User avatar
TenPlus1
Member
 
Posts: 2422
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.48] [mobs]

by TenPlus1 » Tue Dec 04, 2018 14:44

Updated to version 1.48:

- Added mobs:set_velocity(self, velocity) as global function
- Texture replacements for pork, mutton and rabbit in mobs_animal


runs: do_custom can both replace or suppliment mob api. check the api.txt for features.
 

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

Re: [Mod] Mobs Redo [1.48] [mobs]

by runs » Tue Dec 04, 2018 20:58

TenPlus1 wrote:Updated to version 1.48:

- Added mobs:set_velocity(self, velocity) as global function
- Texture replacements for pork, mutton and rabbit in mobs_animal


runs: do_custom can both replace or suppliment mob api. check the api.txt for features.


Thanx.
 

pingu32
New member
 
Posts: 7
Joined: Sat Nov 24, 2018 16:39
IRC: juni
In-game: pingu32

Re: Mobs Redo 0.3 [mod]

by pingu32 » Thu Dec 06, 2018 19:05

TenPlus1 wrote:Lol, sadly no as I was aiming for a basic mob pack with default food items for the player... If enough people want it I can easily add it...

Here are the hunger values to be included in the Better HUD mod's hunger.lua file:

Code: Select all
if minetest.get_modpath("mobs") then
if mobs.mod and mobs.mod == "redo" then
   overwrite("mobs:cheese", 4)
   overwrite("mobs:meat", 8)
   overwrite("mobs:meat_raw", 4)
   overwrite("mobs:rat_cooked", 4)
   overwrite("mobs:honey", 2)
   overwrite("mobs:pork_raw", 3, "", 3)
   overwrite("mobs:pork_cooked", 8)
   overwrite("mobs:chicken_cooked", 6)
   overwrite("mobs:chicken_raw", 2, "", 3)
   overwrite("mobs:chicken_egg_fried", 2)
   overwrite("mobs:bucket_milk", 3, "bucket:bucket_empty")
else
   overwrite("mobs:meat", 4)
   overwrite("mobs:meat_raw", 1)
   overwrite("mobs:rat_cooked", 3)
end
end

How to Breed Animals like kittens and bunny
 

User avatar
TenPlus1
Member
 
Posts: 2422
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.48] [mobs]

by TenPlus1 » Fri Dec 07, 2018 11:47

Kittens breed by feeding them ethereal raw fish or rats, and bunny's by feeding them carrots or grass.
 

wziard
Member
 
Posts: 43
Joined: Mon Oct 29, 2018 19:12

Re: [Mod] Mobs Redo [1.48] [mobs]

by wziard » Sun Dec 09, 2018 07:44

Whoops, a server crash:

latest git in a recent 5.x dev version (but not the newest)

Code: Select all
2018-12-09 08:34:04: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mobs_animal' in callback luaentity_Step(): /home/mt/.minetest/mods/mobs_redo/api.lua:131: attempt to index a nil value
2018-12-09 08:34:04: ERROR[Main]: stack traceback:
2018-12-09 08:34:04: ERROR[Main]:       /home/mt/.minetest/mods/mobs_redo/api.lua:131: in function 'collision'
2018-12-09 08:34:04: ERROR[Main]:       /home/mt/.minetest/mods/mobs_redo/api.lua:152: in function 'set_velocity'
2018-12-09 08:34:04: ERROR[Main]:       /home/mt/.minetest/mods/mobs_redo/api.lua:1822: in function 'do_states'
2018-12-09 08:34:04: ERROR[Main]:       /home/mt/.minetest/mods/mobs_redo/api.lua:3036: in function </home/mt/.minetest/mods/mobs_redo/api.lua:2902>



The following patch seems to fix it. But I have no Idea what I'm doing here, just suppressing the error.

Code: Select all
--- a/api.lua
+++ b/api.lua
@@ -128,7 +128,7 @@ local collision = function(self)
        for _,object in ipairs(minetest.get_objects_inside_radius(pos, width)) do
 
                if object:is_player()
-               or (object:get_luaentity()._cmi_is_mob == true and object ~= self.object) then
+               or (object:get_luaentity() and (object:get_luaentity()._cmi_is_mob == true and object ~= self.object)) then
 
                        local pos2 = object:get_pos()
                        local vec  = {x = pos.x - pos2.x, z = pos.z - pos2.z}


I also opened an issue on notabug. If you need more info, let me know.
 

User avatar
TenPlus1
Member
 
Posts: 2422
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1
 

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

Re: [Mod] Mobs Redo [1.48] [mobs]

by runs » Tue Dec 11, 2018 10:05

Feature request: set_attribute(attribute, value) and get_attribute(attribute) like players.
 

User avatar
jas
Member
 
Posts: 267
Joined: Mon Jul 24, 2017 18:15
GitHub: jastevenson303
IRC: jas_
In-game: jas

Re: [Mod] Mobs Redo [1.48] [mobs]

by jas » Tue Dec 11, 2018 10:34

get_attribute and set_attribute are now deprecated. Now, there's get_meta() with its methods, like get and set.

Objects are the only things that don't use get_meta() now, I believe. Anyway, Lua Entities can store arbitrary key/values already.

But, if there's a good reason for ObjectRef:get_meta() luaentity:get_meta(), I think the minetest GitHub repo is the place to post the feature request.

Edit: Sorry, I messed that up. ObjectRefs can have get_meta, but maybe LuaEntities cannot.

Update: However I think Lua Entities are just tables, and not like ObjectRefs. Now I'm wondering if you can ObjectRef:get_luaentity().object:get_meta() <-- haha, that's redundant perhaps. Maybe just ObjectRef:get_meta(). Now I thought I knew the answer here, but I'm left more curious than before! Thanks and bye. :)
 

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

Re: [Mod] Mobs Redo [1.48] [mobs]

by runs » Tue Dec 11, 2018 17:42

jas wrote:get_attribute and set_attribute are now deprecated. Now, there's get_meta() with its methods, like get and set.

Objects are the only things that don't use get_meta() now, I believe. Anyway, Lua Entities can store arbitrary key/values already.

But, if there's a good reason for ObjectRef:get_meta() luaentity:get_meta(), I think the minetest GitHub repo is the place to post the feature request.

Edit: Sorry, I messed that up. ObjectRefs can have get_meta, but maybe LuaEntities cannot.

Update: However I think Lua Entities are just tables, and not like ObjectRefs. Now I'm wondering if you can ObjectRef:get_luaentity().object:get_meta() <-- haha, that's redundant perhaps. Maybe just ObjectRef:get_meta(). Now I thought I knew the answer here, but I'm left more curious than before! Thanks and bye. :)


Yes, meta is better. Only a 'player' has metadata. Base LuaEntities not, but it could be implemented, so my request is this.
 

User avatar
jas
Member
 
Posts: 267
Joined: Mon Jul 24, 2017 18:15
GitHub: jastevenson303
IRC: jas_
In-game: jas

Re: [Mod] Mobs Redo [1.48] [mobs]

by jas » Wed Dec 12, 2018 06:09

I thought lua entities contain a reference to an object, but themselves are just tables. Thus, self.this = that. Maybe I'm misunderstanding. Anyway mobs_redo is great.
 

User avatar
Lone_Wolf
Member
 
Posts: 1980
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf

Re: [Mod] Mobs Redo [1.48] [mobs]

by Lone_Wolf » Wed Dec 12, 2018 16:10

jas wrote:I thought lua entities contain a reference to an object, but themselves are just tables. Thus, self.this = that. Maybe I'm misunderstanding. Anyway mobs_redo is great.

Yes. You can store variables in lua entities with things like self.this = that
 

User avatar
Chibi ghost
Member
 
Posts: 785
Joined: Fri Jan 08, 2016 21:17
In-game: Ghost

Re: [Mod] Mobs Redo [1.48] [mobs]

by Chibi ghost » Wed Dec 12, 2018 19:05

okay I just updated to mobs animal and mobs api
and just how many wheat sheaths tame cows and sheep because I just fed one cow over 200 wheat
and 99 wheat to one sheep at this point they're going explode before they are tamed
 

User avatar
davidthecreator
Member
 
Posts: 272
Joined: Mon Aug 18, 2014 19:48
Location: Lithuania
GitHub: daviddoesminetest
In-game: DavidDoesMinetest

Re: [Mod] Mobs Redo [1.48] [mobs]

by davidthecreator » Wed Dec 12, 2018 19:45

Chibi ghost wrote: they're going explode before they are tamed


This should actually be a feature, if it isn't already.
 

User avatar
TenPlus1
Member
 
Posts: 2422
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.48] [mobs]

by TenPlus1 » Wed Dec 12, 2018 20:10

Chibi, are you sure it wasnt already tamed ? you can still feed them if they are :) Try right-clicking with an empty hand and it'll tell you who owns it.
 

User avatar
Chibi ghost
Member
 
Posts: 785
Joined: Fri Jan 08, 2016 21:17
In-game: Ghost

Re: [Mod] Mobs Redo [1.48] [mobs]

by Chibi ghost » Wed Dec 12, 2018 20:55

TenPlus1 wrote:Chibi, are you sure it wasn't already tamed? you can still feed them if they are :) Try right-clicking with an empty hand and it'll tell you who owns it.
even if I missed the notification I wouldn't have missed the hearts also when I tried to lasso them I got cow/sheep not tamed note
 

User avatar
jas
Member
 
Posts: 267
Joined: Mon Jul 24, 2017 18:15
GitHub: jastevenson303
IRC: jas_
In-game: jas

Re: [Mod] Mobs Redo [1.48] [mobs]

by jas » Wed Dec 12, 2018 21:26

davidthecreator wrote:
Chibi ghost wrote: they're going explode before they are tamed


This should actually be a feature, if it isn't already.

Code: Select all
on_rightclick = function(self, clicker)
  local explosive_clicks = self.explosive_clicks or 1
  if explosive_clicks == 50 then
    self.explosive_clicks = 0
    return tnt.boom(self.object:get_pos())
  end
  self.explosive_clicks = explosive_clicks + 1
  ... the rest of on_rightclick stuff (dye, feed/tame, etc) ...
end


Didn't try it, but it should work.
 

Wooster
New member
 
Posts: 5
Joined: Tue Jun 05, 2018 20:37
GitHub: WoosterUK

Re: [Mod] Mobs Redo [1.48] [mobs]

by Wooster » Wed Dec 12, 2018 21:41

Chibi ghost wrote:okay I just updated to mobs animal and mobs api
and just how many wheat sheaths tame cows and sheep because I just fed one cow over 200 wheat
and 99 wheat to one sheep at this point they're going explode before they are tamed

I noticed this in Xanadu also; I presume it's the same issue.
 

User avatar
Chibi ghost
Member
 
Posts: 785
Joined: Fri Jan 08, 2016 21:17
In-game: Ghost

Re: [Mod] Mobs Redo [1.48] [mobs]

by Chibi ghost » Thu Dec 13, 2018 09:57

it seems to be linked into the eat 8 grass to regenerate milk /wool add-on tenplus did
 

User avatar
TenPlus1
Member
 
Posts: 2422
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.48] [mobs]

by TenPlus1 » Thu Dec 13, 2018 19:08

Mobs Animals has been updated with a fix for taming of cows and sheep, oops!
 

User avatar
Chibi ghost
Member
 
Posts: 785
Joined: Fri Jan 08, 2016 21:17
In-game: Ghost
 

Previous

Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 4 guests