Post your modding questions here

derpswa99
Member
 
Posts: 78
Joined: Sun Mar 24, 2013 21:26

by derpswa99 » Sat Nov 23, 2013 23:31

How do I use the "minetest.item_place_node" function?
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Nov 24, 2013 19:35

derpswa99 wrote:How do I use the "minetest.item_place_node" function?


See: http://dev.minetest.net/minetest.place_node
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Nov 24, 2013 19:36

How can I make a tool item wear when used pointing at nothing?

I tried this but is does not seem to have any effect.

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
    on_use = function(itemstack, user, pointed_thing)
        itemstack:add_wear(100)
        user:set_wielded_item(itemstack)
    end,
Last edited by stu on Sun Nov 24, 2013 19:36, edited 1 time in total.
 

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

by PilzAdam » Sun Nov 24, 2013 20:20

stu wrote:How can I make a tool item wear when used pointing at nothing?

I tried this but is does not seem to have any effect.

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
    on_use = function(itemstack, user, pointed_thing)
        itemstack:add_wear(100)
        user:set_wielded_item(itemstack)
    end,

on_use is only called when pointing at something.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Nov 24, 2013 20:28

PilzAdam wrote:on_use is only called when pointing at something.

That is not true. I can prove this by adding a print statement in there, point at the sky and press LMB

I think the problem is with how I am commiting the itemstack, though I got that idea from the dev wiki http://dev.minetest.net/Player
(changes will need to be "committed" by calling object:set_wielded_item(modifiedStack)
Last edited by stu on Sun Nov 24, 2013 20:45, edited 1 time in total.
 

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

by PilzAdam » Sun Nov 24, 2013 21:02

Oh, it was on_place() that was only called when pointing at something, sorry, my bad.

You should try return itemstack instead of set_wielded_item().
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Nov 24, 2013 22:55

PilzAdam wrote:Oh, it was on_place() that was only called when pointing at something, sorry, my bad.

You should try return itemstack instead of set_wielded_item().


No problem, returning the itemstack does the business.

Thank you once again.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Mon Nov 25, 2013 12:46

I've the feeling, it has already posted here alot but:
How do I make a crafting grid, that needs a pickaxe, which only gets a little damaged, when using it for crafting?

(just giving back is good too)

Okay, I've already found:
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
replacements = { ... with ... }

Is there also a way to damage it?
Last edited by Krock on Mon Nov 25, 2013 13:44, edited 1 time in total.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
fairiestoy
Member
 
Posts: 191
Joined: Sun Jun 09, 2013 19:25

by fairiestoy » Mon Nov 25, 2013 21:27

*ahem* Just follow this simple steps:
> Open your browser
> Go to https://github.com/minetest/minetest/blob/master/doc/lua_api.txt
> Press [Ctrl] + F ( default for Firefox if im not mistaken )
> Input 'wear' within the search field
> Iterate through document until functions are found

Thats how you get this result: https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L1754
Interesting about new things is, to figure out how it works ...
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
IRC: AMMOnym
In-game: AMMOnym

by AMMOnym » Tue Nov 26, 2013 16:39

How i can make throwing (like throwing mod) from block, then i punch block and block throw something.??:_?:?
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Tue Nov 26, 2013 16:41

AMMOnym wrote:How i can make throwing (like throwing mod) from block, then i punch block and block throw something.??:_?:?
Do you expect someone to write the mod for you? Get started and post any questions you have.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Tue Nov 26, 2013 19:38

I've another problem, when use "allow_metadata_inventory_put" and "allow_metadata_inventory_take", then I can't get the new stack-informations, it will always show up the previous stack.
How can I solve this? I've found the circular saw codes, which do parts of what I try to do, but those code aren't easy to understand :/

EDIT: solved myself...
Last edited by Krock on Sat Nov 30, 2013 09:24, edited 1 time in total.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
addi
Member
 
Posts: 605
Joined: Thu Sep 20, 2012 03:16

by addi » Sat Nov 30, 2013 18:24

how must i set up the particle spawner to add particles like this:
Image
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.add_particlespawner(amount, time,
    minpos, maxpos,
    minvel, maxvel,
    minacc, maxacc,
    minexptime, maxexptime,
    minsize, maxsize,
    collisiondetection, texture, playername)
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Sun Dec 01, 2013 01:17

Can someone make a tutorial on how to use particles/the particle spawner? The api txt is just confusing me.
Last edited by Casimir on Sun Dec 01, 2013 01:18, edited 1 time in total.
 

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

by PilzAdam » Sun Dec 01, 2013 01:28

Casimir wrote:Can someone make a tutorial on how to use particles/the particle spawner? The api txt is just confusing me.

I personally dont think its confusing... could you tell me your problems with it, so it would be easier to write the tutorial?
 

D0431791
Member
 
Posts: 19
Joined: Wed Nov 06, 2013 11:43

by D0431791 » Sun Dec 01, 2013 02:08

Topic: When Minetest allows custom crafting type?
Reason: I want to make a machine that works like the furnaces cooking/smelting but with different output.
More Info(optional):
Image
Transparent woods and bricks
Last edited by D0431791 on Sun Dec 01, 2013 02:11, edited 1 time in total.
Minetest can be better if
*better data structure for players and unstackable items like JSON
*multi sqlite files so that multi dimension can be easily implemented
*more convenient mob developing interface
 

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

by PilzAdam » Sun Dec 01, 2013 12:07

D0431791 wrote:Topic: When Minetest allows custom crafting type?
Reason: I want to make a machine that works like the furnaces cooking/smelting but with different output.
More Info(optional):
http://img716.imageshack.us/img716/5364/pwcl.png
Transparent woods and bricks

Just define your own get_craft_result() and register_craft() functions.
 

User avatar
addi
Member
 
Posts: 605
Joined: Thu Sep 20, 2012 03:16

by addi » Sun Dec 01, 2013 16:02

Hybrid Dog wrote:
addi wrote:how must i set up the particle spawner to add particles like this:
http://www.king-arthur.eu/gallery/image.php?album_id=2&image_id=138&mode=thumbnail
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.add_particlespawner(amount, time,
    minpos, maxpos,
    minvel, maxvel,
    minacc, maxacc,
    minexptime, maxexptime,
    minsize, maxsize,
    collisiondetection, texture, playername)

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.add_particlespawner(
        3, --amount
        0.1, --time
        pos, --minpos
        pos, --maxpos
        {x=0, y=3, z=0}, --minvel
        {x=0, y=4, z=0}, --maxvel
        {x=-4,y=-4,z=-4}, --minacc
        {x=4,y=-4,z=4}, --maxacc
        0.1, --minexptime
        1, --maxexptime
        2, --minsize
        8, --maxsize
        false, --collisiondetection
        "smoke_puff.png" --texture
    )


thanks that helped me a lot :)
 

derpswa99
Member
 
Posts: 78
Joined: Sun Mar 24, 2013 21:26

by derpswa99 » Sun Dec 01, 2013 18:54

Can someone tell the correct furnace definition and what I can customize within the code. Also please don't link the development wiki because it honestly doesn't assist in any way especially with functions.
 

wcwyes
Member
 
Posts: 145
Joined: Wed Jul 31, 2013 22:42

by wcwyes » Mon Dec 02, 2013 07:01

wcwyes wrote:How do I check for hostile mobs around me?

Can anyone help me?
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Mon Dec 02, 2013 12:31

derpswa99 wrote:Can someone tell the correct furnace definition and what I can customize within the code. Also please don't link the development wiki because it honestly doesn't assist in any way especially with functions.

the name of it is: default:furnace
All nodes/blocks/cubes acn you find in the folder games\Minetest_game\mods\default\ (nodes.lua?)
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

derpswa99
Member
 
Posts: 78
Joined: Sun Mar 24, 2013 21:26

by derpswa99 » Wed Dec 04, 2013 00:10

Krock wrote:
derpswa99 wrote:Can someone tell the correct furnace definition and what I can customize within the code. Also please don't link the development wiki because it honestly doesn't assist in any way especially with functions.

the name of it is: default:furnace
All nodes/blocks/cubes acn you find in the folder games\Minetest_game\mods\default\ (nodes.lua?)


How does this help at all! I am attempting to create my own furnace but I want to know how the functions and formspec coincide with each other and what I can tailor to create my very own furnace.
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Thu Dec 05, 2013 18:37

wcwyes wrote:
wcwyes wrote:How do I check for hostile mobs around me?

Can anyone help me?

Get all entities in the area, compare the table with a table of all known hostile mobs (for ... do ...).

PilzAdam wrote:I personally dont think its confusing... could you tell me your problems with it, so it would be easier to write the tutorial?

I read it again, and now I understand. No problem.



Recently there where some commits about ground contend. In the lua_api.txt it says "is_ground_content = false, -- Currently not used for anything", so why the changes? Do modders have to care about that?
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Fri Dec 06, 2013 17:56

Hybrid Dog wrote:Could anyone tell me why my rocket bag doesn't work?
https://raw.github.com/HybridDog/extrablocks/master/mvmt.lua
try replacing nil with 1
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Sat Dec 07, 2013 14:48

I created a mod. I used the following materials: "https://github.com/minetest/minetest/blob/master/doc/lua_api.txt".I used the "C + +"
My problem is that I do not know which license should I describe in my mod.
Someone tell me what I should by? do not quite understand it yet.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

User avatar
addi
Member
 
Posts: 605
Joined: Thu Sep 20, 2012 03:16

by addi » Sat Dec 07, 2013 16:50

brunob.santos wrote:I created a mod. I used the following materials: "https://github.com/minetest/minetest/blob/master/doc/lua_api.txt".I used the "C + +"
My problem is that I do not know which license should I describe in my mod.
Someone tell me what I should by? do not quite understand it yet.

on this page you can choose (create) ur own license http://creativecommons.org/choose/
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Sat Dec 07, 2013 18:26

brunob.santos wrote:My problem is that I do not know which license should I describe in my mod.

Do you have any special wishes regarding your license? If you want your mod to be moved to mod releases, it has to be an open license that allows much. I personally prefer the GPLv3, but there can be almost "wars" over which license is best. Some people also love to use WTFPL.

addi wrote:on this page you can choose (create) ur own license http://creativecommons.org/choose/

The CC licenses IMHO are less well suited for code. They aim at other creative work like images, texts, animations etc.
A list of my mods can be found here.
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Sat Dec 07, 2013 18:57

How can I make sure that a certain piece of code gets executed when ALL nodes of ALL mods are registered?
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Sat Dec 07, 2013 19:26

I really do not understand how will the license. I created the mod and just want everyone to use it. I post the forum "Modding Geral"?
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

by philipbenr » Sat Dec 07, 2013 19:37

brunob.santos wrote:I really do not understand how will the license. I created the mod and just want everyone to use it. I post the forum "Modding Geral"?


Okay. If you want everyone to be able to use, edit and distribute the mod, then use GPLv3. If you want any other license, you might try LGPL or some other one. CC licenses aren't really for code...
"The Foot is down!"
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron