help for mod![solved]

Post Reply
User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

help for mod![solved]

by azekill_DIABLO » Post

Code: Select all

snapper:register_mob("snapper:snapper", {
	type = "monster",
	passive = false,
	attack_type = "dogfight",
	reach = 2,
	damage = 500,
	hp_min = 30,
	hp_max = 30,
	armor = 100,
	collisionbox = {-0.4, -0.4, -0.4, 0.4, 0.4, 0.4},
	visual = "mesh",
	mesh = "snap.obj",
	textures = {
		{"snap.png"},
	},
	blood_texture = "default_mese_crystal.png",
	makes_footstep_sound = true,
	sounds = {
		random = "snap",
	},
	view_range = 25,
	walk_velocity = 3,
	run_velocity = 3,
	jump = true,
	drops = {
		{name = "default:mese_block",
		chance = 1, min = 5, max = 5},
	},
	water_damage = 0,
	lava_damage = 5,
	light_damage = 0,
	fear_height = 0,
})
when i start the game it says:
Image

what is the problem?
Attachments
bug.png
(139.44 KiB) Not downloaded yet
Last edited by azekill_DIABLO on Fri Apr 15, 2016 10:51, edited 1 time in total.

Dragonop
Member
Posts: 1226
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop
Location: Argentina

Re: help for mod!

by Dragonop » Post

You are using mobs_redo, right? Replace "snapper:register_mob" with "mobs:register_mob". Also check if it has mobs_redo added to depends.txt

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: help for mod!

by azekill_DIABLO » Post

i'm not using mobs redo, i'm in a folder i called snappers

Dragonop
Member
Posts: 1226
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop
Location: Argentina

Re: help for mod!

by Dragonop » Post

Then from where are you getting that function (snapper:register_mob) ?

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: help for mod!

by azekill_DIABLO » Post

me = noob!
i don't really know wat it is

User avatar
oleastre
Member
Posts: 81
Joined: Wed Aug 13, 2014 21:39
GitHub: oleastre
In-game: oleastre

Re: help for mod!

by oleastre » Post

Only predefined minetest functions are available to all mods.
The list and documentation is here :
https://github.com/minetest/minetest/bl ... ua_api.txt

The register_mob is a specific function defined by the mobs redo mod (and maybe other mobs mod).
So, to use it, you need to depend on that mod.

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: help for mod!

by azekill_DIABLO » Post

i changed something but it won't work:

Code: Select all

function snappers:register_entity("snappers:snapper",{
	type = "monster",
	passive = false,
	attack_type = "dogfight",
	reach = 2,
	damage = 500,
	hp_min = 30,
	hp_max = 30,
	armor = 100,
	collisionbox = {-0.4, -0.4, -0.4, 0.4, 0.4, 0.4},
	visual = "mesh",
	mesh = "snap.obj",
	textures = {
		{"snap.png"},
	},
	blood_texture = "default_mese_crystal.png",
	makes_footstep_sound = true,
	sounds = {
		random = "snap",
	},
	view_range = 25,
	walk_velocity = 3,
	run_velocity = 3,
	jump = true,
	drops = {
		{name = "default:mese_block",
		chance = 1, min = 5, max = 5},
	},
	water_damage = 0,
	lava_damage = 5,
	light_damage = 0,
	fear_height = 0,
})

mobs:register_spawn("snappers:snapper", {"default:dirt_with_grass"}, 7, 0, 7000, 1, 31000)

mobs:register_egg("snappers:snapper", "The Big Snap", "default_mese_crystal.png", 1)
It says:

Code: Select all

2016-04-13 11:20:42: ERROR[main]: ========== ERROR FROM LUA ===========
2016-04-13 11:20:42: ERROR[main]: Failed to load and run script from 
2016-04-13 11:20:42: ERROR[main]: C:\Games\Minetest\bin\..\mods\snappers\init.lua:
2016-04-13 11:20:42: ERROR[main]: C:\Games\Minetest\bin\..\mods\snappers\init.lua:1: <name> or '...' expected near '"snappers:snapper"'
2016-04-13 11:20:42: ERROR[main]: ======= END OF ERROR FROM LUA ========
2016-04-13 11:20:42: ERROR[main]: Server: Failed to load and run C:\Games\Minetest\bin\..\mods\snappers\init.lua
2016-04-13 11:20:42: ERROR[main]: ModError: ModError: Failed to load and run C:\Games\Minetest\bin\..\mods\snappers\init.lua
2016-04-13 11:20:42: ERROR[main]: Error from Lua:
2016-04-13 11:20:42: ERROR[main]: C:\Games\Minetest\bin\..\mods\snappers\init.lua:1: <name> or '...' expected near '"snappers:snapper"'

Dragonop
Member
Posts: 1226
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop
Location: Argentina

Re: help for mod!

by Dragonop » Post

That funcion doesn't exists, where did you got it from?
Probably from mobs_redo. Mobs_redo is an API, that provides an easy way to add mobs to the game. Btw the code you added last is wrong, use the old one instead. Add depends.txt to your mod folder, then write "mobs" in it, save and close. Then download the "mobs" mod (mobs_redo), and enable it when starting a world with your mod.
When done, use this code.

Code: Select all

mobs:register_mob("snapper:snapper", {
       type = "monster",
       passive = false,
       attack_type = "dogfight",
       reach = 2,
       damage = 500,
       hp_min = 30,
       hp_max = 30,
       armor = 100,
       collisionbox = {-0.4, -0.4, -0.4, 0.4, 0.4, 0.4},
       visual = "mesh",
       mesh = "snap.obj",
       textures = {
          {"snap.png"},
       },
       blood_texture = "default_mese_crystal.png",
       makes_footstep_sound = true,
       sounds = {
          random = "snap",
       },
       view_range = 25,
       walk_velocity = 3,
       run_velocity = 3,
       jump = true,
       drops = {
          {name = "default:mese_block",
          chance = 1, min = 5, max = 5},
       },
       water_damage = 0,
       lava_damage = 5,
       light_damage = 0,
       fear_height = 0,
    })
"mobs:register_mob" is a mobs_redo specific function, that you can't use if you don't depend on that mod.

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: help for mod!

by azekill_DIABLO » Post

ok thanks :)

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: help for mod!

by azekill_DIABLO » Post

i've done everything you said it always says:

Code: Select all

2016-04-14 12:40:56: ERROR[main]: mod "snappers" has unsatisfied dependencies:  "mobs"
but i have put the mod"MOBS_redo" in the same folder!(and i renamed it to mobs)
why it won't work??!

User avatar
Krock
Developer
Posts: 4577
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: help for mod!

by Krock » Post

azekill_DIABLO wrote:why it won't work??!
I'm not sure if the mobs redo is 1:1 compatible with the needed mobs mod.

Check your directory structure again, it must look like this:

Code: Select all

minetest
    └── mods
         ├── snapper
               ├── init.lua
               ├── depends.txt
               └── <further files/directories>
         ├── mobs
               ├── init.lua
               ├── depends.txt
               └── <further files/directories>
         └── <any other mod..>
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Dragonop
Member
Posts: 1226
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop
Location: Argentina

Re: help for mod!

by Dragonop » Post

azekill_DIABLO wrote:but i have put the mod"MOBS_redo" in the same folder!(and i renamed it to mobs)
why it won't work??!
Not in the same folder... in the mods folder.

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: help for mod!

by azekill_DIABLO » Post

it's wat i've done but it was off :)


SOLVed

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests