[Mod] Mobs Redo [1.55] [mobs]

PetiAPocok
Member
Posts: 25
Joined: Thu Apr 23, 2020 14:43
GitHub: PetiAPocok
In-game: PetiAPocok
Location: Hungary

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

by PetiAPocok » Post

TenPlus1 wrote:
Thu Dec 31, 2020 14:50
@PetiAPocok - I'm not sure if entities support transparent faces just yet, it's either textured or 100% see through for now.
I checked it. It's supported but if there are two transparent TEXTURES next to each other and you look trough the first, the second one is invisible.

Bastrabun
Member
Posts: 136
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?

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

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: 136
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?

User avatar
Liil
Member
Posts: 22
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: 2962
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

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: 66
Joined: Fri Mar 09, 2018 09:50
GitHub: IFRFSX
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.
45.195.155.59, This is my server, port 30000, running web service! ; )

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

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

by TenPlus1 » Post

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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests