Need mod help

Post Reply
Yuser
Member
Posts: 12
Joined: Sat Jun 01, 2013 18:09

Need mod help

by Yuser » Post

This is my first time modding, you may be able to tell, but I was trying to get the framework of my mod in minetest and it just tells me failed to load and run the mod, with no information (but I haven't looked in debug yet, but I'm not sure how to read the debug lol)

this is the code so far that won't run

And right now it says unexpected symbol near ' '

some of the stuff I dodn't fill in yet, I'm worried about the ' ' right now
and other syntax errors

Code: Select all

minetest.register_craft({
    output = 'planes:battery',
    inventory_image = "planes_battery.png"
    recipe = {
        {'default:iron_ingot', '', ''},
        {'default:mese_crystal', '', ''},
        {'default:iron_ingot', '', ''},
    }
})
})

minetest.register_craft({
    output = 'planes:esc_and_motor',
    inventory_image = "motor.png"
    recipe = {
        {'default:mese_crystal_fragment', 'default:mese_crystal_fragment', 'default:iron_ingot'},
        {'default:mese_crystal_fragment', 'default:iron_ingot', 'default:iron_ingot'},
        {'default:iron_ingot', '', 'default:iron_ingot'},
    }
})
})

minetest.register_craft({
    output = 'planes:reciever',
    inventory_image = "receiver.png"
    recipe = {
        {'default:iron_ingot', '', ''},
        {'default:mese_crystal', '', ''},
        {'', '', ''},
    }
})
})

minetest.register_craft({
    output = 'planes:electric_plane',
    inventory_image = "plane_flat.png",
    recipe = {
        {'default:wood_planks', 'planes:esc_and_motor', 'default:wood_planks'},
        {'default:mese_crystal', 'planes:battery', ''},
        {'', 'planes:receiver', ''},
    }
    on_place_on_ground = envref.add_entity(player,electric_plane)
})
})

minetest.register_entity(planes:rc_plane_flying, entity_definition)

print( 'Planes Mod: LOADED ' )
Last edited by Yuser on Mon Jun 03, 2013 14:51, edited 1 time in total.

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

You definetly need to paste the output of debug.txt, otherwise someone need to go through all the code and check the syntax "by hand". Nobody will do that.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Aside from the fact that register_craft() doesn't use those "inventory_image" fields, you're missing commas after some of them. For that, you want register_craftitem(), which works like an abridged version of register_node(). You must register the items themselves (which is how you assign them textures, names, etc) separately from the craft recipes used to make them.

See: https://github.com/minetest/minetest/bl ... .txt#L1609

and: https://github.com/minetest/minetest/bl ... .txt#L1790
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Yuser
Member
Posts: 12
Joined: Sat Jun 01, 2013 18:09

by Yuser » Post

Okay, that first post is no longer relevant, I changed a whole lot, but the debug keeps pointing to something that doesn't exist. What encoding should the file have? I tried ANSI and Unicode.

Nore
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

Remove those inventory_image things, they bug the mod because there are no , after them... Moreover, they are useless in register_craft. You can also use remove the empty columns in register_craft so that shifting the recipe one slot right will still work.

Yuser
Member
Posts: 12
Joined: Sat Jun 01, 2013 18:09

by Yuser » Post

Yuser wrote:Okay, that first post is no longer relevant, I changed a whole lot, but the debug keeps pointing to something that doesn't exist. What encoding should the file have? I tried ANSI and Unicode.
In other words the first code posted doesn't exist anymore. I'm asking about file encoding. Depending on the encoding it says near' ' or near '(upside down u)' or near '}'. The code doesn't have any of that.
Last edited by Yuser on Mon Jun 03, 2013 20:14, edited 1 time in total.

tinoesroho
Member
Posts: 570
Joined: Fri Feb 17, 2012 21:55
Location: Canada

by tinoesroho » Post

... I don't know. Windows or Linux?
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/

User avatar
BlockMen
Developer
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen
Location: Germany

by BlockMen » Post

Yuser wrote:Okay, that first post is no longer relevant, I changed a whole lot, but the debug keeps pointing to something that doesn't exist. What encoding should the file have? I tried ANSI and Unicode.
If you are using notepad under windows ANSI ;)

Yuser
Member
Posts: 12
Joined: Sat Jun 01, 2013 18:09

by Yuser » Post

Thank you, blockmen. I redid the whole thing, the same as last time in ANSI again, but this time it worked and I have all of the craft items in. Now I need to do the entity part, which is very confusing to me haha.
right now I have

minetest.register_entity("helicopter:Y1_flying", {
stuff that goes here
})

and it can't find the } for whatever reason. I fixed the other problem.
Last edited by Yuser on Tue Jun 04, 2013 20:33, edited 1 time in total.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

Yuser wrote:Thank you, blockmen. I redid the whole thing, the same as last time in ANSI again, but this time it worked and I have all of the craft items in. Now I need to do the entity part, which is very confusing to me haha.
right now I have

minetest.register_entity("helicopter:Y1_flying", {
stuff that goes here
})

and it can't find the } for whatever reason. I fixed the other problem.
Well, if you don't post actual code, it's hard to debug those problems.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

Yuser
Member
Posts: 12
Joined: Sat Jun 01, 2013 18:09

by Yuser » Post

minetest.register_entity("helicopter:Y1_flying", {
on_step(self, dtime)
self.getpos()
on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir)
puncher:get_inventory():add_item("helicopter_Y1")
})

I don't think that code is right but I'm not planning on running it yet, I want it to recognize the } first.

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests