Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

have a look at http://minetest.net/forum/viewtopic.php?pid=43237

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

sapier wrote:

Changes 1.4.4:
-added breeding of cow and chicken

Dude that's just sick.

Uber Texture Pack
Mods:Immersive Sounds
Cylinders in Multinode
Phonics donate: 1jTbc5MR3dmMWriRA98RgwWdfPR1qTzsn

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

LOL ...
ok ok it's breeding cow+steer and chicken + rooster

but there's a bug, steers wont get spawned, I'll fix this for next version.

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

How about big, big animals like dinosaurs or some sort of dragons?
You know, few giant creatures that travel the world and that could only be killed with special traps or so.

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

Good idea, there's only one problem the bigger animals are the more anoying is missing animation support for 3d animals.but as 2d only they might look good.

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

It seems to work well now - no more crashes and the animals behave (mostly - I still saw quite a lot of sheep committing suicide by jumping off cliffs). The amount of animals is good as well - many chicken and sheep, few cows and deers. Fishes work well. Gulls in the sky are a very nice sight. Finally I may keep the mod running and enjoy the animals :-) I didn't see a wolf, but maybe they where hiding.

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

Animals won't get spawned. Only vombies. Where should I search issue?
debug.txt 1.6MB

608 (edited by sapier 2012-09-19 20:15:29)

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

@Ragnarok

Most animals will only get spawned on mapgen. Animal abm spawning most likely was cause of lag complains with this modpack.

Vombies fish and gulls still spawn with old mechanisms e.g. at night because their spawning mechanism hasn't been changed. I guess there will still remain some lag at night.

If you need more animals try breeding them. And if this still ain't enough probably I'll add a secondary spawning mechanism (to be enabled/disabled per config file setting)
Setting really low chances to reduce lag. This way you could get at least some animals in already generated areas.

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

Thanks for the tip :) I breeding them now (after changing spawn mechanism to at_night for a while - lots of cows and other animals). I think another spawning mechanism can be very useful. Is there a way to spawn MOBs manually?

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

Ragnarok wrote:

Thanks for the tip :) I breeding them now (after changing spawn mechanism to at_night for a while - lots of cows and other animals). I think another spawning mechanism can be very useful. Is there a way to spawn MOBs manually?

/spawnentity [entityname]

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

/spawnmob [mobname] [coordinates]
works too ... seems I've reinvented a command already existing in minetest

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

is it possible to register a callback on mob death? i'd like to do something whenever each player kills an animal/monster.

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

this callback is already available generic -> "on_kill_callback" return true to skip normal handling false to do it additionally

for further information look at documentation mob_template

614 (edited by sudoman 2012-09-20 20:54:37)

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

sapier wrote:

this callback is already available generic -> "on_kill_callback" return true to skip normal handling false to do it additionally

cool, but i'd like to use a global callback register function that lets any mod register a callback for a killing event. It's the same idea as registering a callback for each node that gets dug:

minetest.register_on_dignode(function(pos, node, player)
    local name = player:get_player_name()
    gainxp(name, "digging", 1)
end)

you can look at the string value of node.name, and do cool stuff with that. it would be good to be able to access the specific mob's max hp and damage per attack with attack rate, or damage per second. this is so that another mod knows how strong this monster is. thanks, and great mod!

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

Do I understand correctly that you want to register a function mobf calls for any mob on kill of a mob?

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

sapier wrote:

Do I understand correctly that you want to register a function mobf calls for any mob on kill of a mob?

yes. Ideally, there could be any number of registered functions by different mods. (or even multiple ones by the same mod.) I think this could be done by adding a reference to the to-be-called function in a table that is in your mob mod. Then when a mob dies, all of those functions get called, with the appropriate parameters.

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

Technically it's no problem all data defining a mob are stored in a single structure. It's just if a mod changes those data it might cause very bad behaviour.
I need to think about what side effects this will cause a little bit more.

What exactly is your purpose for doing this?

There are some other situations adding a mod <-> mod interface may interesting too but some of those may be redundant calls that can be done by other means too.

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

sapier wrote:

Technically it's no problem all data defining a mob are stored in a single structure. It's just if a mod changes those data it might cause very bad behaviour.
I need to think about what side effects this will cause a little bit more.

What exactly is your purpose for doing this?

There are some other situations adding a mod <-> mod interface may interesting too but some of those may be redundant calls that can be done by other means too.

the purpose is for expanding upon the xp mod that me and my friends are making. if a callback becomes available, then we could give the player experience points when they kill a monster or an animal. Here's the current progress:

https://gitorious.org/minetest-xpmod/xp

I see what you say about the danger of changing variables used by another mod, but that is par for the course, i believe. i think we both know that if any mod is poorly written, it can cause the game to crash, or cause other problems. so, maybe you could make a note in the documentation, and know that mods that cause problems will have to be skipped by those choosing mods for their server, as always.

I'm not sure what you have in mind for possible mod <-> mod interfaces, but either way, I'd like to know whatever route you choose in the end.

thanks.

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

Hello,

next mobf version will contain following api enhancements:

API:
mobf_register_on_death_callback(callback) register a callback on death of ANY mob
mobf_get_mob_definition(mobname) get COPY of mob definition

Function declaration called on death
callback(mobname,pos,hitter)

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

sapier wrote:

Hello,

next mobf version will contain following api enhancements:

API:
mobf_register_on_death_callback(callback) register a callback on death of ANY mob
mobf_get_mob_definition(mobname) get COPY of mob definition

Function declaration called on death
callback(mobname,pos,hitter)

thanks, sapier! : )

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

coming soon:

http://ompldr.org/tZm16ZQ

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

NICE!

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

I can't kill the mobs! otherwise the mod is great. It was little boring to play with no mobs at all

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

paduggio wrote:

I can't kill the mobs! otherwise the mod is great. It was little boring to play with no mobs at all

my friend and i have tested this out a bit. he found that you can only kill mobs and other players if you're moving around. otherwise, each attack does zero damage. we both think this is silly, but i think that this is celeron's choice (or bug).

also, you might need a better weapon than the one you're using, like a sword.

Re: [Mod] MOB Framework [2.1.2] [mobf] self defence?

sudoman wrote:
paduggio wrote:

I can't kill the mobs! otherwise the mod is great. It was little boring to play with no mobs at all

my friend and i have tested this out a bit. he found that you can only kill mobs and other players if you're moving around. otherwise, each attack does zero damage. we both think this is silly, but i think that this is celeron's choice (or bug).

also, you might need a better weapon than the one you're using, like a sword.

I think you both didnt understand the damage system of MT. In my wiki of my mobs mod is a little description of it: https://github.com/PilzAdam/mobs/wiki.