Post your modding questions here

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

Re: Post your modding questions here

by Byakuren » Mon May 15, 2017 19:44

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: 1161
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

Re: Post your modding questions here

by Casimir » Wed May 17, 2017 19:55

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: 208
Joined: Sat Jun 11, 2016 10:31
GitHub: cpdef
In-game: juli

Re: Post your modding questions here

by juli » Fri May 19, 2017 07:09

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: 7479
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

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

Re: Post your modding questions here

by sofar » Fri May 19, 2017 23:40

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: 2699
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Sat May 20, 2017 00:08

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
I couldn't fix your brakes, so I made your horn louder.
 

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

Re: Post your modding questions here

by juli » Mon May 22, 2017 09:39

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: 2160
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf
 

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

Re: Post your modding questions here

by juli » Tue May 23, 2017 06:39

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 » Tue May 23, 2017 06:52

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: 2160
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf

Re: Post your modding questions here

by Lone_Wolf » Tue May 23, 2017 16:45

Settings, client, menus.
(I can't assure you that is right but it should be close)
 

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

Re: Post your modding questions here

by azekill_DIABLO » Tue May 23, 2017 16:58

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

it's clouds_enable = false

or somethin' like that
 

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

Re: Post your modding questions here

by orwell » Wed May 24, 2017 19:36

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: 1400
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: Post your modding questions here

by texmex » Fri May 26, 2017 13:46

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: 91
Joined: Sun Dec 28, 2014 10:35
Location: Germany
In-game: gerald7

Re: Post your modding questions here

by Gerald » Fri May 26, 2017 14:32

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: 1400
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: Post your modding questions here

by texmex » Fri May 26, 2017 15:21

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: 1400
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: Post your modding questions here

by texmex » Sat May 27, 2017 09:32

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: 7479
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

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

Re: Post your modding questions here

by texmex » Sat May 27, 2017 15:55

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: 91
Joined: Sun Dec 28, 2014 10:35
Location: Germany
In-game: gerald7

Re: Post your modding questions here

by Gerald » Sat May 27, 2017 16:22

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: 1400
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: Post your modding questions here

by texmex » Sat May 27, 2017 17:40

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: 7479
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Post your modding questions here

by azekill_DIABLO » Sun May 28, 2017 12:24

how to use node timer?
Code: Select all
on_timer = function(pos,1)    
      --[functions...]
   end,

returns: missing <name>
 

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

Re: Post your modding questions here

by burli » Sun May 28, 2017 17:10

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

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

Re: Post your modding questions here

by Gerald » Sun May 28, 2017 18:43

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: 1400
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: Post your modding questions here

by texmex » Sun May 28, 2017 20:00

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.
 

PreviousNext

Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 1 guest