[Mod] D00Med mobs [dmobs]

User avatar
Grossam
Member
Posts: 39
Joined: Sun Apr 02, 2017 07:21
GitHub: Grossam
IRC: Grossam
In-game: Grossam
Location: Bourges
Contact:

Re: [Mod] D00Med mobs [dmobs]

by Grossam » Post

I made some changes in scifi_nodes too. You may have a look at them here : https://git.fwhost.eu/Grossam/scifi_nodes
Gloire à qui, n'ayant pas d'idéal sacro-saint,
Se borne à ne pas trop emmerder ses voisins.

klera
Member
Posts: 23
Joined: Tue Mar 03, 2020 12:18

Re: [Mod] D00Med mobs [dmobs]

by klera » Post

What do i have to change that Dragons spawn only at higher locations (30+) ? Don't like them in Woods or at Grasland when i spawn first. Thanks.

User avatar
Grossam
Member
Posts: 39
Joined: Sun Apr 02, 2017 07:21
GitHub: Grossam
IRC: Grossam
In-game: Grossam
Location: Bourges
Contact:

Re: [Mod] D00Med mobs [dmobs]

by Grossam » Post

All is in the spawn.lua file. You have to twead sime parameters of the mobs:spawn function. You 'll find some details in the mobs_redo API documentation.
Gloire à qui, n'ayant pas d'idéal sacro-saint,
Se borne à ne pas trop emmerder ses voisins.

klera
Member
Posts: 23
Joined: Tue Mar 03, 2020 12:18

Re: [Mod] D00Med mobs [dmobs]

by klera » Post

no idead where the documentation is, sorry.

This ist from the spawn.lua

-- dragons

mobs:register_spawn("dmobs:dragon", {"default:leaves","default:dirt_with_grass"}, 20, 10, 64000, 2, 31000)


Isnt the 2nd number the height? 20, ->10<-, 64000, 2, 31000
Last edited by klera on Mon Mar 30, 2020 01:44, edited 1 time in total.

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

Re: [Mod] D00Med mobs [dmobs]

by FreeGamers » Post

Read the api.txt included in the mobs_redo mod, which is the mod that dmobs uses to define mobs.

Read the section about spawn functions and tweak the height parameter to what you desire.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

klera
Member
Posts: 23
Joined: Tue Mar 03, 2020 12:18

Re: [Mod] D00Med mobs [dmobs]

by klera » Post

I am so stupid. always looked at the api in the dmobs folder.
But now i have read the entire file and still don't know what to change.

Maybe i am looking at the wrong file?

The first file was the spawn.lua file (dmod)
mobs:register_spawn("dmobs:dragon", {"default:leaves","default:dirt_with_grass"}, 20, 10, 64000, 2, 31000)

The 2nd file is the main.lua (dmod)
-- mobs:spawn_specific("dmobs:dragon", {"air"}, {"default:stone"}, 20, 10, 300, 15000, 2, -100, 11000)

The 3rd dragons_normal.lua
mobs:spawn_specific("dmobs:dragon", {"air"}, {"default:stone"}, 20, 10, 300, 15000, 2, -100, 11000)

If the Api is the solution:

'interval' is same as in register_abm() (default is 30)
'chance' is same as in register_abm() (default is 5000)
'min_light' is the minimum light level (default is 0)
'max_light' is the maximum light (default is 15)
'min_height' is the minimum height a mob can spawn (default: -31000)
'max_height' is the maximum height a mob can spawn (default is 31000)

6 option for 7 values..so I'm guessing:

20 (inverall), 10 (chance), 300, 15000, 2, -100 (min_height), 11000 (max_height)

User avatar
Melkor
Member
Posts: 358
Joined: Sat Sep 24, 2011 01:03
Location: Underground

Re: [Mod] D00Med mobs [dmobs]

by Melkor » Post

D00Med wrote:
d00med we have to talk of which animals should be big and not.
Next in line will be tiny dragons.

Bronze golem:
Image
wow nice pixel art in this golem, did you make the texture?

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

Re: [Mod] D00Med mobs [dmobs]

by FreeGamers » Post

klera, I find it helpful to keep definition templates near the API's themselves.
Here is a spawn function for a zombie in my server:

Code: Select all

--Spawn Functions
mobs:spawn_specific("mobs_creatures:zombie", {"default:dirt_with_grass","default:dirt","default:stone"}, {"air"}, 0, 7, 120, 2000, 2, -500 ,100)
Here is the API

Code: Select all

mobs:spawn_specfic(name, nodes, neighbors, min_light, max_light, interval,
   chance, active_object_count, min_height, max_height, day_toggle, on_spawn)
Here is the code you are using:

Code: Select all

mobs:spawn_specific("dmobs:dragon", {"air"}, {"default:stone"}, 20, 10, 300, 15000, 2, -100, 11000)
you are spawning on air (which is very CPU intensive, you will run this ABM on all air nodes I think) near stone. min light required to spawn is 20 (which is the max value for light this is wrong and should be something like 0 or 2, etc. Its the lower range for light. 10 = max light, this should be like 16 if you want it to spawn in sun and bright areas. 300 is the interval that we will run this abm. chance is the 1 in X chance that it spawns on one of the nodes you specified. active object count is max amount of these entities at any time. -100 is your lower height limit. max height is upper height limit. day_toggle, true/false for if you want it to be day only, night only, or anytime. Your mobs arent spawning because they have to be between a range of 20 minimum light and 10 maximum to spawn, which is not a valid value. try 3-16 range instead. 3 min 16 max
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

klera
Member
Posts: 23
Joined: Tue Mar 03, 2020 12:18

Re: [Mod] D00Med mobs [dmobs]

by klera » Post

OK, thanks for your help!
And which files should I change? All values in all files?
or is it: .minetest/mods/dmobs/spawn.lua ? (attachment)
Attachments
spawn.lua.zip
(688 Bytes) Downloaded 16 times
cut.png
(16.28 KiB) Not downloaded yet

User avatar
ObsidianBlade12
Member
Posts: 32
Joined: Sun Dec 08, 2019 21:18
IRC: Obsidian
In-game: Darkstalker
Location: Dark's Private Island Resort

Re: [Mod] D00Med mobs [dmobs]

by ObsidianBlade12 » Post

Hey guys! I have a question.
I am trying to disable the mobs only so that dragons spawn (and no other), but I don't really know how to do it. I am trying to work on it for an Admin on Wild Wild West as a replacement for the Draconis Mod, since the Draconis Mod was causing problems. Could someone tell me what I need to do to disable the mobs, or just send me the "dragon edit"? Thank you so much! Very appreciated. :D
~Darkstalker/Obsidian~

Astrobe
Member
Posts: 328
Joined: Sun Apr 01, 2018 10:46

Re: [Mod] D00Med mobs [dmobs]

by Astrobe » Post

Add the line "dmobs.regulars=false" in your minetest.conf. If it does not work, you can use violence and edit directly the variable in init.lua (line 16).

However, it might cause these mobs to appear as "unknown entities" (pink rectangles) in your world (because the mod doesn't load their definitions anymore; this should be reversible, just undo the edit).

Another method that should avoid the issue is to use a bit less violence and go to the file spawn.lua and change the first line with "if false then".

Maybe wait for someone else to confirm this will work as expected (or has more "gentle" methods), as I did not test any of this suggestions.

In any case, the change will not be retroactive - the mobs that were spawned before will still be there - we only prevent them from spawning. They'll probably vanish one by one (poor panda...).

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

Re: [Mod] D00Med mobs [dmobs]

by MisterE » Post

I seem to be having some trouble with the dragons. When the different types of dragons are enables, the arrows shot by the ice dragon and the sea dragons (and possibly the lightning dragon) are unknown objects. I had to set dmobs.dragons = false until this is fixed.

User avatar
Minix
Member
Posts: 35
Joined: Thu Nov 12, 2020 13:51
In-game: Minix

Re: [Mod] D00Med mobs [dmobs]

by Minix » Post

I am getting a crash in my server from eggs.lua, this is the log:

Code: Select all

ServerError: AsyncErr: environment_Step: Runtime error from mod 'dmobs' in callback environment_Step(): ...ers/running/FreedomTest/worldmods/dmobs/dragons/eggs.lua:49: attempt to concatenate upvalue 'dragon_type' (a nil value)
2020-11-13 11:39:30: ERROR[Main]: stack traceback:
2020-11-13 11:39:30: ERROR[Main]:       ...ers/running/FreedomTest/worldmods/dmobs/dragons/eggs.lua:49: in function 'func'
2020-11-13 11:39:30: ERROR[Main]:       /usr/share/games/minetest/builtin/common/after.lua:20: in function </usr/share/games/minetest/builtin/common/after.lua:5>
2020-11-13 11:39:30: ERROR[Main]:       /usr/share/games/minetest/builtin/game/register.lua:429: in function </usr/share/games/minetest/builtin/game/register.lua:413>
2020-11-13 11:39:30: ERROR[Main]: stack traceback:
Before that happened a player placed a normal dragon egg, but I'm not sure what where the nodes surrounding the egg.

I added a conditional to check for nil values (I don't know if that's gonna work):

Code: Select all

minetest.after(dmobs.eggtimer,
                        function(pos, dragon, pname)
                                if dragon_type ~= nil then
                                        minetest.set_node(pos, {name="dmobs:dragon_egg_"..dragon_type})
                                end
                        end,
                        pos
                )
I will test this on my server and tell you what happens

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests