Help please

chase programer
Member
 
Posts: 117
Joined: Thu Jan 03, 2013 16:56

Help please

by chase programer » Tue Jun 18, 2013 20:13

Im having trouble with this code should this work

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
minetest.register_tool("default:useful_pickaxe", {
    description = "useful pickaxe",
    inventory_image = "default_tool_usefulpickaxe.png",
    tool_capabilities = {
        full_punch_interval = 1.3,
        max_drop_level=8,
        groupcaps={
            cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=9000, maxlevel=9},
        },
        damage_groups = {fleshy=9},
    },
})

Back and ready to help with this amazing community that i lost.
 

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

by PilzAdam » Tue Jun 18, 2013 20:44

Dan Duncombe wrote:Try replacing
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
inventory_image = "default_tool_usefulpickaxe.png",
with
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
 inventory_image =  { "default_tool_usefulpickaxe.png" },

Nope, thats wrong.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Tue Jun 18, 2013 20:53

chase programer wrote:"default:useful_pickaxe"

You can't register items in other mods.

If your mod is named "foo" you must use "foo:useful_pickaxe".
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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Tue Jun 18, 2013 21:24

kaeza: if you prefix the destination modname with a colon, ":", you can do that anyway.

Mod "foo" can execute minetest.register_xxxxx(":bar:blah",...) to put the item into bar's namespace, and it'll work exactly like he wants.

Of course one should only use that if there's a *really* good reason for it. Else the new item belongs in foo's namespace instead.
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

User avatar
Mossmanikin
Member
 
Posts: 599
Joined: Sun May 19, 2013 16:26

by Mossmanikin » Tue Jun 18, 2013 21:42

kaeza wrote:
chase programer wrote:"default:useful_pickaxe"

You can't register items in other mods.

If your mod is named "foo" you must use "foo:useful_pickaxe".


This would probably make most sense.

But another way would be:

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
":default:useful_pickaxe"


EDIT: VanessaE was faster :D
Last edited by Mossmanikin on Tue Jun 18, 2013 21:44, edited 1 time in total.

Noob 4 life!
My stuff
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Tue Jun 18, 2013 22:25

VanessaE wrote:kaeza: if you prefix the destination modname with a colon, ":", you can do that anyway.

Mod "foo" can execute minetest.register_xxxxx(":bar:blah",...) to put the item into bar's namespace, and it'll work exactly like he wants.

Of course one should only use that if there's a *really* good reason for it. Else the new item belongs in foo's namespace instead.

I know, but that's probably not what was intended here.
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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 26 guests

cron