[Mod] Mobs Redo [1.56] [mobs]

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

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

by TenPlus1 » Post

@BlueTangs Rock - Nope, it's just a test function I put in there for sheep to show modders how to do herds using the on_spawn() feature inside mobs:spawn()

User avatar
duckgo
Member
Posts: 128
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

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

by duckgo » Post

Hello, I wanted to ask something that maybe exists but I couldn't find it..
It has a feature for, for example, the mob "during the day, don't move", this other one may not have it, "don't move sideways"?.. I don't know if it has these features, but if not, although I know that it would be used a lot, but it would be interesting and a suggestion..
This question came to my mind, when I was trying to make a "Huggy Wuggy" where during the day he stands still, at night he attacks the player.. :)
🎮 Nice Texture 🎮 Mods 🎮 youtube channel 🎮

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

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

by TenPlus1 » Post

You can use the do_custom() function inside each mob to detect wether it is daytime and to force a self.state = "stand" so it doesn't move. Check out the API.txt file for information.

User avatar
duckgo
Member
Posts: 128
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

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

by duckgo » Post

TenPlus1 wrote: ↑
Sat Oct 15, 2022 06:16
You can use the do_custom() function inside each mob to detect wether it is daytime and to force a self.state = "stand" so it doesn't move. Check out the API.txt file for information.
I looked at the API, and thought maybe I hadn't seen these features..
I'll look again, I'm quite a noob, I've already tried to figure out how to tell if it's day and night, but I'll keep trying..
Thanks again for your help and attention :)
🎮 Nice Texture 🎮 Mods 🎮 youtube channel 🎮

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

Test

by TenPlus1 » Post

@duckgo - Here's a quick example of a "Samgolye" npc that turns to stone at night time:

Code: Select all

mobs:register_mob("mymod:samgoyle", {
	type = "npc",
	passive = false,
	damage = 3,
	attack_type = "dogfight",
	attacks_monsters = true,
	attack_npcs = false,
	owner_loyal = true,
	hp_min = 10,
	hp_max = 20,
	armor = 100,
	collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3},
	visual = "mesh",
	mesh = "character.b3d", -- player model
	drawtype = "front",
	textures = {
		{"character.png"} -- player skin
	},
	makes_footstep_sound = true,
	sounds = {},
	walk_velocity = 2,
	run_velocity = 3,
	jump = true,
	drops = {
		{name = "default:stone", chance = 1, min = 1, max = 3},
	},
	water_damage = 0,
	lava_damage = 2,
	light_damage = 0,
	view_range = 8,
	fear_height = 3,
	animation = {
		speed_normal = 30,
		speed_run = 30,
		stand_start = 0,
		stand_end = 79,
		walk_start = 168,
		walk_end = 187,
		run_start = 168,
		run_end = 187,
		punch_start = 200,
		punch_end = 219
	},

	-- custom function that runs while mob is active
	do_custom = function(self, dtime)

		-- 1 second timer
		self.tod_timer = (self.tod_timer or 0) + dtime
		if self.tod_timer < 1 then return end
		self.tod_timer = 0

		-- check for night time
		local tod = (minetest.get_timeofday() or 0) * 24000
		local night = true
		if tod > 4500 and tod < 19500 then
			night = false
		end

		-- if night turn to stone and stop moving or attacking
		if night then
			-- only change npc texture once
			if not self.tod_night then
				self.object:set_properties({
					textures = {"default_stone.png"}
				})
			end
			-- do these every second to be sure
			self.state = "statue" -- not in api
			self:set_animation("stand")
			self:set_velocity(0)
			self.attack = nil
		else -- otherwise go back to normal
			-- only chance npc texture once
			if self.tod_night then
				self.object:set_properties({
					textures = {"character.png"}
				})
				self.state = "stand"
			end
		end
		self.tod_night = night -- backup night status for once only checks
	end
})

User avatar
duckgo
Member
Posts: 128
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

Re: Test

by duckgo » Post

TenPlus1 wrote: ↑
Sun Oct 16, 2022 08:07
@duckgo - Here's a quick example of a "Samgolye" npc that turns to stone at night time:

Code: Select all

mobs:register_mob("mymod:samgoyle", {
	type = "npc",
	passive = false,
	damage = 3,
	attack_type = "dogfight",
	attacks_monsters = true,
	attack_npcs = false,
	owner_loyal = true,
	hp_min = 10,
	hp_max = 20,
	armor = 100,
	collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3},
	visual = "mesh",
	mesh = "character.b3d", -- player model
	drawtype = "front",
	textures = {
		{"character.png"} -- player skin
	},
	makes_footstep_sound = true,
	sounds = {},
	walk_velocity = 2,
	run_velocity = 3,
	jump = true,
	drops = {
		{name = "default:stone", chance = 1, min = 1, max = 3},
	},
	water_damage = 0,
	lava_damage = 2,
	light_damage = 0,
	view_range = 8,
	fear_height = 3,
	animation = {
		speed_normal = 30,
		speed_run = 30,
		stand_start = 0,
		stand_end = 79,
		walk_start = 168,
		walk_end = 187,
		run_start = 168,
		run_end = 187,
		punch_start = 200,
		punch_end = 219
	},

	-- custom function that runs while mob is active
	do_custom = function(self, dtime)

		-- 1 second timer
		self.tod_timer = (self.tod_timer or 0) + dtime
		if self.tod_timer < 1 then return end
		self.tod_timer = 0

		-- check for night time
		local tod = (minetest.get_timeofday() or 0) * 24000
		local night = true
		if tod > 4500 and tod < 19500 then
			night = false
		end

		-- if night turn to stone and stop moving or attacking
		if night then
			-- only change npc texture once
			if not self.tod_night then
				self.object:set_properties({
					textures = {"default_stone.png"}
				})
			end
			-- do these every second to be sure
			self.state = "statue" -- not in api
			self:set_animation("stand")
			self:set_velocity(0)
			self.attack = nil
		else -- otherwise go back to normal
			-- only chance npc texture once
			if self.tod_night then
				self.object:set_properties({
					textures = {"character.png"}
				})
				self.state = "stand"
			end
		end
		self.tod_night = night -- backup night status for once only checks
	end
})

Thanks a lot ... From what I saw here, I had done something very similar, but when it was daytime, the animation was still the same, this will be very useful as a reference :)
🎮 Nice Texture 🎮 Mods 🎮 youtube channel 🎮

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

Update:

by TenPlus1 » Post

- Tree Monster textures changed (reported as too close to minecraft textures)
- Cobweb texture changes (same reason)

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

Update:

by TenPlus1 » Post

- Peaceful Player setting works properly for all players, and privelage for individuals.

User avatar
duckgo
Member
Posts: 128
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

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

by duckgo » Post

Hello Tenplus1, today I edited the sounds of Mobs Animal , balanced the volumes, tried to remove as much noise as possible, and some other things, I hope you like it, I put it here for download:
https://codeberg.org/duckgo/animals_songs/releases
🎮 Nice Texture 🎮 Mods 🎮 youtube channel 🎮

User avatar
Festus1965
Member
Posts: 3317
Joined: Sun Jan 03, 2016 11:58
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

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

by Festus1965 » Post

empty, I see just the readme.txt ?
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
duckgo
Member
Posts: 128
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

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

by duckgo » Post

Festus1965 wrote: ↑
Sat Oct 29, 2022 01:09
empty, I see just the readme.txt ?
did you download " animals_edit.zip "?
, the files are inside it ;)
🎮 Nice Texture 🎮 Mods 🎮 youtube channel 🎮

User avatar
Festus1965
Member
Posts: 3317
Joined: Sun Jan 03, 2016 11:58
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

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

by Festus1965 » Post

reload, and see them, even now in the old file
but the one I was looking for is not included - so nothing change for me
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
duckgo
Member
Posts: 128
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

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

by duckgo » Post

Festus1965 wrote: ↑
Sat Oct 29, 2022 14:17
reload, and see them, even now in the old file
but the one I was looking for is not included - so nothing change for me
it's just the animal sounds, it's not a mod, they were just edited... :)
🎮 Nice Texture 🎮 Mods 🎮 youtube channel 🎮

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

Update:

by TenPlus1 » Post

- 'looting_level' can be read from a tool's registered tool_capabilities to drop more items on mob death.
- 'looting_level' can also be read from a tool's metadata to override above setting.
- A max level of 3 is set for looting (you get number of drops + looting level, chance doesn't change).

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

Update:

by TenPlus1 » Post

- Replaced meatblock textures with licensed one's (not as pretty)
- Added raw meatblock which can be crafted with raw meat
- Raw meatblock can be cooked into meatblock (faster then induvidually)

User avatar
Liil
Member
Posts: 79
Joined: Thu Dec 03, 2020 15:29

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

by Liil » Post

I really love this API.

What I would like to have is an "flee by damage" option. If a mobs gets a defined amount of damage in a specific time of seconds, it flees.
Why this ability? Because you can guide monsters to a place where they cannot attack you (House, Tree top) but you can attack them. This makes it easy to kill also monsters with much HP. By adding the "flee by damage" function, they will flee, if they get a specific amount of damage in a specific time range. This allows the monsters to flee to a defined range of nodes, if heavily attacked.

Another thing I would really like would be swimming on water. Now it is possible to make mobs die in water, let them walk bouncy on water, or let them swim into fluids. But what I am missing is that mobs can elegant swim onto the surface of water, not jumping around.
cdb_xMf8awymgVmp

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests