Post your modding questions here

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

Re: Post your modding questions here

by BrunoMine » Mon Apr 11, 2016 21:03

Don wrote:Are you trying to do it when the map loads or could you use an abm or lbm to make it place?

I use registre_on_generated but the não not work.
Last edited by BrunoMine on Mon Apr 11, 2016 22:14, edited 2 times in total.
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Mon Apr 11, 2016 22:03

register_on_generated should work. Maybe post your code and we can see if there is something you missed.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

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

Re: Post your modding questions here

by BrunoMine » Mon Apr 11, 2016 22:25

Here it 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
minetest.register_on_generated(function(minp, maxp, seed)
   --[[
      places a special tree that I created. (near jungles)
   ]]
   
   -- verifies that this is the desired ground track
   if maxp.y < 10 then return end
   if minp.y > 90 then return end
   
   -- lead map in memory (is this necessary?)
   minetest.get_voxel_manip():read_from_map(minp, mapx)
   
   -- search jungletree
   if minetest.find_node_near({x=minp.x+40, y=minp.y+40, z=minp.y+40}, 40, {"default:jungletree"}) == nil then
      minetest.chat_send_all(dump(minetest.get_node({x=minp.x+40, y=minp.y+40, z=minp.y+40})))
      return
   end
   
   -- picks up a block of dirt with grass
   local pos = minetest.find_node_near({x=minp.x+40, y=minp.y+40, z=minp.y+40}, 40, {"default:dirt_with_grass"})
   if pos == nil then return end
   
   -- tree
   sovagxas.montar_arvore(pos)
   
   minetest.chat_send_all("My tree mounted")
   
end)


Problem:
in
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.chat_send_all(dump(minetest.get_node({x=minp.x+40, y=minp.y+40, z=minp.y+40})))

name == "ignore" always
I'll refine this code later but I want to solve this problem now.
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Tue Apr 12, 2016 02:27

Did you try to add minetest.after? Give it a second to make sure it loaded. Then it might find air. Else you could look for air and ignore. I had to do that in one of my mods to make sure it got the right count after using minetest.forceload_block.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

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

Re: Post your modding questions here

by BrunoMine » Tue Apr 12, 2016 16:50

Here my code 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
local verify_area = function(minp, maxp)

   -- load blocks
   minetest.get_voxel_manip():read_from_map({x=minp.x+40, y=minp.y+40, z=minp.y+40}, {x=minp.x+40, y=minp.y+40, z=minp.y+40})
   
   -- verify
   minetest.chat_send_all(dump(minetest.get_node({x=minp.x+40, y=minp.y+40, z=minp.y+40})))

end

minetest.register_on_generated(function(minp, maxp, seed)
   
   if maxp.y < 10 then return end
   if minp.y > 90 then return end
   
   minetest.after(4, verify_area, minp, maxp)
   
end)


it never returns anything other than blocks ignored
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Wed Apr 13, 2016 13:35

BrunoMine, use the vector helpers, it's shorter and no typos happen.
l think you did a typo: you wrote z=minp.y+40 instead of z=minp.z+40

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 verify_area = function(minp, maxp)

       -- load blocks
       local lp = vector.add(minp, 40)
       minetest.get_voxel_manip():read_from_map(lp, lp)
       
       -- verify
       minetest.chat_send_all(dump(minetest.get_node(lp)))

    end

    minetest.register_on_generated(function(minp, maxp, seed)
       
       if maxp.y < 10 then return end
       if minp.y > 90 then return end
       
       minetest.after(4, verify_area, minp, maxp)
       
    end)
 

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

Re: Post your modding questions here

by BrunoMine » Wed Apr 13, 2016 18:06

Again the problem was a small mistake for lack of attention.
Thank you for your help. The mod code is working correctly.
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Fri Apr 15, 2016 23:41

just a quick, kinda doppie question.
I have a mod which just adds some new building blocks, do I need to submit it somewhere before I can post it up for others to download? Or is it just a free-for-all sort of deal?
Flick?... Flick who?
 

KCoombes
Member
 
Posts: 278
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt or Rudilyn

Re: Post your modding questions here

by KCoombes » Sat Apr 16, 2016 00:01

I believe your upload goes in WIP mods first, then once it's approved by forum mods, you request it be moved to Mod Releases.
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Sat Apr 16, 2016 00:06

that's what I thought, regarding the wip mods section but was unsure. Thank you
Flick?... Flick who?
 

drkwv
Member
 
Posts: 67
Joined: Thu Jun 28, 2012 13:48

External DB for mods?

by drkwv » Sat Apr 16, 2016 06:29

What is the best way for mod to store it's data? I need to store some data between player logins and it would be good if I could also sort it and do other kind of stuff that modern databases do. Can I access sqlite API through Lua? What would be the best decision to store a mod data?
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Sat Apr 16, 2016 13:00

thegreatone wrote:just a quick, kinda doppie question.
I have a mod which just adds some new building blocks, do I need to submit it somewhere before I can post it up for others to download? Or is it just a free-for-all sort of deal?

You post your mod in the wip section. When you feel it is ready for release you submit a request to Topic move request.
viewtopic.php?f=11&t=10418

As long as it follows the guidelines then it will be moved.
viewtopic.php?f=11&t=1271
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Sat Apr 16, 2016 13:48

Thanks Don
Flick?... Flick who?
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Sat Apr 16, 2016 18:50

I notice that the http://unlicense.org/ is not mentioned in the guidelines section. Is there any opposition to my using it? I want to make sure so as not to create any problems.
I have also always used CC share alike non-commercial for artwork/images I create. Is this an issue here? I only ask as this too is not mentioned.
I have always released my artwork either under no license with all rights waved, or non-commercial as I do not care for the thought of others making profit from my work (which has happened in the past), which is why I switched to non-commercial.
As far as using any license in my opinion, any which are not legally accredited or recognized are of no legitimate use.
But I just want to make sure I am really clear on the issue, because I do not wish to make people have to keep coming back to tell me I need to change something, I don't like being a p.i.t.a. for people.
So lease let me know if those 2 licenses are fine or not to use, so I can be clear on it since I just put up my first contribution. I'd like to make the needed changes now and then know for any future work I add.
Thank you

PS, this is not to start a license war, I am simply looking to have my question answered
Flick?... Flick who?
 

User avatar
qwertymine3
Member
 
Posts: 194
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: Post your modding questions here

by qwertymine3 » Sat Apr 16, 2016 19:15

TumeniNodes wrote:I notice that the http://unlicense.org/ is not mentioned in the guidelines section. Is there any opposition to my using it? I want to make sure so as not to create any problems.

TumeniNodes wrote: I have also always used CC share alike non-commercial for artwork/images I create. Is this an issue here? I only ask as this too is not mentioned.


Both of those are sane licenses to choose, so I don't see any reason for there to be issues with using those licenses here.

AFAIK, the main rules on licenses are these.
celeron55 wrote:Disallowed licenses

Any mod that disallows derivatives cannot be published on this forum. These include CC NoDerivs and pretty much any closed source licenses.

More about licenses

If a mod is to be included in the main game, it's code needs to be relicensable under LGPLv2.1+, and textures/sounds under CC BY-SA 3.0 Unported, as the main game is released under those licenses. ...

... Public domain is not allowed as a license because jurisdiction about what "public domain" means varies between countries.


Any examples given are just for reference.
Avatar by :devnko-ennekappao:
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Sat Apr 16, 2016 19:34

I see where I got confused now, reading it again...
The section which mentions: "If a mod is to be included in the main game, it's code needs to be relicensable under LGPLv2.1+, and textures/sounds under CC BY-SA 3.0 Unported, as the main game is released under those licenses."
for some reason I did not notice the part about if the mod is to be included in the main game. My bad, I'm sorry.

I have not been ontop of my game lately and have been misreading and misunderstanding things.
Flick?... Flick who?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Sat Apr 16, 2016 21:52

TumeniNodes wrote:I see where I got confused now, reading it again...
The section which mentions: "If a mod is to be included in the main game, it's code needs to be relicensable under LGPLv2.1+, and textures/sounds under CC BY-SA 3.0 Unported, as the main game is released under those licenses."
for some reason I did not notice the part about if the mod is to be included in the main game. My bad, I'm sorry.

I have not been ontop of my game lately and have been misreading and misunderstanding things.


Notice the re in relicensable. If it's legal to relicense as LGPLv2.1+, then it is compatible for inclusion into minetest game. So CC0 and WTFPL mods can be added to Minetest Game.
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Sat Apr 16, 2016 22:34

Yes, I notice that now.
When I had initially read it, my brain registered it as, for a mod to be able to be used in Minetest in any way, etc....
As I stated, I've had some slight medical issues over the last year and it tends to make my brain not up to par. So I have been misreading and misunderstanding some things lately.
I do apologize for any times it has or may happen in the future, not really much I can do about it.
I honestly don't imagine any of the mods I create going into the Minetest game itself, as I will most likely only be creating mods which add various blocks for building / architecture, so obviously this is not something I need to be overly concerned about.
Flick?... Flick who?
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

by Hybrid Dog » Sun Apr 17, 2016 08:06

How can l set the pitch of a mesh object?
 

DontTouchTheClock
New member
 
Posts: 7
Joined: Sun Apr 17, 2016 17:53

Re: Post your modding questions here

by DontTouchTheClock » Sun Apr 17, 2016 19:22

Topic: Collision box, privilege user, movement.
Reason: I want to refresh my modding skills.
More info: I want to make an elevator, I can make the nodebox, texture it. However when trying to use it(getting the player to enter the node and ride it like a boat(without turning.)
I lurk, I learn, I lack.
 

Passante
New member
 
Posts: 9
Joined: Thu Nov 19, 2015 17:06
In-game: Passante

Re: Post your modding questions here

by Passante » Tue Apr 19, 2016 15:33

Topic
What does minetest.register_alias() do ?
How to manage compatibility between mods with same recipe ?

Reason
I want to add compatibility between mt_foods mod and candy mod : they've got sugar in common with ~same recipe.

More Info
candy mod says for 1 papyrus in the grid I get 4 candy:sugar.
mtfoods mod says for 1 papyrus in the grid I get 3 mtfoods:sugar.

I've tried adding minetest.register_alias("candy:sugar", "mtfoods:sugar") in the candy mod init.lua
Craft guide indicates both recipes for both sugar items, but mtfoods:sugar doesn't let me craft candies.

Minetest 0.4.13 32b official
Candy 1.0
Mtfoods 1.5
Windows 7 64 bits Home Premium (Édition Familiale Prémium)
 

DontTouchTheClock
New member
 
Posts: 7
Joined: Sun Apr 17, 2016 17:53

Re: Post your modding questions here

by DontTouchTheClock » Tue Apr 19, 2016 15:47

With minetest.register_alias() you can add another name for a block:
For example "default:wood" is also known as "wood". This is handy in the world-edit commands and the /give command. to do this in a mod you would do:
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_alias("wood", "default:wood")
I lurk, I learn, I lack.
 

Passante
New member
 
Posts: 9
Joined: Thu Nov 19, 2015 17:06
In-game: Passante

Re: Post your modding questions here

by Passante » Tue Apr 19, 2016 16:14

DontTouchTheClock wrote:With minetest.register_alias() you can add another name for a block:
For example "default:wood" is also known as "wood". This is handy in the world-edit commands and the /give command. to do this in a mod you would do:
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_alias("wood", "default:wood")



Well I did 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
minetest.register_alias("candy:sugar", "mtfoods:sugar")

and
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_alias("mtfoods:sugar", "candy:sugar")


But in either way I can make a candy with mtfoods:sugar.
I thought, the method would "fuse" the 2 items and that, as a consequence, I would be able to make candies with any sugar, both being recognized by both mods, but it isn't the case. I guess I misunderstand the method.
Windows 7 64 bits Home Premium (Édition Familiale Prémium)
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Tue Apr 19, 2016 16:17

It doesn't work if both nodes are registered. Look at how Food does it.

In your recipes that use candy:sugar, replace it with group:sugar.
Then if mtfoods is not installed register candy:sugar with groups = { food_sugar=1}
If mtfoods is installed, don't register candy:sugar, instead add the group to the mtfood:sugar.

Here is some example code. You'll need to optionally depend on mtfoods.

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
if minetest.get_modpath("mtfood") then
    minetest.override_item("mtfood:sugar", {
        groups = { food_sugar = 1 }
    })
else
    minetest.register_craftitem("candy:sugar", {
        ---       
        groups = { food_sugar = 1 }
        ---
    })

    minetest.register_craft({
        output = "candy:sugar",
        recipe = {}
    })
end

minetest.register_craft({
    output = "candy:bar",
    recipe = {
        {"group:food_sugar"}
    }
})


untested

The better solution is to depend on food, and use its very good support library (food doesn't come with food by default, it's food_basic that adds some food)

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
food.support("sugar", {
   "jkfarming:sugar",
   "bushes:sugar",
        "mtfoods:sugar"
})

food.module("sugar", function()
   minetest.register_craftitem("food:sugar", {
      description = "Sugar",
      inventory_image = "food_sugar.png",
      groups = {food_sugar=1}
   })

   minetest.register_craft({
      output = "food:sugar 20",
      recipe = {
         {"default:papyrus"},
      }
   })
end, true)

food.module("cake_carrot", function()
   minetest.register_node(":food:cake_carrot", {
      description = S("Carrot Cake"),
      on_use = food.item_eat(4),
      groups={food=3,crumbly=3},
      walkable = false,
      sunlight_propagates = true,
      tiles = {
         "food_cake_carrot_texture.png",
         "food_cake_carrot_texture.png",
         "food_cake_carrot_texture_side.png",
         "food_cake_carrot_texture_side.png",
         "food_cake_carrot_texture_side.png",
         "food_cake_carrot_texture_side.png"
      },
      drawtype="nodebox",
      paramtype = "light",
      node_box = food.cake_box
   })
   food.craft({
      type = "cooking",
      output = "food:cake_carrot",
      recipe = "food:cakemix_carrot",
      cooktime = 10,
   })
   minetest.register_craftitem(":food:cakemix_carrot",{
      description = S("Carrot Cake Mix"),
      inventory_image = "food_cakemix_carrot.png",
   })
   food.craft({
      output = "food:cakemix_carrot",
      recipe = {
         {"","group:food_carrot",""},
         {"group:food_flour","group:food_sugar","group:food_egg"},
      }
   })
end)


food.module basically allows you to package up ingrediants and food in one bundle, it makes it more organised.
Last edited by rubenwardy on Tue Apr 19, 2016 16:27, edited 4 times in total.
 

Passante
New member
 
Posts: 9
Joined: Thu Nov 19, 2015 17:06
In-game: Passante

Re: Post your modding questions here

by Passante » Tue Apr 19, 2016 16:23

Thanks, going to try that.

EDIT : Saw your edit, trying that. I'm already using your food mod too ^^

I'm not a very trained lua user yet, I was just trying to make some easy tricks on my mods to make them work better together, so I'm very grateful for your help.
Windows 7 64 bits Home Premium (Édition Familiale Prémium)
 

bobomb
Member
 
Posts: 101
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: Post your modding questions here

by bobomb » Tue Apr 19, 2016 23:00

I stumbled on this older version of the lua api txt file and found what appears to be a way to create your own settings files. https://github.com/minetest/minetest/bl ... .txt#L3063
the usage is not explained though.
I tried:
<pre>
testconf = Setting(path_and_file_name)
</pre>
but then when I try to do things like testconf.write() or testconf.set("foo", "bar") i get errors and anyway the current documentation shows that the methods should be testconf.setting_write(), etc

just wondering if there is a way to make our own per-world conf files?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Tue Apr 19, 2016 23:31

You probably mean to use a colon, ie conf:write() instead of conf.write()

conf:write() is short for conf.write(conf)
 

bobomb
Member
 
Posts: 101
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: Post your modding questions here

by bobomb » Wed Apr 20, 2016 02:14

oh yeah of course. that all works now. where is this documented? the new lua api txt file doesn't mention this...
 

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

Re: Post your modding questions here

by kaeza » Thu Apr 21, 2016 16:46

bobomb wrote:oh yeah of course. that all works now. where is this documented? the new lua api txt file doesn't mention this...

From Function Calls in the Lua manual:
The form

functioncall ::= prefixexp `:´ Name args

can be used to call "methods". A call v:name(args) is syntactic sugar for v.name(v,args), except that v is evaluated only once.

Emphasis mine.
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
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

by Hybrid Dog » Thu Apr 21, 2016 16:53

What is the meaning of evaluating v?
Last edited by Hybrid Dog on Sat Apr 23, 2016 14:51, edited 1 time in total.
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 16 guests

cron