[Mod] Mobs Redo [1.61] [mobs]

mcaygerhard
Member
Posts: 129
Joined: Tue Mar 05, 2019 17:37
GitHub: mckaygerhard
IRC: mckaygerhard
In-game: mckaygerhard

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

by mcaygerhard » Post

TenPlus1 wrote:
Wed Jun 07, 2023 07:24
@mcaygerhard - htimer is no longer required so has been removed, api updated. Also mob api questions are fine, keep them in notabug though.
roger that! i really hate the forum

sockmit2007
New member
Posts: 3
Joined: Mon Jun 19, 2023 13:07

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

by sockmit2007 » Post

Is there a function similar to creatura's move function, or does that all have to be handled in do_custom if you want custom move behavior/ai?

BlueTangs Rock
Member
Posts: 204
Joined: Sun Jul 10, 2016 05:00
Location: Under Le' Sea

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

by BlueTangs Rock » Post

Greetings, if I wanted to edit mob drops in the mod configs folder, how would I do this? (For example, having the bonemeal mod's bone item dropping from creatures)
Look at that, a signiture box! To bad I have nothing to put in i-... Wait...

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

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

by TenPlus1 » Post

Editing the mob .lua file is the easiest methor unless you override the mob on_spawn to detect the bonemeal mod and use table.insert to insert a bone drop to the self.drops table.

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

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

by TenPlus1 » Post

@sockmit2007 - So far pathfinding only comes into play when a mob is attacking a player or another mob and it hunts it down, so using that theory here's a quick tool you can use on any block to make a local npc go to that spot:

Code: Select all

minetest.register_entity("mymod:pathfind_entity", {
	physical = false, static_save = false,
	armor = 200, hp_max = 1, _cmi_is_mob = true,
})

minetest.register_craftitem("mymod:pathfind_axe", {
	description = "Pathfind Axe",
	inventory_image = "default_tool_steelaxe.png",
	range = 10,
	on_use = function(itemstack, user, pointed_thing)
		if pointed_thing.type ~= "node" then return end
		local pos = pointed_thing.above
		local attack_obj = minetest.add_entity(pos, "mymod:pathfind_entity")
		local player_name = user:get_player_name()
		local objs = minetest.get_objects_inside_radius(pos, 30)
		for _, obj in pairs(objs) do
			if obj then
				local ent = obj:get_luaentity()
				if ent and ent._cmi_is_mob and ent.owner == player_name then
					ent:do_attack(attack_obj)
				end
			end
		end
	end,
})

sockmit2007
New member
Posts: 3
Joined: Mon Jun 19, 2023 13:07

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

by sockmit2007 » Post

@TenPlus1 Thanks.

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

Update:

by TenPlus1 » Post

- "immune_to" table can now have entity names e.g. {"mobs_monster:mese_arrow", 0} -- no damage

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

Re: Update:

by duckgo » Post

TenPlus1 wrote:
Sun Jul 02, 2023 16:23
- "immune_to" table can now have entity names e.g. {"mobs_monster:mese_arrow", 0} -- no damage
Very good, this will be very useful, it would be interesting an option for animals to follow the owner as Npcs, or follow another animal :)

User avatar
Nininik
Member
Posts: 577
Joined: Thu Apr 06, 2023 01:55
GitHub: nininik0
IRC: nininik
In-game: nininik
Location: CA, Team thunderstrike headquarters
Contact:

Re: Question:

by Nininik » Post

TenPlus1 wrote:
Sat Jul 23, 2022 06:00
How many players liked the old Mese Monster design ?
I HAVE THE OLD MESE MONSTER MODEL AND TEXTURE >:) do u need it?
↯Glory to Team Thunderstrike!↯
↯T.T.S.↯

User avatar
Neuromancer
Member
Posts: 964
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

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

by Neuromancer » Post

I'm working on a mod called hardcore_farming https://content.minetest.net/packages/N ... e_farming/. It creates a bunch of pests that ravenously devour your crops. I wanted to use the runaway_from parameter to make them stay away from crops that have an x_farming:scarecrow nearby, but since the scarecrow isn't a mob this doesn't appear to be working.

Code: Select all

runaway_from = {"animalworld:bear","x_farming:scarecrow","x_farming:scarecrow_2"}, 
Either that or the

Code: Select all

 stay_near = {{"group:crop"}, 4}, 
is overriding the runaway_from. Do you know which of these are the problem, and is this something that could be added to the functionality of this api?

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

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

by TenPlus1 » Post

@Neuromancer - The 'runaway_from' table only works for mobs, so that chickens runaway from wolves and the like. I will however see how easy it is to tie it into surrounding nodes as well.

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

Update:

by TenPlus1 » Post

- Can now add nodes and groups to the 'runaway_from' table.

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

Classic Mob

by TenPlus1 » Post

Quite a few players have asked to bring back the classic Mese Monster, so here you go :)

https://content.minetest.net/packages/T ... r_classic/

User avatar
Neuromancer
Member
Posts: 964
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

Re: Update:

by Neuromancer » Post

TenPlus1 wrote:
Sat Jul 15, 2023 07:59
- Can now add nodes and groups to the 'runaway_from' table.
Thank you! This works perfect. Now when there is a scarecrow, the pests run away from it and leave your crops alone!

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

Update:

by TenPlus1 » Post

- Better support for MineClone2 in API
- Recipes have MineClone2 alternatives
- Better player detection
- Ability to ride Mobs Redo mobs in MineClone2
- Added 'mob_log_spawn' setting to log mob spawn positions
- Velocity tweaks (thanks Savilli)

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

Update:

by TenPlus1 » Post

- Added settings to enable/disable animals in mobs_animal.
- Added settings to enable/disable monsters in mobs_monster.
- Mobs can be registered with mod names differing from actual mod it uses.
- Translations updated (thanks Niklp)
- Non-passive animals defend themselves when attacked by other mobs (thanks Fluxionary)

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

Update and Request:

by TenPlus1 » Post

I've updated Mobs Redo API to use initial_properties (init_WIP.lua) and would ask if some players would kindly download the update from my notabug page and give it a whirl to help me test things out before I upload to ContentDB for all :) Many thanks!

https://notabug.org/TenPlus1/mobs_redo

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

Update:

by TenPlus1 » Post

Many thanks for the testing you guys did with the WIP initial_properties changes. It seems that changing at present will break too many things, so for now the latest stable API will only backup important variables for each mob into the initial_properties table, that way we still have compatibility for future changes.

Chungus
New member
Posts: 1
Joined: Thu Oct 05, 2023 02:04

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

by Chungus » Post

New to this forum.
How can someone request a feature? I was hoping to see functionality to have the mob's head rotate and follow certain things with their gaze. Like maybe follow an animal, the player, or another object of interest depending on how close it is to the mob. The mobs api for Mineclone 2 has this, to a degree.

If I need to post this somewhere else, please provide guidance.

R,
C

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

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

by TenPlus1 » Post

@Chungus - It's a nice feature to have although I cannot promise anything as I work on this mod myself with player contributions at times.

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

Update:

by TenPlus1 » Post

- Now using set/get_properties()
- Added self.backup_properties to backup important vars for future compatibility
- Changed nametags from self.nametag to self._nametag with backwards compatibility check
- Updated api_WIP.lua for anyone testing move to initial_properties.

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

Updated to Version 1.60:

by TenPlus1 » Post

* Move mob and arrow entities to use initial_properties
* Spawn eggs check if mob is available when creating
* Used get/set_properties() within API for mob properties
* Moved nametag variable to self._nametag
* Tidied breeding function
* Better MineClone2 / MineClonia support added
* Tweaked and tidied code in places

Important: When updating Mobs Redo API, remember to also update Mobs_Monster, Mobs_Animal, Mobs_horse as well.
Last edited by TenPlus1 on Sun Oct 08, 2023 05:37, edited 1 time in total.

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

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

by Nordal » Post

After installing Version 1.60 I suddenly got this Error:

2023-10-08 02:07:08: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mobs_monster' in callback luaentity_Step(): ...etest-5.6.1/minetest/bin/../mods/mobs_monster/spider.lua:174: attempt to index field 'collisionbox' (a nil value)
2023-10-08 02:07:08: ERROR[Main]: stack traceback:
2023-10-08 02:07:08: ERROR[Main]: ...etest-5.6.1/minetest/bin/../mods/mobs_monster/spider.lua:174: in function 'do_custom'
2023-10-08 02:07:08: ERROR[Main]: .../roland/minetest-5.6.1/minetest/bin/../mods/mobs/api.lua:3529: in function <.../roland/minetest-5.6.1/minetest/bin/../mods/mobs/api.lua:3421>

Riding a horse of mob_horse it stops in front of every block it has to step up. Even in front of snow layers.
CFS - still widely unknown

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

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

by TenPlus1 » Post

@Nordal - Did you also update mobs_monster, mob_animal, mob_horse alongside mobs_redo api ?

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

Update and Advisory:

by TenPlus1 » Post

- Mob API updated to fix nil issue.
- Added mobs:node_ok(pos, fallback) function.
- Tweaked and tidied code.

The Simple Way

Before when using entities we could simply read values straight from the self. table and grab things like collisionbox and stepheight or even textures with ease (local sh = self.stepheight).

The New Way

Now with the work on the latest Minetest dev they are deprecating the old way and throwing up a multitude of warnings and errors to make modders use the new initial_properties table instead.

So now a simple self.collisionbox will now become self.object:get_properties().collisionbox instead.

Final Word

As you probably have guessed Mobs Redo has moved to using the new initial_properties table and a few glitches have creeped in along the way which should now be fixed. Sorry to anyone using my mod on a server that may have caused downtime.

If updating to the latest Mobs Redo, please be sure also update mobs_animal, mobs_monster, mob_horse as well, these have also been changed to work with the new API.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests