[Mod] Mob Spawners [0.9.5] [mobspawn]

Post Reply
User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

[Mod] Mob Spawners [0.9.5] [mobspawn]

by HeroOfTheWinds » Post

Mob Spawner v.0.9.5

So, after much procrastination and lack of time (college, mostly), I finally got around to making a mod for creating monster spawners!

This simple mod operates on some fairly basic parameters:
  • Mobs spawn only when the light around the spawner is below a certain threshold. (default is 9)
  • Mobs will not spawn if there are too many in the area. (Default cap is 7, although stronger pcs can easily stand 12 or more in singleplayer. Amount will vary for your server and/or system)
Currently, PilzAdam's Simple Mobs, TenPlus1's Mobs_Redo, Zeg9's zmobs, Calinou's Carbone Mobs, DevynCJohnson's Senderman, BlockMen's Creatures, krupnovpavel's KPGMobs, CProgrammerRU's SimpleMobs++, MinetestForFun's spidermob, RHR's Cute Cubic Mobs, davedevils' Minecraft Monsters, and sapier's Mobf & Animals Modpack are supported, although adding support for more mods is incredibly easy. If you have a mob mod you want supported, tell me! I'll probably add more myself according to my free time.

There are a number of configurable settings at the top of the init.lua, namely MAX_LIGHT, MAX_MOBS, CHANCE, and INTERVAL. The first one is the maximum light in which mobs will spawn. Likewise, MAX_MOBS is the cap on how many mobs will spawn. (Note that players are counted as objects when in range, so if it's set to 7, you'll only ever see 6.) CHANCE is the probability (1/x chance) of a mob spawning per interval. Which brings us to INTERVAL, which determines how many seconds there are between spawnings.

Near the start of the file is a list of tables with mob names in them. If you want to create additional spawners for unlisted mobs (like cows and chickens), create another list.insert() line with the appropriate information. If you are unsure what to add, ask here or look at the original mod's code.

As there currently are no craft recipes for spawners, the only way to get them is through the give privilege, using the form:
/giveme mobspawn:name_spawner
where name is the name of the mob, such as dirt_monster.

Enjoy!

Screenshots:
Spoiler
Image

Image
Now for bidness:

Depends:
default
mobs?
carbone_mobs?
mobf?
creatures?
zmobs?
senderman?
kpgmobs?
ccmobs?
spidermob?

License: WTFPL (code and textures)
GitHub: https://github.com/HeroOfTheWinds/mobspawn/
Download: https://github.com/HeroOfTheWinds/mobsp ... master.zip

TO-DO:
Fix spawner texture
Add entity inside spawner showing what it spawns
Add support for more mobs
Make recipes for spawners
...Perhaps you have suggestions? :)
Last edited by HeroOfTheWinds on Mon Dec 22, 2014 21:36, edited 3 times in total.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

User avatar
Inocudom
Member
Posts: 3121
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: [mod] Mob Spawners [beta] [0.8] [mobspawn]

by Inocudom » Post


User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: [mod] Mob Spawners [beta] [0.8] [mobspawn]

by HeroOfTheWinds » Post

Ah, yes, I definitely have those at the top of my list for adding support. I also intend to support senderman...

A small note I forgot to mention in the OP: Currently, mob spawners are uncraftable. This is partially due to lack of good method for crafting (I want to have spawn eggs...), but also to prevent regular (non-admin) players from "griefing" the world with countless mob spawners to bring about the apocalypse. If and when I get good recipes implemented and more mobs supported, I will make a toggle in the lua file for allowing crafting...

On a side note, I'd love to see these implemented in a mod like catacomb or one of the mineshaft mods. Just a thought.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: [mod] Mob Spawners [alpha] [0.9] [mobspawn]

by HeroOfTheWinds » Post

BIG update!

I have added support for a large number of mobs, including:
Zeg9's zmobs, Calinou's Carbone Mobs, DevynCJohnson's Senderman, BlockMen's Creatures, and sapier's Mobf & Animals Modpack.

Additionally, the internal way mobs are handled has changed a bit, to allow for running of multiple mobs mods alongside each other. However, overlaps have not been addressed yet, so in cases of conflicts between, say, oerkkis, only one oerkki spawner will be registered.

Let me know if you have any ideas or find any bugs! (It is still in alpha testing, isn't it? xD)
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: [mod] Mob Spawners [alpha] [0.9] [mobspawn]

by twoelk » Post

Have added this mod to the wiki page about mobs hope that one day you will support at least all the mobs listed there. ;-D

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: [mod] Mob Spawners [alpha] [0.9] [mobspawn]

by HeroOfTheWinds » Post

twoelk wrote:Have added this mod to the wiki page about mobs hope that one day you will support at least all the mobs listed there. ;-D
:O I forgot how many mobs mods there were, let alone how many other mods incorporated them...! I'll do my best.

Also, when I get around to updating that, I'll be making another small change: I'll list ALL mobs in a given mod in the code, just commenting out the peaceful ones. That should make things easier for the user.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: [mod] Mob Spawners [alpha] [0.9] [mobspawn]

by twoelk » Post

HeroOfTheWinds wrote:... I'll list ALL mobs in a given mod in the code, just commenting out the peaceful ones. That should make things easier for the user.
hehe - I guess a lot of people are dreaming of that killer app that might be called The-Universal-United-Mobs-Mods-Manager containing controls for every configuration possible.

btw, I am pretty sure there are more mob-mods out there that I havn't found yet. I guess I will have to add a new section of games containing mobs anyway to cover stuff like all the mobs from Lord-Of-The-Test, Carbone or AdventureTest.

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: [mod] Mob Spawners [alpha] [0.9] [mobspawn]

by HeroOfTheWinds » Post

Haha, yeah, that's a dream I'd love to achieve someday with this...

Indeed, subgames throw a big monkey-wrench in there. I think what I will have to do is either find a way of determining what subgame is being played, or else check for mods installed ONLY in that subgame.
I will posit that, as far as I know, minetest.override_item() does not work on entity registrations. So even if I started getting really technical with the configuration options, you still couldn't edit a mob's stats...
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: [mod] Mob Spawners [alpha] [0.9.4] [mobspawn]

by HeroOfTheWinds » Post

Alright, new update!

KPGMobs, SimpleMobs++, spidermob, and CCMobs have joined the ranks of supported mobs. Consequently, that means I almost have all the Simple Mobs based mods implemented! Just a couple more to go (including my nearly abandoned MobsPlus & areas)...

However, I now realize I need to do a new piece of refactoring: I need to split up the mobs into day spawning and night spawning, since I started supporting peaceful mobs. So expect that soon...
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [mod] Mob Spawners [alpha] [0.9.4] [mobspawn]

by Sokomine » Post

HeroOfTheWinds wrote: KPGMobs, SimpleMobs++, spidermob, and CCMobs have joined the ranks of supported mobs. Consequently, that means I almost have all the Simple Mobs based mods implemented! Just a couple more to go (including my nearly abandoned MobsPlus & areas)...
That's good! By now, there are so many diffrent mob mods out there that it's difficult to keep an overview. Would it be possible for you to add/edit a mobs mod category in the Wiki? With a short(!) paragrap (1-2 sentences) describing them each? It seems that you got at least some basic overview over them.
HeroOfTheWinds wrote: However, I now realize I need to do a new piece of refactoring: I need to split up the mobs into day spawning and night spawning, since I started supporting peaceful mobs. So expect that soon...
There's a reason for why mobf is so large :-)
A list of my mods can be found here.

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: [mod] Mob Spawners [alpha] [0.9] [mobspawn]

by HeroOfTheWinds » Post

@Sokomine:
twoelk wrote:Have added this mod to the wiki page about mobs hope that one day you will support at least all the mobs listed there. ;-D
So, while there already is a wiki page describing each mob mod, it still doesn't detail subgames. So Lord Of The Test, AdventureTest, BFG, etc. also need to be taken into account. However, I'm working on the wiki stuff first. Still, I don't think I'll add the NPC mods... It just wouldn't feel right having a block spawning people, would it? :P

I'm still debating how I should handle the lighting issue... should I have it on a per-mob basis, or split it into cold hard groups of "day", "night", and "always"...?
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

benedict56
New member
Posts: 3
Joined: Mon Nov 24, 2014 13:35

Re: [mod] Mob Spawners [alpha] [0.9.4] [mobspawn]

by benedict56 » Post

Can you support the minecraft mobs mod from davedevil?
It would be great

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: [mod] Mob Spawners [alpha] [0.9.4] [mobspawn]

by HeroOfTheWinds » Post

Sure thing! I'll try getting to it soon, I'm almost on break from college, so I should have time to resurface for 2~3 weeks again.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: [Mod] Mob Spawners [0.9.4] [mobspawn]

by HeroOfTheWinds » Post

Alright, as promised, I added support for the "Minecraft Monsters" mod! I didn't test to make sure the code is error free, but expansion of this mod is so simple. I just wish people would stop using the the modname "mobs".... the naming conflicts are so ridiculous...
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

User avatar
SAMIAMNOT
Member
Posts: 416
Joined: Wed Sep 03, 2014 00:51
In-game: notanewbie
Location: Desert

Re: [Mod] Mob Spawners [0.9.5] [mobspawn]

by SAMIAMNOT » Post

I have a few questions & suggestions.
1) Is this a block that you place
2) Are there seperate spawners for each mob?
3) Can you please let the spawners spawn user-specified itemstrings?
I test mines.

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: [Mod] Mob Spawners [0.9.5] [mobspawn]

by HeroOfTheWinds » Post

SAMIAMNOT wrote:I have a few questions & suggestions.
1) Is this a block that you place
2) Are there seperate spawners for each mob?
3) Can you please let the spawners spawn user-specified itemstrings?
1) Yes.

2) Yup.

3) I've been a bit too busy as of late to do much Minetest coding, but that would be an interesting mod to make. However, it would not fit in this particular mod, and would be better as a stand-alone idea. It probably wouldn't be too hard to implement though... Just figure out the syntax/code for creating dropped-item entities (it's out there, perhaps look at code such as that in the drop-on-die mod). Some of the logic would change as well, since my code creates separate nodes for each mob, while your idea requires only a node with a formspec. (Gonna level with you here, I hate formspecs.) Hope this helps!
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

User avatar
SAMIAMNOT
Member
Posts: 416
Joined: Wed Sep 03, 2014 00:51
In-game: notanewbie
Location: Desert

Re: [Mod] Mob Spawners [0.9.5] [mobspawn]

by SAMIAMNOT » Post

Thanks. Will do. Although I tried editing the moremesecon Dispenser mod to drop nodes or spawn entities and it did nothing but crash. Hopefully II'll e successful this time.
I test mines.

JoshMars
Member
Posts: 111
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Mob Spawners [0.9.5] [mobspawn]

by JoshMars » Post

I kept getting this error :
2016-10-27 09:08:08: ERROR[Main]: ServerError: Lua: Runtime error from mod 'mobspawn' in callback LuaABM::trigger(): /home/minetest/.minetest/mods/mobspawn/init.lua:277: attempt to compare nil with number
2016-10-27 09:08:08: ERROR[Main]: stack traceback:
2016-10-27 09:08:08: ERROR[Main]: /home/minetest/.minetest/mods/mobspawn/init.lua:277: in function </home/minetest/.minetest/mods/mobspawn/init.lua:271>

JoshMars
Member
Posts: 111
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Mob Spawners [0.9.5] [mobspawn]

by JoshMars » Post

I tried adding

Code: Select all

if not npos then return false end
to the register_abm function, but that didn't work so I added

Code: Select all

if not MAX_LIGHT then return false end
and that didn't work so I added

Code: Select all

minetest.chat_send_all(minetest.get_node_light(npos))
in order to debug and my server stopped crashing.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 16 guests