[Mod] Mobs Redo [1.61] [mobs]

Bastrabun
Member
Posts: 210
Joined: Mon Nov 04, 2019 19:48

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

by Bastrabun » Post

For certain events, I'd like to spawn mobs with different stats, sometimes from worldedit's lua command, sometimes from a commandblock. Different stats means different nametag, different damage, range, sight_range, hitpoints and so on.

So I do

//lua minetest.add_entity({x=1,y=2,z=3},"mobs_monster:sand_monster",minetest.serialize({hp_min=1000,hp_max=1000,nametag="Sandmonster+"})

The sandmonster does appear and when hit counts down from 1000 hitpoints. However, after I beat it down to ~950, it dies. I tried grabbing the object and assigning it health, doesn't work either. Looks like this is not the way to do it.

Any ideas how to spawn that mob with 1000 HP or other, different stats?
Whatever I say is CC0

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

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

by TenPlus1 » Post

Spawn your mob as usual but get the luaentity() information and edit that directly for values you want to change, check the api.txt for information:https://notabug.org/TenPlus1/mobs_redo/ ... i.txt#L318

Bastrabun
Member
Posts: 210
Joined: Mon Nov 04, 2019 19:48

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

by Bastrabun » Post

I tried it this way (linebreaks for readability):

Code: Select all

//lua 

local pname="Service" 
local monsta=minetest.add_entity(minetest.get_player_by_name(pname):get_pos(),"mobs_monster:sand_monster",minetest.serialize({hp_min=100,hp_max=200,nametag="Sandmonster+"}))
minetest.chat_send_player(pname,dump(monsta:get_luaentity().health))
monsta:get_luaentity().health=200
minetest.chat_send_player(pname,dump(monsta:get_luaentity().health))
I can see in the luaentity that hp_max is 200, hp_min is 100 and health is 200 as assigned. Only it dies after I deal it ~15 to 20 damage. It dutifully counts down from 200, but when it reaches 180 it dies.

What do I do wrong?
Whatever I say is CC0

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

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

by Liil » Post

I downloaded the new Minetest Version 5.4.0 today and copied my mods from 5.3.0

Now I get a shutdown every time a range unit hits a monster or the player:

Code: Select all

2021-02-24 23:39:14: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'livingnether' in callback luaentity_Step(): Invalid position (expected table got number).
2021-02-24 23:39:14: ERROR[Main]: stack traceback:
2021-02-24 23:39:14: ERROR[Main]: 	[C]: in function 'punch'
2021-02-24 23:39:14: ERROR[Main]: 	...test-5.4.0-win64\bin\..\mods\livingnether/sokaarcher.lua:85: in function 'hit_mob'
2021-02-24 23:39:14: ERROR[Main]: 	D:\minetest-5.4.0-win64\bin\..\mods\mobs_redo/api.lua:4181: in function <D:\minetest-5.4.0-win64\bin\..\mods\mobs_redo/api.lua:4107>
2021-02-24 23:39:14: ERROR[Main]: stack traceback:
2021-02-24 23:39:14: ERROR[Main]: 	[C]: in function 'punch'
2021-02-24 23:39:14: ERROR[Main]: 	...test-5.4.0-win64\bin\..\mods\livingnether/sokaarcher.lua:85: in function 'hit_mob'
2021-02-24 23:39:14: ERROR[Main]: 	D:\minetest-5.4.0-win64\bin\..\mods\mobs_redo/api.lua:4181: in function <D:\minetest-5.4.0-win64\bin\..\mods\mobs_redo/api.lua:4107>
2021-02-24 23:39:14: ACTION[Server]: singleplayer leaves game. List of players: 
2021-02-24 23:39:15: ACTION[Main]: Server: Shutting down
This only happens in new 5.4.0 not in 5.3.0
cdb_xMf8awymgVmp

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

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

by TenPlus1 » Post

@Lili - The sokarcher.lua arrow in the living nether mod is the issue here, instead of ending each punch function in ,0) it should end them with ,nil)

I've added a pull request to fix this issue.

User avatar
IFRFSX
Member
Posts: 71
Joined: Fri Mar 09, 2018 09:50
GitHub: IceCatX
In-game: IFRFSX

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

by IFRFSX » Post

Hi,Tenplus, I would like to ask, why the lua codes of the two mods "mobs_water" and "mobs_sky" in the notebug repository of Blert2112 and you have not set the license? (The github/notabug warehouse only has the license of texture and model)。
and, your mobs mods seems that there is no separate license for media.

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

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

by TenPlus1 » Post

@IFRFSX - License information is found inside each mod folder.

User avatar
IFRFSX
Member
Posts: 71
Joined: Fri Mar 09, 2018 09:50
GitHub: IceCatX
In-game: IFRFSX

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

by IFRFSX » Post

TenPlus1 wrote:
Fri Feb 26, 2021 21:33
@IFRFSX - License information is found inside each mod folder.
The license information of mobs_water and mobs_sky only includes the model and texture, but does not include the LUA code. and There is a folder(https://notabug.org/TenPlus1/mobs_water ... icense.txt) with the information written unknow.
Another reminder, the license.txt is missing from your mob_horse warehouse.

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

Update:

by TenPlus1 » Post

- Mobs Monster (new textures added, new spider types, new Land Guards and Tree Creeper)
- Mobs Water (license files updated, code tidy)
- Mobs Sky (license files updated, code tidy)
- Mob Horse (license file added)
Last edited by TenPlus1 on Tue Mar 02, 2021 18:14, edited 2 times in total.

User avatar
daret
Member
Posts: 136
Joined: Tue Nov 12, 2019 20:36
GitHub: daretmavi
In-game: Daretmavi

Re: Update:

by daret » Post

TenPlus1 wrote:
Tue Mar 02, 2021 08:05
- Mobs Monster (new textures added, new spider types)
Nice, I like it.

Maybe, if I could suggest...
  • Mese Monster - Can you change the Mese Monster texture? - remove the letters. It's immersion breaking. Something like in Minetest Extended would be sufficient.
  • Lava Monsters - mouth is not really visible, you have to be really close to see the mouth is not only texture, but 3D. Maybe it could be a little bit darker/lighter, or even better on attack the mouth could open gigantically :D

User avatar
freshreplicant
Member
Posts: 223
Joined: Sun Aug 09, 2020 10:37
In-game: freshreplicant

Re: Update:

by freshreplicant » Post

daret wrote:
Tue Mar 02, 2021 10:47
TenPlus1 wrote:
Tue Mar 02, 2021 08:05
- Mobs Monster (new textures added, new spider types)
Nice, I like it.

Maybe, if I could suggest...
  • Mese Monster - Can you change the Mese Monster texture? - remove the letters. It's immersion breaking. Something like in Minetest Extended would be sufficient.
  • Lava Monsters - mouth is not really visible, you have to be really close to see the mouth is not only texture, but 3D. Maybe it could be a little bit darker/lighter, or even better on attack the mouth could open gigantically :D
I find the RPG16 textures really great for the monsters, including the Mese Monster.

https://gitlab.com/Df458/rpg16/-/tree/m ... bs_monster

That being said, I generally find RPG16 to be great overall, so maybe I'm biased.

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

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

by TenPlus1 » Post

@freshreplicant - It's a very good texture pack and mobs do look great when using it :) I will however try to make a new mese monster skin for the default :)

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

Update:

by TenPlus1 » Post

- Added 'ignore_invisibility' setting in mob definition so that mobs are able to sense invisible players (invisibility mod only).

pevernow
Member
Posts: 10
Joined: Sun Oct 04, 2020 04:33
GitHub: pevernow
IRC: pevernow
In-game: pevernow

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

by pevernow » Post

I hope you can optimize the running efficiency. It is about 70% slower than mobkit. On some low performance machines, this is a very serious problem.
(Compared mobs_animals and wildlife)
@Tenplus

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

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

by TenPlus1 » Post

@pevernow - mobkit and mobs redo api's are both different in their running, one requires lua knowledge while the other is general purpose and offers many features ready for use. I am however always eager to make things run smoother and ideas are more than welcome :)

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

Update:

by TenPlus1 » Post

- Mobs can now follow or eat group items (e.g. Kitten now follows "group:food_fish_raw")

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

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

by MisterE » Post

Last time I tried to use mobs_redo to have a custom attack, I had alot of trouble setting the mob's attack target from within the do_custom function. IIRC, it could only be a player, and certain other variables had to be set, that really only worked as an internal process. IIRC, I gave up then, that was about a year ago. Has the situation improved? Is it easy to set a mob's attack target, and let it *not* just be a player?

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

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

by TenPlus1 » Post

@MisterE - The API has new features added to do many things but if you want to check and attack a specific mob you can use the specific_attack = {} option or get a list of entities around your mob and do mob_entity:do_attack(mob_to_attack.object) .. it all depends what you want to do.

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

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

by MisterE » Post

Yes that was it... the do_attack only took a player back then. I will see if it is fixed soon. Thank you.

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

Update:

by TenPlus1 » Post

- Added 'fire_damage' setting to mob definition (default: 4).
- Added Advanced Protector to stop _is_arrow and fire damage to tamed mobs.
- Updated Mobs_Monster and DMobs with new settings.

User avatar
Lokrates
Member
Posts: 25
Joined: Sun Dec 17, 2017 10:22
GitHub: Lokrates
Location: Lake Lucerne

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

by Lokrates » Post

Cats can no longer be tamed with rats.
In kitten.lua is an error on line 56
"mobs:rat" should be "mobs_animal:rat"
Hätte ich doch nur Englisch gelernt.

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

Updated:

by TenPlus1 » Post

- Added 'damage_group' for custom damage, e.g. "fleshy"
- Added 'damage_texture_modifier' for custom damage effect e.g. "^[brighten"
- Fixed kittens being tamed by rats
- Working on Fire Spirit mob, can be tested in singleplayer for now :)

marcocassisa
New member
Posts: 2
Joined: Thu May 27, 2021 13:33

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

by marcocassisa » Post

As I tried to punch a sheep, I got an error as a player and I have been disconnected - could you please help?
Thanks

Code: Select all

ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback luaentity_Punch(): /home/mr/.minetest/mods/mobs_redo/api.lua:2924: bad argument #1 to 'random' (interval is empty)
2021-05-27 15:24:19: ERROR[Main]: stack traceback:
2021-05-27 15:24:19: ERROR[Main]: 	[C]: in function 'random'
2021-05-27 15:24:19: ERROR[Main]: 	/home/mr/.minetest/mods/mobs_redo/api.lua:2924: in function </home/mr/.minetest/mods/mobs_redo/api.lua:2778>
api.lua at the relevant point

Code: Select all

                -- weapon sounds
                if weapon_def.sounds then
                        snd = weapon_def.sounds[random(#weapon_def.sounds)]
                else
                        snd = "default_punch"
                end

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

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

by TenPlus1 » Post

@marcocassisa - Weapon sounds fixed when punching mobs, out of curiosity, what did you hit the sheep with ?

marcocassisa
New member
Posts: 2
Joined: Thu May 27, 2021 13:33

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

by marcocassisa » Post

@TenPlus1 thank you for answering! Does this mean that I should download the code again?

About the weapon or stick I punched the sheep with: sorry, I can't tell because I don't know the weapons. I have only been asked to setup the server.
As animals apparently didn't spawn, I tried to play, getting around, finding one and trying to do the only thing I am able to do: pressing mouse-left.
On the other hand, I am not able to (willingly) change the stick/weapon, so I assume it is the standard one

Thanks again

MC

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 13 guests