[SOLVED] Hi, It's been a year...........

Post Reply
User avatar
Steamed_Punk
Member
Posts: 157
Joined: Sat Aug 10, 2019 13:31
GitHub: steamed-punk

[SOLVED] Hi, It's been a year...........

by Steamed_Punk » Post

and my mod seems to be broken.
I have been more or less offline and unwired for almost a year. My brain has gone soft and slow. I hope people are still around and well.

For those that remember i built a Native American Village (for fun) you could even sleep in the tepee. but not any more.
I get this error message.

ModError: Failed to load and run script from /home/usr/.minetest/mods/Native-American-Village/init.lua:
....minetest/mods/Native-American-Village/indianvillage.lua:10: attempt to index global 'beds' (a nil value)
stack traceback:
....minetest/mods/Native-American-Village/indianvillage.lua:10: in main chunk
[C]: in function 'dofile'
...e/usr/.minetest/mods/Native-American-Village/init.lua:10: in main chunk
Check debug.txt for details.


I know this should be a simple solution but just can't see it. After 5 hours of reading I admit i need a little pointer to get me back on track.

Like i said soft brain after a year from IT.
Cheers

BTW this is on linux mint 20

INDIANVILLAGE.LUA

-- Copyright (C) 2019 Steamed_Punk steamedpunk.mt at gmail.com

-- SLEEPEE TEEPEE

beds.register_bed("nativeamericanvillage:tepee", {
description = "Sleepee Tepee",
drawtype = "mesh",
mesh = "indianvillage_teepee01.obj",
tiles = {"indianvillage_teepee01.png"},
wield_image = "item_teepee01.png",
inventory_image = "item_teepee01.png",
buildable_to = false,
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
on_place = minetest.rotate_node,
selectionbox = {-1.5, -0.5, -1.5, 1.5, 1.5, 1.5},
collisionbox = {-1.5, -0.5, -1.5, 1.5, 1.5, 1.5},
recipe = {
{'', 'default:stick ', ''},
{'default:stick','nativeamericanvillage:buffalotanned', 'default:stick '},
{'default:stick', 'nativeamericanvillage:buffalotanned', 'default:stick '},
},
})


INIT.LUA

-- Native American Village by Steamed_Punk (CC BY-NC 3.0)
local path = minetest.get_modpath("nativeamericanvillage")

-- Load support for intllib.
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")

-- Native American Village

dofile(path .. "/indianvillage.lua") -- Steamed_Punk
dofile(path .. "/decor.lua") -- Steamed_Punk
dofile(path .. "/bbcanoe.lua") -- Steamed_Punk
dofile(path .. "/campfire.lua") -- Steamed_Punk
dofile(path .. "/buffalo.lua") -- Steamed_Punk
dofile(path .. "/tools.lua") -- Steamed_Punk
dofile(path .. "/ore.lua") -- Steamed_Punk
dofile(path .. "/tanning.lua") -- Steamed_Punk

print (S("[MOD] Native American Village loaded"))


DEBUG.TXT

2020-09-15 22:45:19: [Main]: Automatically selecting world at [/home/usr/.minetest/worlds/Native lands]
2020-09-15 22:45:23: ACTION[Main]: [MOD] Mobs Redo loaded
2020-09-15 22:45:23: WARNING[Main]: Undeclared global variable "beds" accessed at ....minetest/mods/Native-American-Village/indianvillage.lua:10
2020-09-15 22:45:23: ERROR[Main]: ModError: Failed to load and run script from /home/usr/.minetest/mods/Native-American-Village/init.lua:
2020-09-15 22:45:23: ERROR[Main]: ....minetest/mods/Native-American-Village/indianvillage.lua:10: attempt to index global 'beds' (a nil value)
2020-09-15 22:45:23: ERROR[Main]: stack traceback:
2020-09-15 22:45:23: ERROR[Main]: ....minetest/mods/Native-American-Village/indianvillage.lua:10: in main chunk
2020-09-15 22:45:23: ERROR[Main]: [C]: in function 'dofile'
2020-09-15 22:45:23: ERROR[Main]: ...e/usr/.minetest/mods/Native-American-Village/init.lua:10: in main chunk
2020-09-15 22:45:23: ERROR[Main]: Check debug.txt for details.
2020-09-15 22:45:23: ACTION[Main]: Server: Shutting down
Last edited by Steamed_Punk on Fri Sep 18, 2020 19:53, edited 1 time in total.
The sky is not the limit - It's my playground

User avatar
rubenwardy
Moderator
Posts: 6280
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Hi, It's been a year...........

by rubenwardy » Post

It looks like you're missing a dependency on "beds". Is this a mod you've created yourself?

User avatar
Steamed_Punk
Member
Posts: 157
Joined: Sat Aug 10, 2019 13:31
GitHub: steamed-punk

Re: Hi, It's been a year...........

by Steamed_Punk » Post

rubenwardy wrote:
Wed Sep 16, 2020 17:42
It looks like you're missing a dependency on "beds". Is this a mod you've created yourself?
Hi Ruben,
The mod i built myself, well with a great helping hand from the community, https://steamed-punk.github.io/
about a year ago. So, long after beds were integrated into minetest. I was learning as i built and from what i can remember the Tepee simply called on the default bed so that when people clicked on the Tepee they are suddenly laying down inside it and dropping off to sleep to pass the night. This worked last year :(

From what i remember about error messages i think i followed it through and posted all the relative info.
Sorry, I really have been a long time away from a computor. Funny though, the first thing i wanted to do was come back here and have another go at modding :D
The sky is not the limit - It's my playground

User avatar
rubenwardy
Moderator
Posts: 6280
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Hi, It's been a year...........

by rubenwardy » Post

You don't appear to have posted a mod.conf or a depends.txt file - which is where the dependencies are listed.

You should have a file called mod.conf next to init.lua with contents like this:

Code: Select all

name = nativeamericanvillage
depends = beds

User avatar
rubenwardy
Moderator
Posts: 6280
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Hi, It's been a year...........

by rubenwardy » Post

You do have a depends.txt, but it doesn't have beds inside it: https://github.com/Steamed-Punk/Native- ... epends.txt

User avatar
Steamed_Punk
Member
Posts: 157
Joined: Sat Aug 10, 2019 13:31
GitHub: steamed-punk

Re: Hi, It's been a year...........

by Steamed_Punk » Post

I will try to be clear here, because one thing lead to another......
Firstly i remember that someone said before that there is a .txt or .conf file that is no longer required as it can be done from the other. Wondering if i overlooked something a year ago.

Firstly here is the depends.txt

default
player_api
farming
fire
mobs
bows
bonemeal
throwing

This did not have bed or beds included, so i tried both. this did not change the error message. On the other hand....

This is the mod.conf

name = nativeamericanvillage
description = Adds tepees, a campfire various decorations and mobs!
release = 0.0.2
author = Steamed Punk
title = Native American Village

This did not have bed or beds either. I tried with what you wrote 'depends = beds' but this gave off other errors concerning naming, farming for one. My mod requires mobs so that my buffalo can be used, but as i mention in the other thread, nothing seems to be showing, in creative, and double checked they are enabled.

I then tried adding the other dependencies farming fire mobs etc to the .conf file. I followed your 'depends = beds" example 'depends = theothers' but this removed beds from the display in MT and replacing it with the 'depends = lastinthelist' so now i am getting really confused and put everything back as it was. I tired to be clear :D
The sky is not the limit - It's my playground

Skamiz Kazzarch
Member
Posts: 166
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: Hi, It's been a year...........

by Skamiz Kazzarch » Post

'depends.txt' is the old way, the current one is to use 'mod.conf'

Here is the relevant documentaion:
https://github.com/minetest/minetest/bl ... i.txt#L182
The important bit:

Code: Select all

`depends`: A comma separated list of dependencies. These are mods that must be
             loaded before this mod.
So your case would look like this:

Code: Select all

depends = default, player_api, farming, fire, mobs, bows, bonemeal, throwing, beds

User avatar
Steamed_Punk
Member
Posts: 157
Joined: Sat Aug 10, 2019 13:31
GitHub: steamed-punk

Re: Hi, It's been a year...........

by Steamed_Punk » Post

Skamiz Kazzarch wrote:
Thu Sep 17, 2020 20:41
'depends.txt' is the old way, the current one is to use 'mod.conf'

Here is the relevant documentaion:
https://github.com/minetest/minetest/bl ... i.txt#L182
The important bit:

Code: Select all

`depends`: A comma separated list of dependencies. These are mods that must be
             loaded before this mod.
So your case would look like this:

Code: Select all

depends = default, player_api, farming, fire, mobs, bows, bonemeal, throwing, beds
Hi Skamiz,
and thanks, the comma had crossed my mind, but for some reason i just didn't do it. IDIOT me.
the dependencies are now showing in the left panel in MT.

Does this mean i can safely remove the depends.txt file from the mod?

The error is still there though :(

It is as follows from debug.


-------------
Separator
-------------

2020-09-17 23:50:41: [Main]: Automatically selecting world at [/home/ME/.minetest/worlds/test]
2020-09-17 23:50:54: ACTION[Main]: [MOD] Mobs Redo loaded
2020-09-17 23:50:54: ERROR[Main]: ModError: Failed to load and run script from /home/ME/.minetest/mods/Native_American_Village/init.lua:
2020-09-17 23:50:54: ERROR[Main]: /usr/share/minetest/games/minetest_game/mods/beds/api.lua:42: attempt to index field 'nodebox' (a nil value)
2020-09-17 23:50:54: ERROR[Main]: stack traceback:
2020-09-17 23:50:54: ERROR[Main]: /usr/share/minetest/games/minetest_game/mods/beds/api.lua:42: in function 'register_bed'
2020-09-17 23:50:54: ERROR[Main]: ....minetest/mods/Native_American_Village/indianvillage.lua:10: in main chunk
2020-09-17 23:50:54: ERROR[Main]: [C]: in function 'dofile'
2020-09-17 23:50:54: ERROR[Main]: ...e/ME/.minetest/mods/Native_American_Village/init.lua:10: in main chunk
2020-09-17 23:50:54: ERROR[Main]: Check debug.txt for details.
2020-09-17 23:50:54: ACTION[Main]: Server: Shutting down
2020-09-17 23:50:58: ERROR[Main]: Please choose a name!


I am looking at 'dofile' in init.lua beds is not mentioned there but i am guessing there is a problem with the paths.
The sky is not the limit - It's my playground

User avatar
rubenwardy
Moderator
Posts: 6280
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Hi, It's been a year...........

by rubenwardy » Post

That's a different error - it looks like you haven't specified nodebox in your bed definition. This requirement hasn't changed in 5 years, so it's not a regression in 5.3.0

It looks like beds only supports nodeboxes, and not mesh nodes.

See the beds API documentation: https://github.com/minetest/minetest_ga ... pi.txt#L63

Skamiz Kazzarch
Member
Posts: 166
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: Hi, It's been a year...........

by Skamiz Kazzarch » Post

Steamed_Punk wrote:
Thu Sep 17, 2020 21:58
Does this mean i can safely remove the depends.txt file from the mod?
Yes.

Your current issue isn't about paths. It is caused because 'beds' expects you to suply a table called 'nodebox' and you didn't.

Here is the relevant documentation: https://github.com/minetest/minetest_ga ... pi.txt#L53

Make sure your call to 'beds.register_bed' provides a correct bed definition.

Edit: ... and I just got ninjad.

User avatar
Steamed_Punk
Member
Posts: 157
Joined: Sat Aug 10, 2019 13:31
GitHub: steamed-punk

Re: Hi, It's been a year...........

by Steamed_Punk » Post

rubenwardy wrote:
Fri Sep 18, 2020 10:05
That's a different error - it looks like you haven't specified nodebox in your bed definition. This requirement hasn't changed in 5 years, so it's not a regression in 5.3.0

It looks like beds only supports nodeboxes, and not mesh nodes.

See the beds API documentation: https://github.com/minetest/minetest_ga ... pi.txt#L63
OK, now I am confused. I know that before putting this up on Github I had thoroughly tested. I remember seeing the inside of the tepee and the (separately placed) torch on the ground that lights it up the inside just as i fell to sleep.
looks like I've got some reading to do to catch up and try and solve this.
Thank you for helping me track this down.
The sky is not the limit - It's my playground

User avatar
Steamed_Punk
Member
Posts: 157
Joined: Sat Aug 10, 2019 13:31
GitHub: steamed-punk

Re: Hi, It's been a year...........

by Steamed_Punk » Post

Skamiz Kazzarch wrote:
Fri Sep 18, 2020 10:09
Steamed_Punk wrote:
Thu Sep 17, 2020 21:58
Does this mean i can safely remove the depends.txt file from the mod?
Yes.

Your current issue isn't about paths. It is caused because 'beds' expects you to suply a table called 'nodebox' and you didn't.

Here is the relevant documentation: https://github.com/minetest/minetest_ga ... pi.txt#L53

Make sure your call to 'beds.register_bed' provides a correct bed definition.

Edit: ... and I just got ninjad.
Thank you i will remove the file.

Ninjad or not ;) thanks
The sky is not the limit - It's my playground

User avatar
Steamed_Punk
Member
Posts: 157
Joined: Sat Aug 10, 2019 13:31
GitHub: steamed-punk

[SOLVED]Re: Hi, It's been a year...........

by Steamed_Punk » Post

IT'S ALL MY BAD.

I now need to update github with new updates and inform eventual users that the default beds needs to be overridden by 'Mesh Beds' by JP here viewtopic.php?f=9&t=11817&hilit=bed+mesh

and i guess you can say alls good to go. Unless of course i learn how to integrate mesh beds into my mod (that's another story)

Once again, thanks to you all that helped me narrow down and remember something from a year ago. So sorry if i wasted your time :(
The sky is not the limit - It's my playground

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests