Post your modding questions here

User avatar
TenPlus1
Member
 
Posts: 2645
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: Post your modding questions here

by TenPlus1 » Tue May 10, 2016 19:49

benrob: add: paramtype = "light", to the node definition.
 

Amaz
Member
 
Posts: 349
Joined: Wed May 08, 2013 08:26
GitHub: Amaz1
IRC: Amaz
In-game: Amaz

Re: Post your modding questions here

by Amaz » Tue May 10, 2016 20:32

benrob0329 wrote:...
Any ideas as to why its black when placed, but not when wielded?


Try adding paramtype = "light", to the node def.
 

User avatar
benrob0329
Member
 
Posts: 1314
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03

Re: Post your modding questions here

by benrob0329 » Tue May 10, 2016 20:50

That worked, now I just have to figure out how to import a b3d back into Blender because I forgot to save it as a blend too...
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA
 

sofar
Developer
 
Posts: 2090
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Tue May 10, 2016 21:18

benrob0329 wrote:That worked, now I just have to figure out how to import a b3d back into Blender because I forgot to save it as a blend too...


If it's not animated, make it an .obj file instead (waveform object). Those can be directly opened by blender.
 

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

Re: Post your modding questions here

by Don » Tue May 10, 2016 21:54

Set paramtype = "light",
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
benrob0329
Member
 
Posts: 1314
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03

Re: Post your modding questions here

by benrob0329 » Tue May 10, 2016 22:04

sofar wrote:
benrob0329 wrote:That worked, now I just have to figure out how to import a b3d back into Blender because I forgot to save it as a blend too...


If it's not animated, make it an .obj file instead (waveform object). Those can be directly opened by blender.


That helped get rid of some weird UV distortion as well, though now I have weird connected vertices...

Image

EDIT: Never mind, figured it out.
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA
 

sofar
Developer
 
Posts: 2090
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Tue May 10, 2016 22:38

benrob0329 wrote:
sofar wrote:
benrob0329 wrote:That worked, now I just have to figure out how to import a b3d back into Blender because I forgot to save it as a blend too...


If it's not animated, make it an .obj file instead (waveform object). Those can be directly opened by blender.


That helped get rid of some weird UV distortion as well, though now I have weird connected vertices...

EDIT: Never mind, figured it out.


UV unmapping can be challenging :)
 

User avatar
benrob0329
Member
 
Posts: 1314
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03

Re: Post your modding questions here

by benrob0329 » Tue May 10, 2016 23:16

Everything should be lining up perfectly:

Image

But its not...

Image
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA
 

sofar
Developer
 
Posts: 2090
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Tue May 10, 2016 23:36

benrob0329 wrote:Everything should be lining up perfectly:

But its not...


You've got triangular faces with different sizes, they don't UV unmap the way you think they do.

Split the Stone texture stuff into different faces, so that the stone side is a separate face, and the triangle stuff disappears.
 

User avatar
benrob0329
Member
 
Posts: 1314
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03

Re: Post your modding questions here

by benrob0329 » Wed May 11, 2016 00:20

Not perfect, but MUCH better:

Image
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA
 

User avatar
benrob0329
Member
 
Posts: 1314
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03

Re: Post your modding questions here

by benrob0329 » Wed May 11, 2016 03:53

Thanks all, I'd tell you what in working on but I'm not sure how far I'll get with it.
If I do get something done, I'll be sure to post it though!
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA
 

User avatar
stu
Member
 
Posts: 923
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

Re: Post your modding questions here

by stu » Wed May 11, 2016 17:37

benrob0329 wrote:Not perfect, but MUCH better:

Along with the uv errors already pointed out, It looks to me as though the mesh is non-manifold, that can also cause some pretty strange visual effects in-game.
 

bidaian
New member
 
Posts: 5
Joined: Sat May 14, 2016 03:31

Re: Post your modding questions here

by bidaian » Sat May 14, 2016 03:44

Topic: How do I move a node?

After creating tutorial:decowood and reading about growing default:junglegrass I wanted to move decowood with this code. But nothing happens. What do I need to move a node?

Code: Select all
minetest.register_abm({
        nodenames = {"tutorial:decowood"},
        interval = 10,
        chance = 1,
        action = function(pos)
                pos.y = pos.y + 1
        end,
})
 

User avatar
Foghrye4
Member
 
Posts: 24
Joined: Sun Mar 13, 2016 13:38
IRC: Foghrye4
In-game: Foghrye4

Re: Post your modding questions here

by Foghrye4 » Sat May 14, 2016 05:45

bidaian, "pos" table in function is just a copy of an information about actual node position. Changing it will do nothing. You need to delete node on a old position and add on a new. Check how to do it here: http://dev.minetest.net/Category:Methods
 

User avatar
Hybrid Dog
Member
 
Posts: 2721
Joined: Thu Nov 01, 2012 12:46

this should make it move upwards

by Hybrid Dog » Sat May 14, 2016 09:32

Code: Select all
minetest.register_abm({
        nodenames = {"tutorial:decowood"},
        interval = 10,
        chance = 1,
        action = function(pos, node)
                pos.y = pos.y + 1
                if minetest.get_node(pos).name == "air" then
                       minetest.set_node(pos, node)
                       pos.y = pos.y - 1
                       minetest.remove_node(pos)
                end
        end,
})

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪
 

bidaian
New member
 
Posts: 5
Joined: Sat May 14, 2016 03:31

Re: Post your modding questions here

by bidaian » Sat May 14, 2016 13:57

Foghrye4 wrote:bidaian, "pos" table in function is just a copy of an information about actual node position. Changing it will do nothing. You need to delete node on a old position and add on a new. Check how to do it here: http://dev.minetest.net/Category:Methods


Thanks. I wanted to do something that moved sheep-like and destroying and recreating sounded like a lot of work. But I guess I still have to learn a lot, maybe that's not simply a block. Anyway, it's great, with the decowood example, the wiki, the forum and the source of the other mods, lots of things can be done!
 

bidaian
New member
 
Posts: 5
Joined: Sat May 14, 2016 03:31

Re: this should make it move upwards

by bidaian » Sat May 14, 2016 14:00

Hybrid Dog wrote:
Code: Select all
minetest.register_abm({
        nodenames = {"tutorial:decowood"},
        interval = 10,
        chance = 1,
        action = function(pos, node)
                pos.y = pos.y + 1
                if minetest.get_node(pos).name == "air" then
                       minetest.set_node(pos, node)
                       pos.y = pos.y - 1
                       minetest.remove_node(pos)
                end
        end,
})


It does, but in one iteration it goes as high as it can. It was on the ground one second and underneath the branches in the next move. I'll work on it. Thanks also for bringing up the relationship with the environment. I was ready to go through anything that was already there :).
 

User avatar
paramat
Developer
 
Posts: 3524
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: Post your modding questions here

by paramat » Sat May 14, 2016 23:53

xeranas wrote:How I can reset player skybox to default server? I want temporally change user skybox and then return to 'normal'.

https://github.com/paramat/moonrealm/blob/master/init.lua#L206
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: Post your modding questions here

by everamzah » Sun May 15, 2016 00:36

Is it possible to make modifications to an ItemStack using the on_take callback of a detached inventory?
 

User avatar
Foghrye4
Member
 
Posts: 24
Joined: Sun Mar 13, 2016 13:38
IRC: Foghrye4
In-game: Foghrye4

Re: Post your modding questions here

by Foghrye4 » Sun May 15, 2016 05:09

everamzah wrote:Is it possible to make modifications to an ItemStack using the on_take callback of a detached inventory?

Yes. Don't forget to call "set_stack("listname", i, stack)" with your modificated stack on receiver inventory.
 

User avatar
Hybrid Dog
Member
 
Posts: 2721
Joined: Thu Nov 01, 2012 12:46

Re: this should make it move upwards

by Hybrid Dog » Sun May 15, 2016 06:55

bidaian wrote:It does, but in one iteration it goes as high as it can. It was on the ground one second and underneath the branches in the next move. I'll work on it. Thanks also for bringing up the relationship with the environment. I was ready to go through anything that was already there :).

the code should actually make it move 1 m ("perform one iteration") every 10 seconds
time(P) = (log(P*chance)/log(1-1/chance)+1)*interval

interval = 10; chance = 1

time(P) = lim(chance → 1, (log(P*chance)/log(1-1/chance)+1)*10)
= lim(h → 0, (log(P*(h+1))/log(1-1/(h+1))+1)*10)
= 1*10 = 10 = interval

Maybe it works if you disable catch_up

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: Post your modding questions here

by everamzah » Sun May 15, 2016 12:22

Foghrye4 wrote:
everamzah wrote:Is it possible to make modifications to an ItemStack using the on_take callback of a detached inventory?

Yes. Don't forget to call "set_stack("listname", i, stack)" with your modificated stack on receiver inventory.


Thanks!! That was the trick, though I needed to use set_stack() in the allow_take callback, and not the on_take one.
 

User avatar
rubenwardy
Moderator
 
Posts: 5948
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: this should make it move upwards

by rubenwardy » Sun May 15, 2016 12:27

Hybrid Dog wrote:
bidaian wrote:It does, but in one iteration it goes as high as it can. It was on the ground one second and underneath the branches in the next move. I'll work on it. Thanks also for bringing up the relationship with the environment. I was ready to go through anything that was already there :).

the code should actually make it move 1 m ("perform one iteration") every 10 seconds
time(P) = (log(P*chance)/log(1-1/chance)+1)*interval

interval = 10; chance = 1

time(P) = lim(chance → 1, (log(P*chance)/log(1-1/chance)+1)*10)
= lim(h → 0, (log(P*(h+1))/log(1-1/(h+1))+1)*10)
= 1*10 = 10 = interval

Maybe it works if you disable catch_up


It's possible that it updates the same node multiple times in one abm run (as it is placed in a new position that may not have been run.)
 

User avatar
AccidentallyRhine
Member
 
Posts: 230
Joined: Sun Aug 02, 2015 05:43

Re: Post your modding questions here

by AccidentallyRhine » Sun May 15, 2016 13:25

Hello, I'm trying to get player position to feed into add_item but there is little documentation outside of Rubenwardy's API reference so I'm somewhat stuck.

Is this even close to being correct?
Code: Select all
minetest.add_item(player:getpos(), "mymod:myitem")


It returns the error: attempt to index global 'player' (a nil value)
 

User avatar
rubenwardy
Moderator
 
Posts: 5948
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Sun May 15, 2016 14:47

Take a look at this chapter: http://rubenwardy.com/minetest_modding_ ... ories.html

You don't store items at a player's position, you store them in a player.
 

PreviousNext

Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 1 guest