Post your modding questions here

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

by Krock » Sat Jan 04, 2014 12:30

How can I make this working? (example node names)
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_craft({
    type = 'cooking',
    recipe = "default:leaves 6",
    output = "default:coal_lump",
})
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
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

by Topywo » Sat Jan 04, 2014 13:15

Krock wrote:How can I make this working? (example node names)
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_craft({
    type = 'cooking',
    recipe = "default:leaves 6",
    output = "default:coal_lump",
})


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_craft({
    type = 'cooking',
    output = "default:coal_lump",
    recipe = "default:leaves 6",
})



Maybe.
 

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

by Krock » Sat Jan 04, 2014 19:05

Hybrid Dog wrote:
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_craft({
    type = 'cooking',
    recipe = "default:leaves",
    output = "default:coal_lump 1/6",
})
I don't think it would work.

It works, just not the correct way. Still loosing 1 and getting 1.

Is there another way to make this working?
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
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Sun Jan 05, 2014 01:32

Maybe you could create a craft item that you would then need to craft into a coal_lump and would require 6 of them to do so. You would use the crafting grid to do so and maybe call them coal chunks or something.

I don't know for sure, but I think the furnace is only capable of turning one singular item into one other item.
 

User avatar
Gambit
Member
 
Posts: 452
Joined: Sat Oct 29, 2011 19:31

by Gambit » Sun Jan 05, 2014 07:20

How would I go about making the stiff physics for webs. I want the player to be able to move slowly while touching it?
Current Projects: MineToon | PixelBOX
Gambit's Checkmate Server - 43.65.296.232 - port: 30001
 

User avatar
ch98
Member
 
Posts: 463
Joined: Wed Jan 02, 2013 06:14

by ch98 » Sun Jan 05, 2014 07:50

Is there any way to read pixels of png file in rgb using lua? I want to try to make image to map mod that uses images to make elevation and water.
Mudslide mod Click Here
 

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

by kaeza » Sun Jan 05, 2014 16:06

ch98 wrote:Is there any way to read pixels of png file in rgb using lua? I want to try to make image to map mod that uses images to make elevation and water.

You could use libpng via FFI (LuaJit), or a wrapper library.
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
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Sun Jan 05, 2014 17:21

The Image Loader mod

https://forum.minetest.net/viewtopic.php?id=6751

loads bitmap images into the game. You could look at that and see what it does and then you just need to find some lua code that allows you to read in a png file. Once you can read it and understand how to get at the pixel information it shouldn't be too hard to convert it to height maps and such. Hope this helps you out.
 

User avatar
ch98
Member
 
Posts: 463
Joined: Wed Jan 02, 2013 06:14

by ch98 » Sun Jan 05, 2014 21:34

ok. i will try that.
Mudslide mod Click Here
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Thu Jan 09, 2014 23:34

Question about lua tables:

I want to create a table that is a copy of another table.
Example:
local a ={1}
local b=a

now I want to change ONLY the table "b"
b[1]=b[1]+1


but:

print(dump(a))
print(dump(b))

returns
a={[1] = 2}
b={[1] = 2}

the problem is that if I change the table "b" then you also change the table "a". I want the table "a" remains unchanged. how?


sorry for the stupidity
sorry for bad english
Linux debian 7 wheezy 64
kde
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Fri Jan 10, 2014 08:55

pandaro wrote:Question about lua tables:

I want to create a table that is a copy of another table.
Example:
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
local a ={1}
local b=a

now I want to change ONLY the table "b"
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
b[1]=b[1]+1

All variables refer to tables in Lua by reference, not by value. Lua's standard API also does not have any simple way to copy/clone tables. To implement a cloning method, you have to decide whether you want to also copy a table/object's metatable (sort of like a "class" in Lua). Also, since Lua tables can contain references to other tables, you have to decide whether you want to perform a shallow or a deep copy (a whole separate and independent tree of table objects).

Assuming all you want is a shallow copy, resulting in a simple table (with no metatable set) that simply has all the same keys and values as the original, try:
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
function shallow_copy_table(t)
   local new_table = {};
   for k, v in pairs(t) do
      new_table[k] = v;
   end
   return new_table;
end


Your code would then have to look like:

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
local a = { 1 };
local b = shallow_copy_table(a);
b[1] = b[1]+1;
Last edited by prestidigitator on Fri Jan 10, 2014 09:00, edited 1 time in total.
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Fri Jan 10, 2014 09:26

prestidigitator wrote:All variables refer to tables in Lua by reference, not by value. Lua's standard API also does not have any simple way to copy/clone tables. To implement a cloning method, you have to decide whether you want to also copy a table/object's metatable (sort of like a "class" in Lua). Also, since Lua tables can contain references to other tables, you have to decide whether you want to perform a shallow or a deep copy (a whole separate and independent tree of table objects


Thank you very much, I was not aware of this behavior. Although it is logical thinking.
sorry for bad english
Linux debian 7 wheezy 64
kde
 

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

by Krock » Sat Jan 11, 2014 11:31

How can I override an ABM of the game?
I try to allow burning stacks into another stack, like burning 2 tree trunks and getting 1 coal lump.
Help!

EDIT: this, because I won't add a new node, instead override the old furnace function..
Last edited by Krock on Sat Jan 11, 2014 11:31, 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
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Sat Jan 11, 2014 21:54

I tried to draw a drowning bar in the hud just like the one that is done engine side. The problem is, the hud resizes in steps relative to the window size. The bar then appears in the wrong position when resizing the window. How can I get the hight in Lua? Is there a way to surpass the problem?
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
player_bubbles[name] = player:hud_add({
    hud_elem_type = "statbar",
    text = "bubble.png",
    number = 20,
    dir = 0,
    position = {x=0.5,y=1.0},
    offset = {x=0, y=-58},
})




Krock wrote:How can I override an ABM of the game?

I don't know a way you could. It would be possible when the ABM would call a function. e.g.:
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
mod = {}

function mod.abm(pos, node)
        -- actual function
end

minetest.register_abm({
    nodenames = {"mod:node"},
    interval =5,
    chance = 5,
    action = function(pos, node)
                mod.abm(pos, node)
    end
})

That would require the default game to be changed. But I think it is better to do so anyway.
Last edited by Casimir on Sat Jan 11, 2014 22:04, edited 1 time in total.
 

User avatar
Enke
Member
 
Posts: 469
Joined: Fri Nov 15, 2013 02:56
GitHub: NANOsoldierEnke
IRC: Enke
In-game: Enke

by Enke » Sun Jan 12, 2014 16:50

What is a soft dependancy, and how do I make one?
Lush8
ExtraVars for Red Eclipse

<Anarchid> my turn was still the most awesome, yielding all the cripples, two captured paranormals, and death rate of about 30%
<ORCACommander> Anarchid: you need to work harder
<ORCACommander> I am hereby putting you under review until you can increase the casualty rate
 

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

by PilzAdam » Sun Jan 12, 2014 17:17

Enke wrote:What is a soft dependancy, and how do I make one?

https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L122
The optional dependencies are loaded first, if they are present.
 

User avatar
Enke
Member
 
Posts: 469
Joined: Fri Nov 15, 2013 02:56
GitHub: NANOsoldierEnke
IRC: Enke
In-game: Enke

by Enke » Sun Jan 12, 2014 22:47

PilzAdam wrote:
Enke wrote:What is a soft dependancy, and how do I make one?

https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L122
The optional dependencies are loaded first, if they are present.

Alright. Thank you.
Lush8
ExtraVars for Red Eclipse

<Anarchid> my turn was still the most awesome, yielding all the cripples, two captured paranormals, and death rate of about 30%
<ORCACommander> Anarchid: you need to work harder
<ORCACommander> I am hereby putting you under review until you can increase the casualty rate
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Mon Jan 13, 2014 17:03

A question about sound.

I took the sounds for my mod "nodevil" by freesound.org.
This is legal? What should I write in readme.md, to make it known that the sounds are not mine and others that created them?
sorry for bad english
Linux debian 7 wheezy 64
kde
 

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

by kaeza » Mon Jan 13, 2014 17:47

pandaro wrote:A question about sound.

I took the sounds for my mod "nodevil" by freesound.org.
This is legal? What should I write in readme.md, to make it known that the sounds are not mine and others that created them?

Each sound on freesound.org carries a different license. Check the license of the individual sounds to see what you are and aren't allowed to do. The Creative Commons site has explanation for them in layman terms, and I believe freesound has links to relevant pages.
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
Enke
Member
 
Posts: 469
Joined: Fri Nov 15, 2013 02:56
GitHub: NANOsoldierEnke
IRC: Enke
In-game: Enke

by Enke » Tue Jan 14, 2014 02:57

Is it possible to put a modpack in a modpack? Like mesecons?
Lush8
ExtraVars for Red Eclipse

<Anarchid> my turn was still the most awesome, yielding all the cripples, two captured paranormals, and death rate of about 30%
<ORCACommander> Anarchid: you need to work harder
<ORCACommander> I am hereby putting you under review until you can increase the casualty rate
 

FNC
Member
 
Posts: 15
Joined: Fri Jan 10, 2014 22:21

by FNC » Tue Jan 14, 2014 22:06

Hi, my name is FNC!

I nead help with seting up mods for my single player world. I have technic and all that stuff that goes with it. BUT when I go to play it says like error with this long address to my technic mod folder. PLZ help!!
 

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

by Evergreen » Wed Jan 15, 2014 00:58

FNC wrote:Hi, my name is FNC!

I nead help with seting up mods for my single player world. I have technic and all that stuff that goes with it. BUT when I go to play it says like error with this long address to my technic mod folder. PLZ help!!
Don't just say "it says like error with this long address to my technic folder" Copy and paste it from the file "debug.txt"
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
Enke
Member
 
Posts: 469
Joined: Fri Nov 15, 2013 02:56
GitHub: NANOsoldierEnke
IRC: Enke
In-game: Enke

by Enke » Wed Jan 15, 2014 02:13

Hybrid Dog wrote:
Enke wrote:Is it possible to put a modpack in a modpack? Like mesecons?
I tried it out some time ago. It only works if the modpack and the mod don't have the same name if they are in a modpack.
So mods/smodpack/worldedit/worldedit doesn't work

I'm confused as to what you mean. Should I rename the modpack?
Lush8
ExtraVars for Red Eclipse

<Anarchid> my turn was still the most awesome, yielding all the cripples, two captured paranormals, and death rate of about 30%
<ORCACommander> Anarchid: you need to work harder
<ORCACommander> I am hereby putting you under review until you can increase the casualty rate
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Wed Jan 15, 2014 05:11

Enke wrote:Is it possible to put a modpack in a modpack? Like mesecons?

I'm not sure why you'd really need or want to, when merging modpacks is so easy. There are two requirements for a modpack:
  1. The existence of an empty file called "modpack.txt" in the top level directory.
  2. Subdirectories each named with the correct name of a mod, containing the code and other resources of that mod.
So to merge two modpacks, just put all the contents from both of them into one directory (and don't worry which modpack.txt file you grab).
 

User avatar
wtfsamcrap
Member
 
Posts: 25
Joined: Mon Dec 09, 2013 21:23

by wtfsamcrap » Sat Jan 18, 2014 16:41

ok so i wanna make a coal block or a netherrack so it stays burning long and not going out heres my code
o btw they both have the same codeing 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
minetest.register_node("coalblock:block", { --Node
    description = "coalblock", --Inv name
    tiles = {"coal_block.png"}, --image
    stack_max = 64, --64 max stack cuz i am makeing it for pillsadam's minitest
    groups = {choppy=1,flammable=100}, --what the groups are
    sounds = default.node_sound_wood_defaults(),  --just wood
})


minetest.register_craft({
    output = 'coalblock:block', --my crafting for coalblock (still working on it just a sample)
    recipe = {
        {'group:wood', 'group:wood'},
        {'group:wood', 'group:wood'},
    }
})
Last edited by wtfsamcrap on Sat Jan 18, 2014 16:43, edited 1 time in total.
Mods
 

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

by Krock » Sat Jan 18, 2014 16:59

wtfsamcrap wrote:
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
groups = {choppy=1,flammable=>>>1<<<},

minetest.register_craft({
    output = 'coalblock:block', --my crafting for coalblock (still working on it just a sample)
    recipe = {
        {'group:wood', 'group:wood'},
        {'group:wood', 'group:wood'},
    }
})

Try to use " instead of '
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_craft({
        type = "fuel",
        recipe = "coalblock:block",
        burntime = 100,
})
Last edited by Krock on Sat Jan 18, 2014 17:00, 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
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Sat Jan 18, 2014 17:25

what effect does exactly: "max_drop_level" in the definition of a tool?
Last edited by pandaro on Sat Jan 18, 2014 17:25, edited 1 time in total.
sorry for bad english
Linux debian 7 wheezy 64
kde
 

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

by PilzAdam » Sat Jan 18, 2014 17:28

pandaro wrote:what effect does exactly: "max_drop_level" in the definition of a tool?

Nothing, its up to mods to read it and give it any use. (Dunno why its mentioned in lua_api.txt, though)
 

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

by Krock » Sat Jan 18, 2014 17:30

And for what is
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
is_ground_content = true,
legacy_facedir_simple = true,

in a node definition needed?

Also this makes me thinking:
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_ore({
    ore_type       = "scatter",
})


Could someone explain me the use of them please?
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
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Jan 18, 2014 17:33

Krock wrote:And for what is
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
is_ground_content = true,
legacy_facedir_simple = true,

in a node definition needed?

Also this makes me thinking:
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_ore({
    ore_type       = "scatter",
})


Could someone explain me the use of them please?

is_ground_content tells whether the cavegen should cut through the node or not.
legacy_facedir_simple is for converting old maps, probably only useful for minetest_game.
What do you mean by "them" in the last sentence? The oregen types?
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 22 guests

cron