ElCeejo / animalia

Basic Fauna for Minetest Game
MIT License
14 stars 37 forks source link

.../mods/animalia/craftitems.lua:515: attempt to index global 'armor' (a nil value) #74

Closed bcwagne closed 8 months ago

bcwagne commented 10 months ago

Server will not start with animalia and 3d_armor installed. Commenting out the armor section (lines 514 - 545) of .../.minetest/mods/animalia/craftitems.lua fixes the problem.

Running Minetest 5.6.1 on Debian Stable

Installed mods: Dreambuilder Game 3d_armor animalia armor expanded creatura ethereal ng mobs redo api

debug.txt output:

2024-01-13 09:30:21: WARNING[Main]: Undeclared global variable "armor" accessed at .../.minetest/mods/animalia/craftitems.lua:515 2024-01-13 09:30:21: ERROR[Main]: ModError: Failed to load and run script from .../.minetest/mods/animalia/init.lua: 2024-01-13 09:30:21: ERROR[Main]: .../.minetest/mods/animalia/craftitems.lua:515: attempt to index global 'armor' (a nil value) 2024-01-13 09:30:21: ERROR[Main]: stack traceback: 2024-01-13 09:30:21: ERROR[Main]: .../.minetest/mods/animalia/craftitems.lua:515: in main chunk 2024-01-13 09:30:21: ERROR[Main]: [C]: in function 'dofile' 2024-01-13 09:30:21: ERROR[Main]: .../.minetest/mods/animalia/init.lua:109: in main chunk 2024-01-13 09:30:21: ERROR[Main]: Check debug.txt for details. 2024-01-13 09:30:21: ACTION[Main]: Server: Shutting down

quenenni commented 10 months ago

Hello,

I have the same problem.

I updated animalia mod today and since, I have the same error.

It's linked to your new code for 3D armor mod.

If I remove the code section "-- Armor --" you recently add in craftitems.lua, it works again.

-- Armor --
-----------

if minetest.get_modpath("3d_armor") then
    table.insert(armor.attributes, "heavy_pelt")
...

In the meantime, I put back the before last version of animalia mod and I can play again.

TheCorruptCat commented 10 months ago

same

TheCorruptCat commented 10 months ago

ModError: Failed to load and run script from /home/carter/.var/app/net.minetest.Minetest/.minetest/mods/animalia/init.lua: ...minetest.Minetest/.minetest/mods/animalia/craftitems.lua:515: attempt to index global 'armor' (a nil value) stack traceback: ...minetest.Minetest/.minetest/mods/animalia/craftitems.lua:515: in main chunk [C]: in function 'dofile' ...p/net.minetest.Minetest/.minetest/mods/animalia/init.lua:109: in main chunk Check debug.txt for details.

vonglahn commented 10 months ago

I go the same error but its more complicated.

  1. I can start a world with animalia + 3d armor only
  2. I can't start a world with animalia + 3d armor + farming + moreblocks (invsaw is deactivated)
  3. But when I deactivate the stairs part of moreblocks the world starts again.

I'm confused

eris667 commented 10 months ago

2024-01-22 03:35:20: ACTION[Main]: Server: Shutting down 2024-01-22 03:35:21: ERROR[Main]: ModError: Failed to load and run script from /home/eris667/.minetest/mods/animalia/init.lua: 2024-01-22 03:35:21: ERROR[Main]: /home/eris667/.minetest/mods/animalia/craftitems.lua:515: attempt to index global 'armor' (a nil value) 2024-01-22 03:35:21: ERROR[Main]: stack traceback: 2024-01-22 03:35:21: ERROR[Main]: /home/eris667/.minetest/mods/animalia/craftitems.lua:515: in main chunk 2024-01-22 03:35:21: ERROR[Main]: [C]: in function 'dofile' 2024-01-22 03:35:21: ERROR[Main]: /home/eris667/.minetest/mods/animalia/init.lua:109: in main chunk

Looks like the same problem as others -- I rolled back to the previous version in the interim

programmerjake commented 9 months ago

basically, the problem is that 3d_armor isn't listed as an optional dependency so sometimes it loads after animalia, which causes armor to not be defined. This is fixed by #80

ElCeejo commented 8 months ago

Should be fixed