1st attempt at a mod ---all hair pulled. SOLVED

User avatar
Posts: 57
Joined: Sat Aug 10, 2019 13:31

1st attempt at a mod ---all hair pulled. SOLVED

by Steamed_Punk » Tue Aug 27, 2019 15:52

Hi i am trying to get a new .obj to show in MT.

I have tried going over ruben's book and various other sources. I have tried, youtube videos for .b3d (but i am working with a .obj) and can't for the life of me get my attempt to load. From the little i have learned so far i am guessing i am having issues with naming my own stuff correctly because MT can't register my mod.
I also followed another tutorial for a mob_animal reuse and managed to rename the mod, the panda, remove excess data and get it to work. So i know i'm not completely stupid :D

I think some of you will look at this and most likely see the problem instantly and hopefully be able to help.....
here is the debug output,
Code: Select all

2019-08-27 17:31:21: ERROR[Main]: ModError: Failed to load and run script from D:\Work\minetest-5.0.1-win64\bin\..\mods\testmod\init.lua:
2019-08-27 17:31:21: ERROR[Main]: ...rk\minetest-5.0.1-win64\bin\..\builtin\game\register.lua:205: attempt to index local 'nodedef' (a string value)
2019-08-27 17:31:21: ERROR[Main]: stack traceback:
2019-08-27 17:31:21: ERROR[Main]:    ...rk\minetest-5.0.1-win64\bin\..\builtin\game\register.lua:205: in function 'register_node'
2019-08-27 17:31:21: ERROR[Main]:    ...\minetest-5.0.1-win64\bin\..\mods\testmod\init.lua:6: in main chunk
2019-08-27 17:31:21: ERROR[Main]: Check debug.txt for details.
2019-08-27 17:31:21: ACTION[Main]: Server: Shutting down
2019-08-27 17:31:24: ERROR[Main]: Please choose a name!

BTW the path structure is as follows based on that from the wiki:

├── modname
│ ├── mod.conf
│ ├── screenshot.png
│ ├── settingtypes.txt
│ ├── init.lua
│ ├── models
│ ├── textures
│ │ ├── myimage.png
│ ├── sounds
│ ├── locale
│ ├── readme.md

Last edited by Steamed_Punk on Tue Aug 27, 2019 21:51, edited 1 time in total.
The sky is not the limit - It's my playground

User avatar
Posts: 2801
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: 1st attempt at a mod ---all hair pulled.

by TumeniNodes » Tue Aug 27, 2019 16:26

would help if you could use pastebin to share the code.
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am

User avatar
Posts: 1523
Joined: Wed Aug 19, 2015 19:11
Location: Oklahoma City
GitHub: duane-r

Re: 1st attempt at a mod ---all hair pulled.

by duane » Tue Aug 27, 2019 16:41

Steamed_Punk wrote:attempt to index local 'nodedef' (a string value)

That means you're passing a string value instead of the table that the function expects. Check your lua doc, and fix it.
Believe in people and you don't need to believe anything else.

User avatar
Posts: 2120
Joined: Wed Sep 17, 2014 11:21
Location: Germany
In-game: Linuxdirk

Re: 1st attempt at a mod ---all hair pulled.

by Linuxdirk » Tue Aug 27, 2019 16:48

The message shows you from least specific to most specific where your error happens. The first error is caused by the second, the second by the third, and so on.

Following this rule it's easy to find out why "attempt to index local 'nodedef' (a string value)" happens. Just follow the messages down to the files you can modify.

In your testmod's init.lua in line 6 there is something not correct.

User avatar
Posts: 57
Joined: Sat Aug 10, 2019 13:31

Re: 1st attempt at a mod ---all hair pulled.

by Steamed_Punk » Tue Aug 27, 2019 21:50

@duane I followed your 'advice' and went back to reading some more, but still couldn't get my head round it, a break is needed, i've been at it since.

@Linuxdirk now that helped me understand a certain part of the logic. This is all new to me and to be honest your explanation allowed me to confirm my theory about how i had structured and named things in the init.lua

This was further confirmed after installing slope_test-23 by Vanessa. After checking how she had done it i could clearly see my errors.
So a 'BIG THANK-YOU' to Vanessa my issue is resolved. Sorry i don't know how to tag her here.

I have quite a few models i built over the years for another programming language (not MC) started long before that. I am curios as to how they will hold up to a conversion. I'm off to play for a few days be back soon.
The sky is not the limit - It's my playground

Return to Problems

Who is online

Users browsing this forum: No registered users and 3 guests