Page 1 of 1

Where's the mistake

PostPosted: Sat Mar 09, 2013 21:44
by Tedypig
I'm trying to make a tiki torch "mod" for my girlfriend. I am VERY new to modding/coding, so I copy/pasted the register node from the original torch and deleted/replaced what i needed to. Now I'm getting a fail to load error. Here is a SS of the code.

Image

Any help is appreciated.

PostPosted: Sat Mar 09, 2013 21:45
by PilzAdam
1st: Dont post screenshots of your code, post the code in the code tags of BBCode.
2nd: Post the error message.

PostPosted: Sat Mar 09, 2013 21:50
by Tedypig
Here is the error message.

16:31:51: ERROR[main]: Failed to load and run script from
16:31:51: ERROR[main]: C:\Users\Matt and Betty\Downloads\minetest-0.4.5\minetest-0.4.5\bin\..\mods\minetest\tiki_torch\init.lua:
16:31:51: ERROR[main]: ...s\minetest-0.4.5\minetest-0.4.5\bin\..\mods\minetest\tiki_torch\init.lua:20: ')' expected (to close '(' at line 8) near '='
16:31:51: ERROR[main]: =======END OF ERROR FROM LUA ========



And here is the code.

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
--Tiki_torch by Tedypig






minetest.register_node("tiki_torch:tiki_torch", {
    description = "Tiki Torch",
   

drawtype = "torchlike",
    {"tiki_torch.png", "tiki_torch.png", "tiki_torch.png"},

   

inventory_image = "tiki_torch.png",
    wield_image = "tiki_torch.png",
    paramtype =

"light",
    sunlight_propagates = true,
    walkable = false,
    light_source =

LIGHT_MAX-1,
    },
    groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1},
   

legacy_wallmounted = false,

})



minetest.register_craft({
    output = 'tiki_torch:tiki_torch',
    recipe = {
        {'', 'default:torch', ''},
        {'', 'default:stick', ''},
        {'', 'default:stick', ''},
    }
})



I'm sorry. I didn't know not to do that.

PostPosted: Sat Mar 09, 2013 21:57
by Casimir
Use a good code editing program instead of a texteditor. Then just do the mod again.

PostPosted: Sat Mar 09, 2013 21:58
by Tedypig
Casimir wrote:Use a good code editing program instead of a texteditor. Then just do the mod again.


Can you suggest a good FREE one. Emphasis on free. Lol.

PostPosted: Sat Mar 09, 2013 22:01
by BlockMen
I don't know what you did, but there are way to much blanks, etc

If you type it like folowing it works ;)

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
--Tiki_torch by Tedypig


minetest.register_node("tiki_torch:tiki_torch", {
    description = "Tiki Torch",
    drawtype = "torchlike",
    tiles={"tiki_torch.png", "tiki_torch.png", "tiki_torch.png"},
    inventory_image = "tiki_torch.png",
    wield_image = "tiki_torch.png",
    paramtype = "light",
    sunlight_propagates = true,
    walkable = false,
    light_source = LIGHT_MAX-1,
    groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1},
        legacy_wallmounted = false,
})


minetest.register_craft({
    output = 'tiki_torch:tiki_torch',
    recipe = {
        {'', 'default:torch', ''},
        {'', 'default:stick', ''},
        {'', 'default:stick', ''},
    }
})


PS: make sure you select "ANSI" (coding), when working with notepad

PostPosted: Sat Mar 09, 2013 22:10
by Tedypig
Thank you Blockmen. It was really just blank spaces? I don't know proper structure yet, but I guess that will come with experience right? Lol. Thanks again.

PostPosted: Sat Mar 09, 2013 22:36
by BlockMen
Tedypig wrote:Thank you Blockmen. It was really just blank spaces? I don't know proper structure yet, but I guess that will come with experience right? Lol. Thanks again.



There was a missing "tiles=" before "{"tiki_torch.png", "tiki_torch.png", "tiki_torch.png"},"
and a "}" too much after "LIGHT_MAX-1,".


But im sure you would have found yourself when there haven't been all that blank spaces ;)

And yes, keep that way on and you will get enough experience to see errors like that really fast

PostPosted: Sat Mar 09, 2013 23:07
by Tedypig
I got luaedit just now and i can see that stuff easily. Lol.

Another question (if anyone knows), How do I make part of a texture transparent in gimp? The node for my tiki torch has my (temporary) torch, but there's white all the way around it.

Edit:Fat fingers, had a typo.

PostPosted: Sun Mar 10, 2013 01:08
by prestidigitator
Tedypig wrote:How do I make part of a texture transparent in gimp?

First you have to make sure that every layer in the image has an alpha channel (if your image has only a single layer, this still applies). To do this, activate each layer and choose Layer -> Transparency -> Add Alpha Channel from the menus (if this menu entry is disabled, the layer already has an alpha channel).

Next, you can use the eraser tool or make a selection and choose Edit -> Clear from the menus (or use the Delete key as a shortcut). Note that for a section of your image to be transparent, it must be transparent on all layers of your image.