Error after i modified the code of the spider from mobs_monster
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Error after i modified the code of the spider from mobs_monster
So i was trying to make a tameable spider for mobs_monster using the code given by the creator and i copy and pasted it into a lua file,added the details to init file and the spawn example file but when i load in a world it gives an error, please help!
here's the terminal code:
2021-09-10 14:50:00: WARNING[Main]: system-wide share not found at "/share/minetest"
2021-09-10 14:50:00: WARNING[Main]: system-wide share found at "/snap/minetest/1744/bin/../share/minetest"
2021-09-10 14:50:00: WARNING[Main]: Couldn't find a locale directory!
2021-09-10 14:50:03: WARNING[Main]: Could not load icon file '/share/icons/hicolor/128x128/apps/minetest.png'
2021-09-10 14:50:03: WARNING[Main]: Could not load icon file '/snap/minetest/1744/bin/../share/minetest/misc/minetest-xorg-icon-128.png'
Loaded texture: /snap/minetest/1744/share/minetest/games/devtest/screenshot.png
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
Loaded texture: /snap/minetest/1744/share/minetest/games/devtest/menu/icon.png
Loaded texture: /home/username/snap/minetest/1744/games/mineclone2/menu/icon.png
Loaded texture: /home/username/snap/minetest/1744/games/mineclone5/menu/icon.png
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/icon.png
Loaded texture: /snap/minetest/1744/share/minetest/textures/base/pack/plus.png
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
2021-09-10 14:54:09: ACTION[Main]: [MOD] Mobs Redo loaded
2021-09-10 14:54:10: ACTION[Main]: [Mod] Mobs Skeletons [v0.2.0] loaded.
2021-09-10 14:54:10: ERROR[Main]: ModError: Failed to load and run script from /home/username/snap/minetest/1744/.minetest/games/minetest_game/mods/mobs_monster/init.lua:
2021-09-10 14:54:10: ERROR[Main]: ...st/games/minetest_game/mods/mobs_monster/spider_tame.lua:110: function arguments expected near ':'
2021-09-10 14:54:10: ERROR[Main]: stack traceback:
2021-09-10 14:54:10: ERROR[Main]: [C]: in function 'dofile'
2021-09-10 14:54:10: ERROR[Main]: ....minetest/games/minetest_game/mods/mobs_monster/init.lua:33: in main chunk
2021-09-10 14:54:10: ERROR[Main]: Check debug.txt for details.
2021-09-10 14:54:10: ACTION[Main]: Server: Shutting down
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
here's the terminal code:
2021-09-10 14:50:00: WARNING[Main]: system-wide share not found at "/share/minetest"
2021-09-10 14:50:00: WARNING[Main]: system-wide share found at "/snap/minetest/1744/bin/../share/minetest"
2021-09-10 14:50:00: WARNING[Main]: Couldn't find a locale directory!
2021-09-10 14:50:03: WARNING[Main]: Could not load icon file '/share/icons/hicolor/128x128/apps/minetest.png'
2021-09-10 14:50:03: WARNING[Main]: Could not load icon file '/snap/minetest/1744/bin/../share/minetest/misc/minetest-xorg-icon-128.png'
Loaded texture: /snap/minetest/1744/share/minetest/games/devtest/screenshot.png
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
Loaded texture: /snap/minetest/1744/share/minetest/games/devtest/menu/icon.png
Loaded texture: /home/username/snap/minetest/1744/games/mineclone2/menu/icon.png
Loaded texture: /home/username/snap/minetest/1744/games/mineclone5/menu/icon.png
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/icon.png
Loaded texture: /snap/minetest/1744/share/minetest/textures/base/pack/plus.png
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
2021-09-10 14:54:09: ACTION[Main]: [MOD] Mobs Redo loaded
2021-09-10 14:54:10: ACTION[Main]: [Mod] Mobs Skeletons [v0.2.0] loaded.
2021-09-10 14:54:10: ERROR[Main]: ModError: Failed to load and run script from /home/username/snap/minetest/1744/.minetest/games/minetest_game/mods/mobs_monster/init.lua:
2021-09-10 14:54:10: ERROR[Main]: ...st/games/minetest_game/mods/mobs_monster/spider_tame.lua:110: function arguments expected near ':'
2021-09-10 14:54:10: ERROR[Main]: stack traceback:
2021-09-10 14:54:10: ERROR[Main]: [C]: in function 'dofile'
2021-09-10 14:54:10: ERROR[Main]: ....minetest/games/minetest_game/mods/mobs_monster/init.lua:33: in main chunk
2021-09-10 14:54:10: ERROR[Main]: Check debug.txt for details.
2021-09-10 14:54:10: ACTION[Main]: Server: Shutting down
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
cdb_55e935e0b607
- j0j0n4th4n
- Member
- Posts: 249
- Joined: Tue Jan 26, 2021 06:45
Re: Error after i modified the code of the spider from mobs_monster
What is in the file spider_tame.lua? Specially the block around line 110?
cdb_894a100ddd76
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
},j0j0n4th4n wrote: ↑Fri Sep 10, 2021 11:19What is in the file spider_tame.lua? Specially the block around line 110?
water_damage = 5,
lava_damage = 5,
light_damage = 0,
animation = {
speed_normal = 15,
speed_run = 20,
stand_start = 0,
stand_end = 0,
walk_start = 1,
walk_end = 21,
run_start = 1,
run_end = 21,
punch_start = 25,
punch_end = 45,
},
on_rightclick = function(self, clicker)
local tool = clicker:get_wielded_item()
if tool:get_name() == "mobs:meat_raw" then
clicker:get_inventory:remove_item("main", "mobs:meat_raw")
local pet = minetest.add_entity(self.object:get_pos(),
"mobs_monster:spider_pet")
local ent = pet:get_luaentity()
ent.owner = clicker:get_player_name()
self.object:remove()
end
end
})
cdb_55e935e0b607
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
here's the full codej0j0n4th4n wrote: ↑Fri Sep 10, 2021 11:19What is in the file spider_tame.lua? Specially the block around line 110?
mobs:register_mob("mobs_monster:spider_tame", {
docile_by_day = true,
group_attack = true,
type = "npc",
passive = false,
attack_type = "dogfight",
reach = 2,
damage = 3,
hp_min = 10,
hp_max = 30,
armor = 200,
collisionbox = {-0.8, -0.5, -0.8, 0.8, 0, 0.8},
visual_size = {x = 1, y = 1},
visual = "mesh",
mesh = "mobs_spider.b3d",
textures = {
{"mobs_spider_mese.png"},
{"mobs_spider_orange.png"},
{"mobs_spider_snowy.png"},
{"mobs_spider_grey.png"},
{"mobs_spider_crystal.png"},
},
makes_footstep_sound = false,
sounds = {
random = "mobs_spider",
attack = "mobs_spider",
},
walk_velocity = 1,
run_velocity = 3,
jump = true,
view_range = 15,
floats = 0,
drops = {
{name = "farming:string", chance = 1, min = 0, max = 2},
},
water_damage = 5,
lava_damage = 5,
light_damage = 0,
animation = {
speed_normal = 15,
speed_run = 20,
stand_start = 0,
stand_end = 0,
walk_start = 1,
walk_end = 21,
run_start = 1,
run_end = 21,
punch_start = 25,
punch_end = 45,
}
})
mobs:register_mob("mobs_monster:spider", {
docile_by_day = true,
group_attack = true,
type = "monster",
passive = false,
attack_type = "dogfight",
reach = 2,
damage = 3,
hp_min = 10,
hp_max = 30,
armor = 200,
collisionbox = {-0.8, -0.5, -0.8, 0.8, 0, 0.8},
visual_size = {x = 1, y = 1},
visual = "mesh",
mesh = "mobs_spider.b3d",
textures = {
{"mobs_spider_mese.png"},
{"mobs_spider_orange.png"},
{"mobs_spider_snowy.png"},
{"mobs_spider_grey.png"},
{"mobs_spider_crystal.png"},
},
makes_footstep_sound = false,
sounds = {
random = "mobs_spider",
attack = "mobs_spider",
},
walk_velocity = 1,
run_velocity = 3,
jump = true,
view_range = 15,
floats = 0,
drops = {
{name = "farming:string", chance = 1, min = 0, max = 2},
},
water_damage = 5,
lava_damage = 5,
light_damage = 0,
animation = {
speed_normal = 15,
speed_run = 20,
stand_start = 0,
stand_end = 0,
walk_start = 1,
walk_end = 21,
run_start = 1,
run_end = 21,
punch_start = 25,
punch_end = 45,
},
on_rightclick = function(self, clicker)
local tool = clicker:get_wielded_item()
if tool:get_name() == "mobs:meat_raw" then
clicker:get_inventory:remove_item("main", "mobs:meat_raw")
local pet = minetest.add_entity(self.object:get_pos(),
"mobs_monster:spider_pet")
local ent = pet:get_luaentity()
ent.owner = clicker:get_player_name()
self.object:remove()
end
end
})
cdb_55e935e0b607
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
Backup your original spider.lua file and replace it with the one inside the zip file which lets you tame a spider by right-clicking it with 5x raw meat:
- Attachments
-
- spider.zip
- (1.37 KiB) Downloaded 39 times
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
so i should delete the spider_tame file?
alright then
alright then
cdb_55e935e0b607
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
OH YEAH BOIII I TAMED A SPIDER!!!
I DON'T KNOW HOW MUCH I SHOULD THANK YOU!!!!
I DON'T KNOW HOW MUCH I SHOULD THANK YOU!!!!
cdb_55e935e0b607
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
oh no i can't heal it sadly :(
cdb_55e935e0b607
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
how do i add a healing feature?
cdb_55e935e0b607
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
how do i add healing feature?
cdb_55e935e0b607
Re: Error after i modified the code of the spider from mobs_monster
For the mobs_animal:spider_tame mob definition, add these lines:
Code: Select all
follow = {"mobs:meat_raw},
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 5, false, true) then return end
end
- 56independent_actual
- Member
- Posts: 452
- Joined: Sun May 23, 2021 16:10
- IRC: independent56
- In-game: 56independent
- Location: Girona Province
- Contact:
Re: Error after i modified the code of the spider from mobs_monster
Before OP goes on any more, i seriously suggest they read this article before they move on (do not ask the writers your question!).
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
Thank you very muchTenPlus1 wrote: ↑Fri Sep 10, 2021 15:35For the mobs_animal:spider_tame mob definition, add these lines:
Code: Select all
follow = {"mobs:meat_raw}, on_rightclick = function(self, clicker) if mobs:feed_tame(self, clicker, 5, false, true) then return end end
cdb_55e935e0b607
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
TenPlus1 wrote: ↑Fri Sep 10, 2021 15:35For the mobs_animal:spider_tame mob definition, add these lines:
Code: Select all
follow = {"mobs:meat_raw}, on_rightclick = function(self, clicker) if mobs:feed_tame(self, clicker, 5, false, true) then return end end
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
2021-09-11 15:18:40: ACTION[Main]: [MOD] Mobs Redo loaded
2021-09-11 15:18:40: ACTION[Main]: [Mod] Mobs Skeletons [v0.2.0] loaded.
2021-09-11 15:18:40: ERROR[Main]: ModError: Failed to load and run script from /home/username/snap/minetest/1744/.minetest/games/minetest_game/mods/mobs_monster/init.lua:
2021-09-11 15:18:40: ERROR[Main]: ...inetest/games/minetest_game/mods/mobs_monster/spider.lua:110: '}' expected (to close '{' at line 56) near 'local'
2021-09-11 15:18:40: ERROR[Main]: stack traceback:
2021-09-11 15:18:40: ERROR[Main]: [C]: in function 'dofile'
2021-09-11 15:18:40: ERROR[Main]: ....minetest/games/minetest_game/mods/mobs_monster/init.lua:30: in main chunk
2021-09-11 15:18:40: ERROR[Main]: Check debug.txt for details.
2021-09-11 15:18:40: ACTION[Main]: Server: Shutting down
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
cdb_55e935e0b607
- 56independent_actual
- Member
- Posts: 452
- Joined: Sun May 23, 2021 16:10
- IRC: independent56
- In-game: 56independent
- Location: Girona Province
- Contact:
Re: Error after i modified the code of the spider from mobs_monster
Please show us line 56 and it's surrounding lines (20 is enough).FrostTheLionCat wrote: ↑Sat Sep 11, 2021 09:47TenPlus1 wrote: ↑Fri Sep 10, 2021 15:35For the mobs_animal:spider_tame mob definition, add these lines:
Code: Select all
follow = {"mobs:meat_raw}, on_rightclick = function(self, clicker) if mobs:feed_tame(self, clicker, 5, false, true) then return end end
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
2021-09-11 15:18:40: ACTION[Main]: [MOD] Mobs Redo loaded
2021-09-11 15:18:40: ACTION[Main]: [Mod] Mobs Skeletons [v0.2.0] loaded.
2021-09-11 15:18:40: ERROR[Main]: ModError: Failed to load and run script from /home/username/snap/minetest/1744/.minetest/games/minetest_game/mods/mobs_monster/init.lua:
2021-09-11 15:18:40: ERROR[Main]: ...inetest/games/minetest_game/mods/mobs_monster/spider.lua:110: '}' expected (to close '{' at line 56) near 'local'
2021-09-11 15:18:40: ERROR[Main]: stack traceback:
2021-09-11 15:18:40: ERROR[Main]: [C]: in function 'dofile'
2021-09-11 15:18:40: ERROR[Main]: ....minetest/games/minetest_game/mods/mobs_monster/init.lua:30: in main chunk
2021-09-11 15:18:40: ERROR[Main]: Check debug.txt for details.
2021-09-11 15:18:40: ACTION[Main]: Server: Shutting down
Loaded texture: /home/username/snap/minetest/1744/games/minetest_game/menu/header.png
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
i fixed it and it works perfectly!
cdb_55e935e0b607
- 56independent_actual
- Member
- Posts: 452
- Joined: Sun May 23, 2021 16:10
- IRC: independent56
- In-game: 56independent
- Location: Girona Province
- Contact:
Re: Error after i modified the code of the spider from mobs_monster
Please do not ask a question and then say it works fine. try fixing it and then ask your questions.
I strongly urge that you read http://www.catb.org/~esr/faqs/smart-questions.html in full. (Please note the authors are not there to answer your questions, they have no idea of your existence.)
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
I ran into the error again because i accidentally uninstalled minetest_game
but this time
2021-10-21 16:17:36: ERROR[Main]: ModError: Failed to load and run script from /home/username/snap/minetest/1744/.minetest/games/minetest_game/mods/mobs_monster/init.lua:
2021-10-21 16:17:36: ERROR[Main]: ...inetest/games/minetest_game/mods/mobs_monster/spider.lua:125: unexpected symbol near '='
2021-10-21 16:17:36: ERROR[Main]: stack traceback:
2021-10-21 16:17:36: ERROR[Main]: [C]: in function 'dofile'
2021-10-21 16:17:36: ERROR[Main]: ....minetest/games/minetest_game/mods/mobs_monster/init.lua:30: in main chunk
2021-10-21 16:17:36: ERROR[Main]: Check debug.txt for details.
but this time
2021-10-21 16:17:36: ERROR[Main]: ModError: Failed to load and run script from /home/username/snap/minetest/1744/.minetest/games/minetest_game/mods/mobs_monster/init.lua:
2021-10-21 16:17:36: ERROR[Main]: ...inetest/games/minetest_game/mods/mobs_monster/spider.lua:125: unexpected symbol near '='
2021-10-21 16:17:36: ERROR[Main]: stack traceback:
2021-10-21 16:17:36: ERROR[Main]: [C]: in function 'dofile'
2021-10-21 16:17:36: ERROR[Main]: ....minetest/games/minetest_game/mods/mobs_monster/init.lua:30: in main chunk
2021-10-21 16:17:36: ERROR[Main]: Check debug.txt for details.
cdb_55e935e0b607
- FrostTheLionCat
- Member
- Posts: 28
- Joined: Thu Sep 09, 2021 14:48
Re: Error after i modified the code of the spider from mobs_monster
here's the code:TenPlus1 wrote: ↑Fri Sep 10, 2021 15:35For the mobs_animal:spider_tame mob definition, add these lines:
Code: Select all
follow = {"mobs:meat_raw}, on_rightclick = function(self, clicker) if mobs:feed_tame(self, clicker, 5, false, true) then return end end
local tex_backup = self.base_texture
local pet = minetest.add_entity(self.object:get_pos(),
"mobs_monster:spider_tame")
follow = {"mobs:meat_raw"},
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 5, false, true) then return end
end
local ent = pet:get_luaentity()
if ent then
ent.owner = clicker:get_player_name()
ent.base_texture = tex_backup
pet:set_properties({textures = tex_backup})
end
self.object:remove()
end
end
})
cdb_55e935e0b607
- Blockhead
- Member
- Posts: 1623
- Joined: Wed Jul 17, 2019 10:14
- GitHub: Montandalar
- IRC: Blockhead256
- In-game: Blockhead Blockhead256
- Location: Land Down Under
- Contact:
Re: Error after i modified the code of the spider from mobs_monster
Your problem(s) look like simple syntax errors to me:
FrostTheLionCat wrote: ↑Thu Oct 21, 2021 10:56Code: Select all
follow = {"mobs:meat_raw"}, ^ ^ | \-- Don't put a comma here \--Don't forget to end the string with a matching quote on_rightclick = function(self, clicker) if mobs:feed_tame(self, clicker, 5, false, true) then return end end
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂
Who is online
Users browsing this forum: No registered users and 4 guests