Post your modding questions here

Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: Post your modding questions here

by Byakuren » Post

orwell wrote:This is because the type of player attributes is always "string", you can't save other type's values there
When setting the atttribute, the value is implicitly converted to a string
Fortunately, for Lua, the expression "1" is equal to 1 when doing maths, so "1"+"1" will result in 2
(as well as 1..2 results in "12")
Really? I thought that Lua was better than php.
Every time a mod API is left undocumented, a koala dies.

User avatar
Casimir
Member
Posts: 1206
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

Re: Post your modding questions here

by Casimir » Post

orwell wrote:This is because the type of player attributes is always "string", you can't save other type's values there
Well... good to know.

juli
Member
Posts: 217
Joined: Sat Jun 11, 2016 10:31
GitHub: cpdef
In-game: juli

Re: Post your modding questions here

by juli » Post

How can i disable clouds?
Reason: Since minetest 0.4.15 the clouds are not disabled by changing the Skybox,
and i don't know now to disable it for the mars-mod (because mars has no clouds ;) )

More Info(optional): I've tried this mod: viewtopic.php?f=9&t=17392
in the video (from 1-th post) they said, that with changing the skybox the clouds are removed,
but at my PC with latest minetest they are not removed.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Post your modding questions here

by azekill_DIABLO » Post

go to advanced settings and serch for disable_clouds
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

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

Re: Post your modding questions here

by sofar » Post

juli wrote:How can i disable clouds?
Reason: Since minetest 0.4.15 the clouds are not disabled by changing the Skybox,
and i don't know now to disable it for the mars-mod (because mars has no clouds ;) )

More Info(optional): I've tried this mod: viewtopic.php?f=9&t=17392
in the video (from 1-th post) they said, that with changing the skybox the clouds are removed,
but at my PC with latest minetest they are not removed.

that's because when I initially wrote that mod, you had no choice: skybox would automatically turn off clouds.

However, I don't want that, and this was fixed in minetest about 2 weeks ago, so now clouds are possible in combination with skybox textures, and the skybox mod leaves them enabled (and tunes them to match the textures)

User avatar
TumeniNodes
Member
Posts: 2941
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: Post your modding questions here

by TumeniNodes » Post

Mars does have clouds though.
perhaps you could experiment with the settings for fog and clouds, to match them to the Mars mod?

This new feature and fix, actually gives more opportunity to add some better depth and overall feel of being in such a mysterious place such as Mars ; )

this link can give some visual ideas
https://www.reference.com/science/mars- ... 072668ed25
A Wonderful World

juli
Member
Posts: 217
Joined: Sat Jun 11, 2016 10:31
GitHub: cpdef
In-game: juli

Re: Post your modding questions here

by juli » Post

sofar wrote:
juli wrote: However, I don't want that, and this was fixed in minetest about 2 weeks ago, so now clouds are possible in combination with skybox textures, and the skybox mod leaves them enabled (and tunes them to match the textures)
Ok i didn't find anything in the mod where the clouds are tuned,
and i don't wanna remove them only in client side - i know that this is possible - so is there a minetest
function like minetest.set_clouds() or so?
@sofar can u post maybe an example to disable/recolor/tune clouds?
@Tumeni ok, i have to speak with players, whether there should be clouds or not :)

User avatar
Lone_Wolf
Member
Posts: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: Post your modding questions here

by Lone_Wolf » Post

Set the cloud height to -29999?
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

juli
Member
Posts: 217
Joined: Sat Jun 11, 2016 10:31
GitHub: cpdef
In-game: juli

Re: Post your modding questions here

by juli » Post

and how can i set them to -29999?

Nyarg
Member
Posts: 276
Joined: Sun May 15, 2016 04:32

Re: Post your modding questions here

by Nyarg » Post

minetest.conf (see minetest.conf.example)
or via settings page cloud_height parameter
I am a noob. still yet. Not so noob ) [vml] WIP and a little proof for fun PlantedTorch )))
MT Strike 78a36b468554d101e0be3b0d1f587a555f396452 Great! Somebody have found it )
"My english isn't well" I know. I'm sorry )

User avatar
Lone_Wolf
Member
Posts: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: Post your modding questions here

by Lone_Wolf » Post

Settings, client, menus.
(I can't assure you that is right but it should be close)
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Post your modding questions here

by azekill_DIABLO » Post

you can remove the clouds with your minetest conf!!!

it's clouds_enable = false

or somethin' like that
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: Post your modding questions here

by orwell » Post

minetest.conf.example wrote: # Clouds are a client side effect.
# type: bool
# enable_clouds = true
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: Post your modding questions here

by texmex » Post

How do I replace placed locked chests with regular chest while retaining its inventory and facedir? I'm a buffoon at this. I got the ABM working but that's it. Any advice on the right solution and any simplifications?

Code: Select all

	minetest.register_abm({
	    nodenames = {"default:chest_locked"},
	    interval = 3,
	    chance = 1,
	    action = function(pos)
	        local meta_src = minetest.get_meta(pos)
			local inv_src = meta_src:get_inventory()
			minetest.set_node(pos, {name="default:chest"})
			local inv_dst = meta_src:get_inventory()
	--		for i=1,#inv_src do
			 	inv_dst:set_stack("main",1,inv_src[1])
	--		end
	    end,
	})

Gerald
Member
Posts: 93
Joined: Sun Dec 28, 2014 10:35
In-game: gerald7
Location: Germany

Re: Post your modding questions here

by Gerald » Post

texmex wrote:How do I replace placed locked chests with regular chest while retaining its inventory and facedir? I'm a buffoon at this. I got the ABM working but that's it. Any advice on the right solution and any simplifications?
Use minetest.swap_node() instaed of minetest.set_node() and the metadata stays.
Facedir is the param2 value of the node.
This should work:

Code: Select all

action = function(pos, node)
  node.name = "default:chest"
  minetest.swap_node(pos, node)
end
What is the purpose and why do you use an abm? If you want to replace existing chests you should use a lbm.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: Post your modding questions here

by texmex » Post

The purpose is to simply convert locked chests to regular chests, in order to completely remove locked chests from the game. Thank you for swap_node, should do it! Suspected LBM could be suitable for such simple task but didn't try it.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: Post your modding questions here

by texmex » Post

How do i populate the right side of this node box with texture? Can I make a texture stretch the whole area or do I divide the textures (like I've started on here)?
Image

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Post your modding questions here

by azekill_DIABLO » Post

should work normally. size of texture?
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: Post your modding questions here

by texmex » Post

azekill_DIABLO wrote:should work normally. size of texture?
16x16 in this case, but I tried with 32x16 too. No matter what size I use, it stretches only to the first square.

Gerald
Member
Posts: 93
Joined: Sun Dec 28, 2014 10:35
In-game: gerald7
Location: Germany

Re: Post your modding questions here

by Gerald » Post

texmex wrote:How do i populate the right side of this node box with texture? Can I make a texture stretch the whole area or do I divide the textures (like I've started on here)?
I think the clean solution is to define two nodes like doors.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: Post your modding questions here

by texmex » Post

Gerald wrote:
texmex wrote:How do i populate the right side of this node box with texture? Can I make a texture stretch the whole area or do I divide the textures (like I've started on here)?
I think the clean solution is to define two nodes like doors.
Thank you, I'll track the door code down and have a look.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Post your modding questions here

by azekill_DIABLO » Post

how to use node timer?

Code: Select all

on_timer = function(pos,1) 	
		--[functions...]
	end,
returns: missing <name>
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: Post your modding questions here

by burli » Post

How are map information stored in the database? I can't find the reference

Gerald
Member
Posts: 93
Joined: Sun Dec 28, 2014 10:35
In-game: gerald7
Location: Germany

Re: Post your modding questions here

by Gerald » Post

azekill_DIABLO wrote:how to use node timer?

Code: Select all

on_timer = function(pos,1) 	
		--[functions...]
	end,
returns: missing <name>
Why do you define a function with a parameter called "1"?

If you want to run the function every second you can do something like this:

Code: Select all

minetest.register_node(<nodename>, {
  ...
  after_place_node = function(pos, placer, itemstack, pointed_thing)
    -- start the timer
    local timer = minetest.get_node_timer(pos) 
    timer:start(1)
  end,
  on_timer = function(pos, elapsed)
    <code to be executed>
    return true -- restart the timer
  end,
}

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: Post your modding questions here

by texmex » Post

Gerald wrote:
texmex wrote:How do i populate the right side of this node box with texture? Can I make a texture stretch the whole area or do I divide the textures (like I've started on here)?
I think the clean solution is to define two nodes like doors.
Turns out doors are mesh and not nodeboxes.

Locked

Who is online

Users browsing this forum: No registered users and 5 guests