[Mod] Mobs Redo [1.61] [mobs]

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

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

by sirrobzeroone » Post

Image

Had another go at fixing the Cow up with what I learnt from doing the Warthog. I had no luck saving the original textures so I just went with a grey and brown cow based on the other cows texture I did (based on Tyrol Grey and Simmental). Converted from .X to .b3d and straightened the mesh mapping out.

Textures are 128 X 128 and textured as 2px=1px, size is about 4kb's. A few new animations added as I had those done before. 2x Standing, Walk, Run, Punch and Die - Die is currently disabled in Lua as I couldn't make it stop looping (even with false). Triple checked the blender file and definitely no loop their. Anyways no big issue I don't think, the rest all work okay.

Zip has the lua, the 2x texture files, new inv Icon and the .blend file and .xcf file. If Tenplus1 updates the main pack this would make the other solo cow I released not work as the meshes will be named the same. Don't worry have plans for the Cow and it will come back in a Modpack with hopefully some friends :).
Attachments
Cow.zip
(353.01 KiB) Downloaded 83 times
cow_preview.png
cow_preview.png (62.99 KiB) Viewed 657 times

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

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

by TenPlus1 » Post

Nice one sirrobzeroone, your models are pretty good :) will test them and maybe include them inside mobs animals if that's ok :)

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

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

by runs » Post

sirrobzeroone wrote:Image

Had another go at fixing the Cow up with what I learnt from doing the Warthog. I had no luck saving the original textures so I just went with a grey and brown cow based on the other cows texture I did (based on Tyrol Grey and Simmental). Converted from .X to .b3d and straightened the mesh mapping out.

Textures are 128 X 128 and textured as 2px=1px, size is about 4kb's. A few new animations added as I had those done before. 2x Standing, Walk, Run, Punch and Die - Die is currently disabled in Lua as I couldn't make it stop looping (even with false). Triple checked the blender file and definitely no loop their. Anyways no big issue I don't think, the rest all work okay.

Zip has the lua, the 2x texture files, new inv Icon and the .blend file and .xcf file. If Tenplus1 updates the main pack this would make the other solo cow I released not work as the meshes will be named the same. Don't worry have plans for the Cow and it will come back in a Modpack with hopefully some friends :).
Those textures do justice!

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

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

by FreeGamers » Post

sirrobzeroone wrote:Image

Had another go at fixing the Cow up with what I learnt from doing the Warthog. I had no luck saving the original textures so I just went with a grey and brown cow based on the other cows texture I did (based on Tyrol Grey and Simmental). Converted from .X to .b3d and straightened the mesh mapping out.

Textures are 128 X 128 and textured as 2px=1px, size is about 4kb's. A few new animations added as I had those done before. 2x Standing, Walk, Run, Punch and Die - Die is currently disabled in Lua as I couldn't make it stop looping (even with false). Triple checked the blender file and definitely no loop their. Anyways no big issue I don't think, the rest all work okay.

Zip has the lua, the 2x texture files, new inv Icon and the .blend file and .xcf file. If Tenplus1 updates the main pack this would make the other solo cow I released not work as the meshes will be named the same. Don't worry have plans for the Cow and it will come back in a Modpack with hopefully some friends :).
I've installed this on my world and have played around with it for about 10 minutes. Looks good to me! It is definitely more cow-y. The previous model had grown on me, but I must agree this is a bit more faithful to the game. Thanks for the contribution!
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

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

by sirrobzeroone » Post

All good with me Tenplus1, anything I ever do would be cc0/Public Domain :)

Thanks Runs and Jeremy :)

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

Mobs Animal Update...

by TenPlus1 » Post

- Added new Cow model and textures by sirrobzeroone
- Added new inventory textures for rat, panda, penguin and sheep

Note: Yes I know that the death animation is a little flakey at times, this is being worked on :P
Last edited by TenPlus1 on Sun Jun 02, 2019 09:54, edited 1 time in total.

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

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

by sirrobzeroone » Post

I was hoping to get these up before you updated Tenplus1 :). I hope to convert the bee model to b3d next week.

Now I worked out how to get models into blender, I did the remaining missing animals little 3d inv icons. The sheep was the most annoying, basically ended up recoloring it as it was to pixelated due to the massive array of colors in the texture :)

preview scaled up by a factor 4x (I'll take suggestions, but bear in mind they are normally 1/4 this size :))
Image
mobs_missing_inv.zip
(4.67 KiB) Downloaded 244 times
Attachments
the rest preview.png
the rest preview.png (5.27 KiB) Viewed 657 times

Sokomine
Member
Posts: 4287
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

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

by Sokomine » Post

sirrobzeroone wrote: A few new animations added as I had those done before. 2x Standing, Walk, Run, Punch and Die
Would it be possible to do a lie-down animation? Those poor cows need to relax (and re-eat their food) sometimes! Maybe (very rarely) fertilizing their meadow might also be appropriate behaviour for a cow.

And: Thanks for adding inventory images! Those eggs for animals that don't lay eggs did always bother me.
A list of my mods can be found here.

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

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

by TenPlus1 » Post

I suppose we could repurpose the cow dying animation and use those frames for a different stand animation to make it look like they are lying down on occasion.

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

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

by Termos » Post

TenPlus1 wrote:I suppose we could repurpose the cow dying animation and use those frames for a different stand animation to make it look like they are lying down on occasion.
Quick n dirty: set_properties() to raise the bottom collision box face, their legs will sink into the ground.

redblade7
Member
Posts: 316
Joined: Sun Feb 15, 2015 07:14
IRC: redneonglow redblade7
In-game: redblade7 redblade7_owner

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

by redblade7 » Post

mob_horse is crashing servers, I was told the crash happens when people try riding a baby horse:
2019-06-14 11:46:02: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mob_horse' in callback luaentity_Step(): (REMOVED)/bin/../games/minetest_game/mods/mobs/mount.lua:215: attempt to perform arithmetic on a nil value
2019-06-14 11:46:02: ERROR[Main]: stack traceback:
2019-06-14 11:46:02: ERROR[Main]: (REMOVED)/bin/../games/minetest_game/mods/mobs/mount.lua:215: in function 'drive'
2019-06-14 11:46:02: ERROR[Main]: (REMOVED)/bin/../games/minetest_game/mods/mob_horse/init.lua:71: in function 'do_custom'
2019-06-14 11:46:02: ERROR[Main]: (REMOVED)/bin/../games/minetest_game/mods/mobs/api.lua:3190: in function <(REMOVED)/bin/../games/minetest_game/mods/mobs/api.lua:3104>
-redblade7, admin of: THE CREATIVE GARDENS (creative), THE VALLEYS (sandbox), and THE DIGITAL FARMS (farming/hunger/shops)

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

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

by sirrobzeroone » Post

Just finished up the bee, was a bit painful converting, ill go back and have a look at the cow see if I can add a lay down and chew cud, might take me a little bit of time as I'm finishing up a woodworking project irl (loft bunkbed).

Hopefully I've got the bee about right on converting to b3d, I saved the original texture as much as possible although down sampled it from 128x128 to 64x64 more for consistency than anything (i could easily re-up sample) and re-did the uv map so its a little clearer which bits are what...why do insects have to have 6 legs....

Image

All the bits including blend file are inside the attached zip.
Attachments
mobs_bee_preview.png
mobs_bee_preview.png (1.83 KiB) Viewed 657 times
Bee.zip
(181.74 KiB) Downloaded 52 times

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

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

by TenPlus1 » Post

Redblade, it looks like a player was riding the horse and someone killed the horse resulting in a nil value, will fix :) also I've made it so that child horses cannot be ridden :P

SystemError
Member
Posts: 15
Joined: Thu Dec 27, 2018 15:02
In-game: Havoc

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

by SystemError » Post

Hello TenPlus1
On your latest version of MobsRedo my custom mobs don't hurt each others anymore and i couldn't figure out why.
Have you changed anyhting in the way they interact ?
Are you threatening me !?

SystemError
Member
Posts: 15
Joined: Thu Dec 27, 2018 15:02
In-game: Havoc

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

by SystemError » Post

Sorry, I have two other stupid questions:

How do I make my blacksmith drop just one sword and how do I make him say his interactions just once and not like 5 times when i talk to him a cuplle of times ?

Here are the lines of code which I used

view_range = 22,
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
local_chat = function(pos,text,radius)
if radius == nil then
radius = 20
end
if pos ~= nil then
local oir = minetest.get_objects_inside_radius(pos, radius)
for _,p in pairs(oir) do
if p:is_player() then
minetest.chat_send_player(p:get_player_name(),text)
end
end
end
end
if item:get_name() == "mobs:meat" or item:get_name() == "farming:bread" then
local hp = self.object:get_hp()
local_chat(clicker:getpos(),"Blacksmith: Thank you!",3)
if hp + 4 > self.hp_max then return end
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
self.object:set_hp(hp+4)

else
if self.owner == "" then
self.owner = clicker:get_player_name()
else
local formspec = "size[8,4]"
formspec = formspec .. "textlist[2.85,0;2.1,0.5;dialog;What do you need ?]"
-- formspec = formspec .. "button_exit[1,1;2,2;gfollow;Come on let's go]"
formspec = formspec .. "button_exit[5,1;2,2;gtalk;It's me!]"
formspec = formspec .. "button_exit[0,2;4,4;gswst;Steel Sword!]"
formspec = formspec .. "button_exit[4,2;4,4;gsandp;How is it going ?]"
minetest.show_formspec(clicker:get_player_name(), "order", formspec)
minetest.register_on_player_receive_fields(function(clicker, formname, fields)
-- if fields.gfollow then
-- self.order = "follow"
-- local_chat(clicker:getpos(),"Citizen: Okay!",3)
-- end
if fields.gtalk then
local_chat(clicker:getpos(),"Blacksmith: Wanna use my hammer again ? No homo!",3)
end
if fields.gswst then
local formspec = "size[6,3]"
formspec = formspec .. "textlist[2.85,0;2.1,0.5;dialog;This will cost you 30 gold]"
formspec = formspec .. "button_exit[1,1;2,2;gy;Sure]"
formspec = formspec .. "button_exit[5,1;2,2;gn;No!]"
minetest.show_formspec(clicker:get_player_name(), "order", formspec)
minetest.register_on_player_receive_fields(function(clicker, formname, fields)
if fields.gy then
-- if item:get_name() == "default:gold_lump" then
if item:get_name() =="default:gold_lump" and
item:get_count() == 30 then
-- if item == {"default:gold_lump", count=30} then
-- if item == ({ name = "default:gold_lump", count = 30 }) then
local_chat(clicker:getpos(),"Blacksmith: Hey hey!",3)
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
local pos = self.object:getpos()
pos.y = pos.y + 1
minetest.spawn_item(pos, "default:sword_steel")
-- minetest.add_item(pos, {name = "default:sword_steel"})
return
else
local_chat(clicker:getpos(),"Blacksmith: Show me 30 gold lumps, then say 'sure'!",3)
return
end
end
if fields.gn then
return
end
end)
end
if fields.gsandp then
local_chat(clicker:getpos(),"Blacksmith: Fuck off!",3)
local target_pos = { x=0, y=1, z=0 }
clicker:moveto( target_pos, false);
end
end)

end
end
end,
-- model animation
Are you threatening me !?

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

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

by TenPlus1 » Post

This may help you with custom mob attacks: https://notabug.org/TenPlus1/mobs_redo/ ... pi.txt#L82

...as for saying something once only, you could add a flag e.g. self.say_text_done and set to true when npc has said something so that it doesn't happen again... If it's once only per player you would need a table containing player names e.g. self.say_true[playername] to check from instead :)

SystemError
Member
Posts: 15
Joined: Thu Dec 27, 2018 15:02
In-game: Havoc

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

by SystemError » Post

I think the problem of attacking without hurting the target isn't in the code of my mobs, because they worked well in the last version of your mod.

Could you maybe write me an example of how to put in this "self.say_text_done " line ?
Im very noobish and don't even know what a flag is :o
Are you threatening me !?

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

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

by sirrobzeroone » Post

I added a laying down animation and made it 30 seconds long, so about an 1 hr in game time. However I am seeing some oddish behavior.

Cow will jump between optional stand behaviors mid lay down behavior, removing all other stands and lowering the walk chance helps but then the cow can take 2-3 tries before it finally lays down sometimes.

Anyways the animation is there but Im going to try and add some custom code under the on_custom to make it work more smoothly. I think I can use the on_custom to make the laying down sit outside the regular animation cycle and lock it there until it's cycled through at least once. Happy to take suggestions and ideas :)

Image

User avatar
TumeniNodes
Member
Posts: 2943
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

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

by TumeniNodes » Post

unrelated idea, since you seem to be pretty good at this stuff, perhaps you can try to add animation to doors/trap doors and even chests.
using two states (open and close) is "ok" but to have a smooth animation to them would be sweet.
A Wonderful World

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

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

by TenPlus1 » Post

sirrobzeroone: having a lay down animation as one of the 'stand' anims would suffice :) then I could lower the chance of walking so they lay down/stand longer.

TumeniNodes: that sounds flashy :) a professional feel to the doors/trapdoors.

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

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

by sirrobzeroone » Post

Ill have to have a look at those chests sounds interesting.

I got the do_custom working pretty well...not sure it's the prettiest code and you can slaughter a cow without it fighting back but it works pretty smoothly - stole most of it from the chicken and kitten. One question I do have is their an self.state = "jump" or anyway to tell a mob is currently in jump state. Just looks a little odd if they are trying to jump and lay down. They do this odd little bounce thing.

I'll leave the code in Tenplus1 figure you can either use it or discard it :)
Oh the random is currently to low but I didnt want to wait around for 2 mins while a cow decided to sit...

sdn = sit down animation segment
lay = laying down
sup = stand up animation segment

Could get fancy and have them lay down for a random amount of time was why i broke them up.

Code: Select all

	do_custom = function (self, dtime)
		ran_num = math.random (1, 1000)
		
		if ran_num == 1 or self.delay_lay == 1 then
			self.state = "sdn"
			self.object:set_velocity({x = 0, y = 0, z = 0})
			mobs:set_animation(self, "sdn")
			
			self.lay_timer = (self.lay_timer or 0) + dtime
				while (self.lay_timer <= 1.1) do
					--minetest.chat_send_player("singleplayer",self.name..self.lay_timer)
					self.delay_lay = 1 
					return
				end
			self.state = "lay"
			mobs:set_animation(self, "lay")
					while (self.lay_timer <= 31.3) do
					--minetest.chat_send_player("singleplayer",self.name..self.lay_timer)
					self.delay_lay = 1
					return
				end
				

			self.state = "sup"
			mobs:set_animation(self, "sup")	
			
			self.delay_lay = 0
			self.lay_timer = 0
			self.state = "walk"	
                    else
		end
	end,
edit: forgot to say little bit more testing to go

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

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

by sirrobzeroone » Post

Image

I think it's good enough, I managed the squash the odd water behavior so now the cow wont try and lay down while swimming. I couldn't find a hook for jumping so no luck there. Theres also a slight Graphic hitch if your holding hay and near a laying cow but not close enough so that the cow wont try and walk to you it will insta-stand and sit again (less than 1 sec), something to do with the follow sequence i'd guess. From what I can tell you can feed cows on the ground no worries and milk them....okay not the best on the milking :).

I've included the full cow contents in the zip including the old no-laying version (just in case), plus all the relevant blend files (old and new) etc.

code for the curious -

Code: Select all

	do_custom = function (self, dtime)
		local post = self.object:get_pos()
		local node = minetest.get_node({x=post.x,y=post.y,z=post.z})		
		local node2 = minetest.get_node({x=post.x,y=post.y-1,z=post.z}) -- Bobbing causes node.name==air at times, which causes odd animation behaviour 

		-----------------------------------
		-- Prevent sitting down in water --
		-----------------------------------
		if node2.name == "default:water_source" or node2.name == "default:river_water_source" or node.name == "default:water_source" or node.name == "default:river_water_source" then
				if self.state == "lay" or self.state == "sdn" then     -- Catch to reset any cow back to walking who happens to end up in water laying down
					self.cowlay_delay = 0                              -- reset Override to skip back into lay animation sequence if its already started                       
					self.cowlay_timer = 0                              -- reset Animation timer so each animation runs in the correct sequence without prematurely ending the previous animation
					self.state = "walk"
				end	        
		else
			ran_num = math.random (1, 2000)                            -- Cow will lay down approximatly once every 1min 30secs (wanted random rather than specific timed), 
			                                                           -- increase number for lower chance +1000 = +45second delay approximatly		
			if ran_num == 1 or self.cowlay_delay == 1 then             -- Start with sit down animation - sdn
				self.state = "sdn"                              
				self.object:set_velocity({x = 0, y = 0, z = 0})
				mobs:set_animation(self, "sdn")
			
				self.cowlay_timer = (self.cowlay_timer or 0) + dtime   -- Add a delay so the sdn animation ends before lay starts
					while (self.cowlay_timer <= 1.1) do           
							self.cowlay_delay = 1 
						return
					end
				self.state = "lay"
				mobs:set_animation(self, "lay")                        -- Start lay animation
						while (self.cowlay_timer <= 31.3) do           -- Add delay so stand up animation dosen't start before lay has ended.
							self.cowlay_delay = 1                      -- Not required but for consistancy included
						return
					end
				
				self.state = "sup"                                   
				mobs:set_animation(self, "sup")	                       -- Stand up animation
				self.cowlay_delay = 0                                  -- Reset Overide
				self.cowlay_timer = 0                                  -- Reset Timer
				self.state = "walk"                                    -- Set cow state back to walking
				
			end
		end
	end,	
edit: forgot to say the full animation string is from 195 to 975 and it will run in sequence; sit down>>laying>>standup full cycle about 35 seconds.
Cow (laying).zip
(772.83 KiB) Downloaded 37 times
Attachments
cow_laying.png
cow_laying.png (265.99 KiB) Viewed 657 times

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

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

by sirrobzeroone » Post

I was trying to re-texture the rat and it's texture map was very oddly laid out, lots of overlaps and unused space and sizing oddities.

just a simple re-layout of the UV_Map and conversion of the current textures to the new map. Some slight sizing changes were needed as some of the elements were hyper-detailed and others hyper-undetailed eg ears vs tail. otherwise unchanged but should make re-texturing for anyone easier. The gimp xcf file in the attached zip contains an approximate map of the UV map as I named all the layers carefully. Also included the blend file new textures and the original UV_Map export in svg format...I probably need to start uploading the blend files somewhere is there a central repository I could add to?

edit: Both mobs_rat and mobs_rat2 were converted to new UV layout :).

Image
mobs_rat.zip
(119.44 KiB) Downloaded 52 times
Attachments
mobs_rat_preview.png
mobs_rat_preview.png (25.48 KiB) Viewed 657 times

User avatar
TumeniNodes
Member
Posts: 2943
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

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

by TumeniNodes » Post

sirrobzeroone wrote:I was trying to re-texture the rat and it's texture map was very oddly laid out, lots of overlaps and unused space and sizing oddities.

just a simple re-layout of the UV_Map and conversion of the current textures to the new map. Some slight sizing changes were needed as some of the elements were hyper-detailed and others hyper-undetailed eg ears vs tail. otherwise unchanged but should make re-texturing for anyone easier. The gimp xcf file in the attached zip contains an approximate map of the UV map as I named all the layers carefully. Also included the blend file new textures and the original UV_Map export in svg format...I probably need to start uploading the blend files somewhere is there a central repository I could add to?
I feel all source files should be included with mods in a folder title "source" and then adding sub folders accordingly, .blend, .xcf, .svg, etc. for these very such reasons.
Working from source files beats mucking around with raster files any day.
A Wonderful World

SystemError
Member
Posts: 15
Joined: Thu Dec 27, 2018 15:02
In-game: Havoc

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

by SystemError » Post

Did you find out why mobs don't hurt each other anymore ? (except with shoot attack)
Is it maybe the new raycasting ?

And could you tell me how I make another mob entity except monsters attack players ?
just adding "attack_players = true" doesn't work (neither in single palyer or as server hoster or without creative mode)
Are you threatening me !?

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 19 guests