Page 1 of 2
squids mod help

Posted:
Tue Jun 25, 2013 00:54
by zoropig
ok so im trying to make a squids mod.(maybe for a SDMC map) but i dont know how to do the code thng for the init thing so can you help me plz

Posted:
Tue Jun 25, 2013 01:00
by PilzAdam
RTFM

Posted:
Tue Jun 25, 2013 01:06
by zoropig
any ways SDMC means skydoesminecraft

Posted:
Tue Jun 25, 2013 01:18
by NakedFury
What do you mean "how to do the code thing"?

Posted:
Tue Jun 25, 2013 01:32
by zoropig
like the well this is part of the simple mobs mod thing so like this:dofile(minetest.get_modpath("mobs").."/api.lua")
mobs:register_mob("mobs:dirt_monster", {
type = "monster",
hp_max = 5,
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
visual = "mesh",
mesh = "mobs_stone_monster.x",
textures = {"mobs_dirt_monster.png"},
visual_size = {x=3, y=2.6},
makes_footstep_sound = true,
view_range = 15,
walk_velocity = 1,
run_velocity = 3,
damage = 2,
drops = {
{name = "default:dirt",
chance = 1,
min = 3,
max = 5,},
},
armor = 100,
drawtype = "front",
water_damage = 1,
lava_damage = 5,
light_damage = 2,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 14,
walk_start = 15,
walk_end = 38,
run_start = 40,
run_end = 63,
punch_start = 40,
punch_end = 63,
}
})
mobs:register_spawn("mobs:dirt_monster", {"default:dirt_with_grass"}, 3, -1, 7000, 3, 31000)
mobs:register_mob("mobs:stone_monster", {
type = "monster",
hp_max = 10,
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
visual = "mesh",
blah blah blah

Posted:
Tue Jun 25, 2013 15:44
by zoropig
i need hlp with somthing so every time i try to play with it theres an mod failed to load thing.
can you help plz?

Posted:
Tue Jun 25, 2013 18:40
by Topywo
1. An important help for a modder is the file debug.txt. Delete it. Start a game. Wait till the error happens. Exit minetest. Open debug.txt. Scroll till the ERROR part. That part gives you essential information about the first error you made it encountered.
If you don't understand the ERROR, paste those error-lines in a post in this topic.
2. Your approach to use an existing mob-mod is good. You could start to change 1 thing at a time in the code, then another one. What important is, is that if you change a name, you'll also need to have a texture with the same name. When you change the mod name, you'll need to change all the 'old' mod names in the new one, including those in the textures folder.
3, The attitude of your mob and its environment will be the hardest part to code. See also the api.lua file of PilzAdams' simple mobs mod.
4. Last but not least. When you have managed to make a working mod, check the licences of the parts you copied and apply those and find a license for your own contribution. Give the one(s) you copied code or textures from the proper credit.
Starting with entities isn't the easiest way to start modding. There are only a few modders that have made moving mods. So the best of luck.
Some Lua documentation that might help you in the long term:
http://lua.gts-stolberg.de/en/index.php

Posted:
Wed Jun 26, 2013 00:54
by zoropig
its saying: ERROR[main]: Error loading mod "evil squids": modname does not follow naming conventions: Only chararacters [a-z0-9_] are allowed.
17:42:29: ERROR[main]: Server: Failed to load and run C:\Users\name\Downloads\minetest-0.4.7\minetest-0.4.7\bin\..\mods\evil squids\init.lua
17:42:29: ERROR[main]: ModError: Failed to load and run C:\Users\name\Downloads\minetest-0.4.7\minetest-0.4.7\bin\..\mods\evil squids\init.lua

Posted:
Wed Jun 26, 2013 01:52
by zoropig
how do i make a mob egg or somthing to spawn these mobs?

Posted:
Wed Jun 26, 2013 03:28
by Mossmanikin
Does your mod load now?

Posted:
Wed Jun 26, 2013 06:14
by LionsDen
If your mod is still not loading, try removing the space or changing it to an underscore _. That may fix that part of your problem.

Posted:
Wed Jun 26, 2013 06:28
by Dan Duncombe
In other words change the name of your mod to evil_squids
Make sure that this mobs:register_mob("evil_squids:randomsquidname", {
is what is at the top. Put the name of your squid type, no spaces (although you can put _ ) and preferably no capitals, where I have written arandomsquidname

Posted:
Wed Jun 26, 2013 09:04
by Topywo
zoropig wrote:how do i make a mob egg or somthing to spawn these mobs?
Thefamilygrog66 has made a mod that might help you with that:
http://forum.minetest.net/viewtopic.php?id=6214

Posted:
Wed Jun 26, 2013 14:29
by zoropig
Mossmanikin wrote:Does your mod load now?
no

Posted:
Wed Jun 26, 2013 14:42
by zoropig
its still not working this is hard.... but it will be done

Posted:
Wed Jun 26, 2013 14:45
by zoropig
oh yeah maybe its the depends thing. it just says default. is there somthing else to put? and i'll tell you whats in my init ok?

Posted:
Wed Jun 26, 2013 14:47
by zoropig
zoropig wrote:oh yeah maybe its the depends thing. it just says default. is there somthing else to put? and i'll tell you whats in my init ok?
it says: dofile(minetest.get_modpath("evil_squid").."/api.lua")
mobs:register_mob("evil_squid:squid", {
type = "animal",
hp_max = 100,
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
visual = "mesh",
mesh = "evil_squid_derpy squid",
textures = {"evil squids_derpy squid.png"},
visual_size = {x=3, y=2.6},
makes_footstep_sound = false,
view_range = 15,
walk_velocity = 1,
run_velocity = 3,
damage = 0,
drops = {
{name = "default:inksack",
chance = 1,
min = 3,
max = 5,},
},
armor = 200,
drawtype = "front",
water_damage = 0,
lava_damage = 5,
light_damage = 0,
on_rightclick = nil,
animation = {
speed_normal = 20,
speed_run = 30,
stand_start = 0,
stand_end = 14,
walk_start = 15,
walk_end = 38,
run_start = 40,
run_end = 63,
punch_start = 40,
punch_end = 63,
}
})

Posted:
Wed Jun 26, 2013 15:21
by Sokomine
Does the model for the squid exist already? A (modified) friendly squid would be welcomed in my waters :-)

Posted:
Wed Jun 26, 2013 16:05
by Mossmanikin
zoropig wrote: mesh = "evil_squid_derpy squid",
textures = {"evil squids_derpy squid.png"},
Looks like the problem here is the empty spaces in the names.

Posted:
Wed Jun 26, 2013 17:14
by Dan Duncombe
Also, there is no such thing as an inksack in default (Not that I know of)
However, making an item version of one would be easy with:
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
minetest.register_craftitem("evil_squid:inksack", {
description = "Ink Sack",
inventory_image = "inksack.png",
})
You need to make an inksack texture and call it 'inksack' It must be a .png picture.

Posted:
Wed Jun 26, 2013 22:07
by zoropig
Dan Duncombe wrote:Also, there is no such thing as an inksack in default (Not that I know of)
However, making an item version of one would be easy with:
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
minetest.register_craftitem("evil_squid:inksack", {
description = "Ink Sack",
inventory_image = "inksack.png",
})
You need to make an inksack texture and call it 'inksack' It must be a .png picture.
do i put this in api or init?

Posted:
Wed Jun 26, 2013 22:24
by Dan Duncombe
Add it (I think) to the end of the init.lua
zoropig wrote:Dan Duncombe wrote:Also, there is no such thing as an inksack in default (Not that I know of)
However, making an item version of one would be easy with:
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
minetest.register_craftitem("evil_squid:inksack", {
description = "Ink Sack",
inventory_image = "inksack.png",
})
You need to make an inksack texture and call it 'inksack' It must be a .png picture.
do i put this in api or init?

Posted:
Thu Jun 27, 2013 14:26
by zoropig
what should i put in depends? (sorry for all the Q. this is my first mod)

Posted:
Thu Jun 27, 2013 15:02
by Dan Duncombe
In the depenbds you should the name, one per line, of any mod that this mod cannot work without. In this case you will probably need to put in the Simple Mobs mod (put the actual modname, not just Simple Mobs)
zoropig wrote:what should i put in depends? (sorry for all the Q. this is my first mod)

Posted:
Fri Jun 28, 2013 14:43
by zoropig
it still does not work for me. i dont know why

Posted:
Fri Jun 28, 2013 15:06
by Dan Duncombe
Instructions for debugging:
1) Go to your minetest/bin folder
2)Find the debug.txt (should be at the top)
3)Delete it
4)Open Minetest and try to play the world so that you get the mod error
5)Close Minetest
6)Open the debug.txt
7)Post all of the contents here, preferably in a code box
8)Also post the mod code
9)Someone will try and see what's wrong with it

Posted:
Fri Jun 28, 2013 18:16
by Mossmanikin
zoropig wrote:it still does not work for me. i dont know why
Neither do I.
Maybe you should post the error message(s) from debug.txt...
EDIT: Aye, see previous post.

Posted:
Sun Jun 30, 2013 14:18
by zoropig
Mossmanikin wrote:zoropig wrote:it still does not work for me. i dont know why
Neither do I.
Maybe you should post the error message(s) from debug.txt...
EDIT: Aye, see previous post.
07:07:04: ERROR[main]: ========== ERROR FROM LUA ===========
07:07:04: ERROR[main]: Failed to load and run script from
07:07:04: ERROR[main]: C:\Users\name\Downloads\minetest-0.4.7\minetest-0.4.7\bin\..\mods\evil_squids\init.lua:
07:07:04: ERROR[main]: cannot open C:\Users\name\Downloads\minetest-0.4.7\minetest-0.4.7\bin\..\mods\evil_squids\init.lua: No such file or directory
07:07:04: ERROR[main]: =======END OF ERROR FROM LUA ========
07:07:04: ERROR[main]: Server: Failed to load and run C:\Users/ <--- woops:name\Downloads\minetest-0.4.7\minetest-0.4.7\bin\..\mods\evil_squids\init.lua
07:07:04: ERROR[main]: ModError: Failed to load and run C:\Users\name\Downloads\minetest-0.4.7\minetest-0.4.7\bin\..\mods\evil_squids\init.lua

Posted:
Sun Jun 30, 2013 14:21
by zoropig
my init thing right now is
dofile(minetest.get_modpath("evil_squid").."/api.lua")
mobs:register_mob("evil_squid:squid", {
type = "animal",
hp_max = 100,
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
visual = "mesh",
mesh = "evil_squid_derpy_squid",
textures = {"evil squids_derpy_squid.png"},
visual_size = {x=3, y=2.6},
makes_footstep_sound = false,
view_range = 15,
walk_velocity = 1,
run_velocity = 3,
damage = 0,
drops = {
{name = "default:inksack",
chance = 1,
min = 3,

Posted:
Mon Jul 01, 2013 01:38
by Mossmanikin
Have you read
this?
And
this?
Does the "evil_squid" folder exist?
Does the "evil_squids" mod exist?
Does the file "api.lua" exist?
Have you added the word "mod" (without "") to "depends.txt"?
Does the mesh "evil_squid_derpy_squid" exist?
Is there something wrong with "evil squids_derpy_squid.png"?
Is "default:inksack" in the mod "default"?
Is this the complete code you have?