[Mod] Mobs Redo [1.61] [mobs]

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

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: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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 » Post

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: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

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

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

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

by wziard » Post

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: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

Fixed :) thanks wziard...

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

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

by jas » Post

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: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

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

by jas » Post

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: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

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

by Lone_Wolf » Post

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
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

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

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

by Chibi ghost » Post

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: 452
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

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

by davidthecreator » Post

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: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

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.

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

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

by Chibi ghost » Post

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: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

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

by jas » Post

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
Member
Posts: 11
Joined: Tue Jun 05, 2018 20:37
GitHub: WoosterUK

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

by Wooster » Post

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.

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

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

by Chibi ghost » Post

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

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

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

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

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

by Chibi ghost » Post

ta very much

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

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

by Chibi ghost » Post

got kicked twice when I tried to feed a lamb might be a problem

Code: Select all

2018-12-15 19:39:29: ACTION[Server]: Ghost joins game. List of players: Ghost
2018-12-15 19:39:38: ACTION[Server]: Ghost right-clicks object 1149: LuaEntitySAO at (135.683,12,543.113)
2018-12-15 19:39:38: ACTION[Server]: Ghost right-clicks object 1149: LuaEntitySAO at (135.683,12,543.113)
2018-12-15 19:39:38: ACTION[Server]: Ghost right-clicks object 1149: LuaEntitySAO at (135.683,12,543.113)
2018-12-15 19:39:39: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback luaentity_Rightclick(): ...inetest-0.4.17.1-win32\bin\..\mods\mobs_animal/sheep.lua:98: attempt to compare number with nil
2018-12-15 19:39:39: ERROR[Main]: stack traceback:
2018-12-15 19:39:39: ERROR[Main]: 	...inetest-0.4.17.1-win32\bin\..\mods\mobs_animal/sheep.lua:98: in function <...inetest-0.4.17.1-win32\bin\..\mods\mobs_animal/sheep.lua:92>
2018-12-15 19:39:39: ACTION[Server]: Ghost leaves game. List of players:

User avatar
Lupercus
Member
Posts: 30
Joined: Tue Jan 03, 2017 02:08
GitHub: lupercus13
IRC: Lupercus-Server
In-game: Lupercus

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

by Lupercus » Post

latest version of minetest 5.0dev breaks mobs_redo

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

How can I check if capture_mob was successful? This function does not return true/false (I watched the code).

Suggestion: It returns the new entity or nil.
Suggestion 2: Add support for the upcoming 'fireflies:bug_net'

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

mobs:capture_mob() does indeed return true or false when attempting to capture a mob...

Chibi + Lupercus: mobs animals updated with fix for 5.0x error.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 24 guests