[Mod] Simple Mobs [mobs]

Temperest
Member
 
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Sat May 25, 2013 19:56

I like to keep documentation available offline, so I put together the contents of the wiki as well as some of my own notes into one text file, DOCUMENTATION.md, that has all the content all nicely together in one place:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Mobs
====

This mod adds mobs to Minetest.

Minetest's damage system
------------------------
The damage system in Minetest is more complex than just hold down the left mouse button. After the first punch your hand or weapon has a "reload" time. This is for most weapons 1 second. After the reload time the player can punch again.

Settings
--------
When you add `only_peaceful_mobs = true` to minetest.conf then all hostile mobs will despawn.
`display_mob_spawn = true` will show you a message in the chat when a mob spawns.

Items
-----
* Meat: dropped by sheep upon dying. When cooked in a furnace, results in cooked meat that heals players when eaten.
* Wheat: players holding wheat cause sheep to follow them. Right clicking sheep with wheat tames them.

List of mobs
------------

### Hostile mobs
Hostile mobs walk arround in the world and start to attack the player when they see him.

* Dirt Monster: spawns on grass at night. It has the same velocity as the player and cause 1 heart damage. It dies in water, lava and sunlight. Drops dirt when killed by a player.
* Stone Monster: spawns on normal stone in the dark. It is slower than the player but can only be hurt by at least a stone sword. It causes 2 heart damage and is immune to water, lava and light. Drops mossy cobble when killed by a player.
* Sand Monster: spawns at deserts. It is faster than the player but dies fast and doesnt cause much damage. It dies in water and lava. Drops sand when killed by a player.
* Oerkki: from version 0.3 of Minetest. It spawns on stone in the dark and has same velocity as the player. It causes more damage than the dirt monster and dies in lava and water.
* Dungeon Master: from version 0.3 of Minetest. It spawns on stone in the dark and throws fireballs at the player. It dies in water and lava and the player needs at least a stone sword to kill it. Has a 1% chance of dropping MESE when killed by a player.

### Friendly mobs
Friendly mobs walk arround in the world. They do not attack the player but some of them have useful features.

* Sheep: friendly animal that walks randomly in the world. It spawns on grass and gives the player wool if right clicked and meat if he kills it. It will follow players holding wheat. If fed wheat by right clicking, they are tamed, do not despawn, and regrow wool.
* Rat: from version 0.3 of Minetest. Its a friendly animal that spawns on grass and stone. The player can right click it to get it into his inventory. In the inventory the rat can be replaced in the world or cooked in the furnace.

API
---
You can use the API of simple mobs in your own mods if you have it installed. See the [init.lua]([url]https://github.com/PilzAdam/mobs/blob/master/init.lua[/url]) file in the mod to have some examples of the usage.

Simple Mobs has a simple API. Other mods can use the functions to add their own mobs.

### mobs:register_mob(name, definition)

This functions registers a new mob as a Minetest entity.
* `name` is the name of the mob (e.g. "mobs:dirt_monster")
* `definition` is a table with the following fields
  * `type` the type of the mob ("monster" or "animal")
  * `hp_max` same is in minetest.register_entity()
  * `physical` same is in minetest.register_entity()
  * `collisionbox` same is in minetest.register_entity()
  * `visual` same is in minetest.register_entity()
  * `visual_size` same is in minetest.register_entity()
  * `textures` same is in minetest.register_entity()
  * `mesh` same is in minetest.register_entity()
  * `makes_footstep_sound`: same is in minetest.register_entity()
  * `view_range` the range in that the monster will see the playerand follow him
  * `walk_velocity` the velocity when the monster is walking around
  * `run_velocity` the velocity when the monster is attacking a player
  * `damage` the damage per second
  * `drops` is list of tables with the following fields:
    * `name` itemname
    * `chance` the inverted chance (same as in abm) to get the item
    * `min` the minimum number of items
    * `max` the maximum number of items
  * `armor` the armor (integer)(3=lowest; 1=highest)(fleshy group is used)
  * `drawtype` "front" or "side"
  * `water_damage` the damage per second if the mob is in water
  * `lava_damage` the damage per second if the mob is in lava
  * `light_damage` the damage per second if the mob is in light
  * `on_rightclick` its same as in minetest.register_entity()
  * `attack_type` the attack type of a monster ("dogfight", "shoot", maybe somehting like "explode" in the future)
  * `arrow` if the attack_type="shoot" needed: the entity name of the arrow
  * `shoot_interval` the minimum shoot interval
    * `sounds` this is a table with sounds of the mob
      * `random` a sound that is played randomly
      * `attack` a sound that is played when a mob hits a player
  * `animation` a table with the animation ranges and speed of the model
    * `stand_start`
    * `stand_end`
    * `walk_start`
    * `walk_end`
    * `run_start`
    * `run_end`
    * `punch_start`
    * `punch_end`
    * `speed_normal`
    * `speed_run` used when mob runs behind player to make animation faster


### mobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height)

This function registers a spawn algorithm for the animal. Without this function the call the mobs won't spawn.
* `name` is the name of the animal/monster
* `nodes` is a list of nodenames on that the animal/monster can spawn
* `max_light` is the maximum of light
* `min_light` is the minimum of light
* `chance` is same as in register_abm()
* `active_object_count` mob is only spawned if active_object_count_wider of ABM is <= this
* `max_height` is the maximum height the mob can spawn

For each mob that spawns with this function is a field in `mobs.spawning_mobs`. It tells if the mob should spawn or not. Default is `true`. So other mods can only use the API of this mod by disabling the spawning of the default mobs in this mod.


### mobs:register_arrow(name, definition)

This function registers a arrow for mobs with the attack type shoot.
* `name` is the name of the arrow
* `definition` is a table with the following values:
  * `visual` same is in minetest.register_entity()
  * `visual_size` same is in minetest.register_entity()
  * `textures` same is in minetest.register_entity()
  * `velocity` the velocity of the arrow
  * `hit_player` a function that is called when the arrow hits a player; this function should hurt the player
    * the parameters are (self, player)
  * `hit_node` a function that is called when the arrow hits a node
    * the parameters are (self, pos, node)


Mostly my additions are about the sheep taming and some small details.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
 

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

by Inocudom » Sat May 25, 2013 20:09

Will there be a way to tame mice in the future?
 

User avatar
Mossmanikin
Member
 
Posts: 599
Joined: Sun May 19, 2013 16:26

by Mossmanikin » Sun May 26, 2013 00:23



Ok, thanks for the information.

Temperest wrote:I like to keep documentation available offline, so I put together the contents of the wiki as well as some of my own notes into one text file, DOCUMENTATION.md, that has all the content all nicely together in one place


Thank you, find it useful.

Inocudom wrote:Will there be a way to tame mice in the future?


Would love it!

Noob 4 life!
My stuff
 

cypher-neo
Member
 
Posts: 46
Joined: Wed Oct 17, 2012 12:15

by cypher-neo » Mon May 27, 2013 12:15

Sheep look great!
Could we get 3D models for Sand, Dirt, and Stone Monsters though. They always manage to sneak up on me, and I think it's cause they look flat on one side.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon May 27, 2013 13:15

cypher-neo wrote:Sheep look great!
Could we get 3D models for Sand, Dirt, and Stone Monsters though. They always manage to sneak up on me, and I think it's cause they look flat on one side.

They already have 3D models... ?
 

Michael Eh?
Member
 
Posts: 282
Joined: Sun Jan 01, 2012 17:21

by Michael Eh? » Mon May 27, 2013 23:34

looks like that has solved the rat infestation problem. trying the luring sheep. How do you feed them? Maybe we need a feed trough.
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

by twoelk » Wed May 29, 2013 11:42

All sheep I put in cages on VanessaE's server despawn. I lured them with wheat, fed them, got some wool but after some time they disappeare. I left my avatar near one cage, waving wheat now and then and they stayed for about an hour. Then I left and came back and the sheep were gone. I built a cage near spawn with some player traffic but the sheep did not stay. There is no feedback that shows wether feeding worked so I tried many things. Is this server related and/or are the sheep attached to a player, so they despawn when he leaves their chunk?
 

deivan
Member
 
Posts: 452
Joined: Fri Feb 15, 2013 10:16

by deivan » Wed May 29, 2013 12:17

I have the same problem with all sheep. :-/
 

tinoesroho
Member
 
Posts: 570
Joined: Fri Feb 17, 2012 21:55

by tinoesroho » Wed May 29, 2013 14:56

All mobs despawn when nobody is in an area. :-(
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Wed May 29, 2013 14:58

deivan wrote:I have the same problem with all sheep. :-/
tinoesroho wrote:All mobs despawn when nobody is in an area. :-(

What Minetest version do you run?
 

tinoesroho
Member
 
Posts: 570
Joined: Fri Feb 17, 2012 21:55

by tinoesroho » Wed May 29, 2013 16:50

That was on 0.4.3-0.4.5- buggers used to despawn on logout, spawn on login. Still do whenever I play those versions. The latest seems OK- just tested it out on my nice dualcore.
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Thu May 30, 2013 23:57

Fixed the disappearing of sheeps.
 

tinoesroho
Member
 
Posts: 570
Joined: Fri Feb 17, 2012 21:55

by tinoesroho » Fri May 31, 2013 00:15

B-a-a-d! Disappearances gone? Must download!
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/
 

User avatar
Pavel_S
Member
 
Posts: 131
Joined: Sat Apr 06, 2013 11:43

by Pavel_S » Sun Jun 02, 2013 08:40

New UV unwrap!
Sand and stone monsters.
Texture for dirt monster is available(uses stone_monster.x).
DropBox link
Last edited by Pavel_S on Sun Jun 02, 2013 08:48, edited 1 time in total.
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Sun Jun 02, 2013 14:21

I'd love to see 1 or 2 more friendly mobs because I don't like the hostile ones :)

But I love the mod and the nice textures!
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Jun 03, 2013 17:09

Pavel_S wrote:New UV unwrap!
Sand and stone monsters.
Texture for dirt monster is available(uses stone_monster.x).
DropBox link

Done.
 

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

by Neuromancer » Tue Jun 04, 2013 02:34

Need an option for hi-res textures for these mobs that go better with 64x64 texture packs. (But still need to also offer the low res ones.) It's just that this mod is an essential mod, but the mobs look cheap when you go to a 64x64 texture pack. I do like the flying rats though. Please leave that in.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Jun 04, 2013 10:53

Neuromancer wrote:Need an option for hi-res textures for these mobs that go better with 64x64 texture packs. (But still need to also offer the low res ones.) It's just that this mod is an essential mod, but the mobs look cheap when you go to a 64x64 texture pack. I do like the flying rats though. Please leave that in.

Why is an option needed? Cant you just use high resolution textures?

The flying rats were a bug in the engine, so I cant bring it back.
 

User avatar
cHyper
Member
 
Posts: 587
Joined: Fri May 06, 2011 08:49
IRC: cHyper
In-game: cHyper

by cHyper » Tue Jun 04, 2013 11:03

with the latest 0.4.6 dev version, mobs are not shown with the correct texture.
--------------------------------------------------------
 

User avatar
Zeg9
Member
 
Posts: 608
Joined: Fri Sep 21, 2012 11:02

by Zeg9 » Tue Jun 04, 2013 11:06

PilzAdam wrote:
Neuromancer wrote:Need an option for hi-res textures for these mobs that go better with 64x64 texture packs. (But still need to also offer the low res ones.) It's just that this mod is an essential mod, but the mobs look cheap when you go to a 64x64 texture pack. I do like the flying rats though. Please leave that in.

Why is an option needed? Cant you just use high resolution textures?

The flying rats were a bug in the engine, so I cant bring it back.

I think he's talking about high-res models.
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).
 

User avatar
vv221
Member
 
Posts: 42
Joined: Mon Mar 04, 2013 08:18

by vv221 » Tue Jun 04, 2013 11:51

If you are talking about high-poly meshes, I think it does not go the Minetest way ;)
And if you are talking about high-res textures, anyone can do a texture pack for any mod, including this one.
 

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

by Neuromancer » Wed Jun 05, 2013 02:15

Yep, I guess I'm just hoping someone creates some higher res textures for this mod. As for the flying rats, it just was good to have something in the sky. If we can't have them, I would like it if the next mobs involve some sort of bird and fish. It's cool to have all these mobs that already exist, but the sky and water seem so empty by comparison. It just make's sense to have some sort of mob in the water and sky. Aside from the sheep and sand monsters taking a swim. :)
Last edited by Neuromancer on Wed Jun 05, 2013 02:16, edited 1 time in total.
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Wed Jun 12, 2013 13:13

I don't know wheter a rat infestation is a bug or a feature...

Image

:D
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Wed Jun 12, 2013 13:48

webdesigner97 wrote:I don't know wheter a rat infestation is a bug or a feature...

Image

:D

Lets call it a feature ;-)
 

User avatar
onpon4
Member
 
Posts: 517
Joined: Thu Mar 21, 2013 01:54

by onpon4 » Wed Jun 12, 2013 16:57

Shouldn't rats be more prominent underground?
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Wed Jun 12, 2013 18:24

PilzAdam wrote:
webdesigner97 wrote:I don't know wheter a rat infestation is a bug or a feature...

Image

:D

Lets call it a feature ;-)

It's decreases my FPS... In my favourite singleplayer world :(
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Wed Jun 12, 2013 20:37

You call that a rat infestation? You ought to see my sheep collections....
A list of my mods can be found here.
 

User avatar
Zeg9
Member
 
Posts: 608
Joined: Fri Sep 21, 2012 11:02

by Zeg9 » Thu Jun 13, 2013 11:33

webdesigner97 wrote:
PilzAdam wrote:
webdesigner97 wrote:I don't know wheter a rat infestation is a bug or a feature...

Image

:D

Lets call it a feature ;-)

It's decreases my FPS... In my favourite singleplayer world :(

Well, /clearobjects has been fixed if you see what I mean ;-)
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).
 

User avatar
AndrOn
Member
 
Posts: 38
Joined: Fri May 31, 2013 22:32

by AndrOn » Sun Jun 16, 2013 11:34

love that mod! Thanks to you guys!
sorry for bad english
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Fri Jun 21, 2013 03:47

I'm trying to retexture this mod with BDCraft and was wondering if somebody could release images that show the outlines for the UV's. I had to spend a couple hours just figuring out the UV mapping for the sand monster. Some of them are hard to test some of the UV mapping, rat and sheep, and some are just extremely difficult to figure out where to even start for testing.
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 13 guests

cron