Post your modding questions here
- 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
Instead of using g() you can just write
var = minetest.setting_get(value) or default
Much shorter than defining g().
var = minetest.setting_get(value) or default
Much shorter than defining g().
Re: Post your modding questions here
license question:
if i use a mod or parts of a mod in my subgame,
but i edit/change the mod content, what do i write into the "license.txt"?
if i use a mod or parts of a mod in my subgame,
but i edit/change the mod content, what do i write into the "license.txt"?
✨🏳️🌈♣️✨
- Desour
- Member
- Posts: 1473
- Joined: Thu Jun 19, 2014 19:49
- GitHub: Desour
- IRC: Desour
- In-game: DS
- Location: I'm scared that if this is too exact, I will be unable to use my keyboard.
Re: Post your modding questions here
is it better now?pithy wrote:@DS-minetest: Your signature uses the word too. I do not think it means what you think it means.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)
- Linuxdirk
- Member
- Posts: 3219
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Post your modding questions here
So settingtypes.txt isn’t for games only but mods can use it, too? But I guess with this I still have to make sure to use some kind of validation of the used configuration option actually exists in minetest.conf, right?pithy wrote:@Linuxdirk: To add a setting to the configuration UI see settingtypes.txt in lua_api.txt.
Currently it isn't for better flexibility but g() could be extended to automatically prefix the option. Writing local var = g('parameter', 'default') to me is much shorter than writing local var = minetest.setting_get('my_cool_mod_pefix_parameter') or 'default' …orwell wrote:Instead of using g() you can just write
var = minetest.setting_get(value) or default
Much shorter than defining g().
Of course it makes no sense to use a function when only requesting one or two parameters. But I use this function in my entire mod pack and all of the possible values are configurable through options.
Re: Post your modding questions here
Yes it is better.DS-minetest wrote:is it better now?pithy wrote:@DS-minetest: Your signature uses the word too. I do not think it means what you think it means.
Yes mods can have a settingtypes.txt to.Linuxdirk wrote:So settingtypes.txt isn’t for games only but mods can use it, too? But I guess with this I still have to make sure to use some kind of validation of the used configuration option actually exists in minetest.conf, right?pithy wrote:@Linuxdirk: To add a setting to the configuration UI see settingtypes.txt in lua_api.txt.
If it is not in minetest.conf then the value is nil.
Germans like to use the word too.
- Linuxdirk
- Member
- Posts: 3219
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Post your modding questions here
Just checked and rewrote my modpack so it uses the file. Too bad it's stated nowhere that this is possible for mods, too.pithy wrote:Yes mods can have a settingtypes.txt to.
If it is not in minetest.conf then the value is nil.
Wenn du willst, können wir auch gern auf Deutsch weiterdiskutieren. Ansonsten lasse mich bitte aus diesem OT-Quatsch raus. :)pithy wrote:Germans like to use the word too.
Re: Post your modding questions here
Google Übersetzer funktioniert gut.Linuxdirk wrote: Wenn du willst, können wir auch gern auf Deutsch weiterdiskutieren. Ansonsten lasse mich bitte aus diesem OT-Quatsch raus. :)
Vielleicht sollte ich aufhören, ich bin sowieso schlecht.
- GreenXenith
- Member
- Posts: 1356
- Joined: Wed Oct 28, 2015 01:26
- GitHub: GreenXenith
- Location: UTC-8:00
- Contact:
Re: Post your modding questions here
Question:
If I wanted multiple blocks to be placed when I place one block, how would I make that happen? Also dependent on what direction player is facing?
eg- place one block and 2 "spawn" stacked on top and 3 "spawn" stacked next to it
[][]
[][] <------like that
[][]
^
Say that is the original block.
If I wanted multiple blocks to be placed when I place one block, how would I make that happen? Also dependent on what direction player is facing?
eg- place one block and 2 "spawn" stacked on top and 3 "spawn" stacked next to it
[][]
[][] <------like that
[][]
^
Say that is the original block.
YouTube | Mods | Patreon | Minetest Discord @greenxenith
You should not be able to read this message.
You should not be able to read this message.
- D00Med
- Member
- Posts: 949
- Joined: Sat Feb 07, 2015 22:49
- GitHub: D00Med
- Location: Australia...somewhere
Re: Post your modding questions here
When the block is placed(on_construct), check if the block beside is empty(ie: air), and then use minetest:set_node(pos, {name="nodename"}).
Like this:
But I don't know about making it dependant on the direction the player faces
Like this:
Code: Select all
on_construct = function(pos, node, _)
local under = {x=pos.x, y=pos.y-1, z=pos.z}
if minetest.get_node(under).name == "air" then
minetest.set_node(under, {name = "test:node"})
end
end,
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242
My subgame: viewtopic.php?f=15&t=14051#p207242
Re: Post your modding questions here
GreenDimond wrote:Question:
If I wanted multiple blocks to be placed when I place one block, how would I make that happen? Also dependent on what direction player is facing?
eg- place one block and 2 "spawn" stacked on top and 3 "spawn" stacked next to it
[][]
[][] <------like that
[][]
^
Say that is the original block.
I think it is probably better to place them as schematicsD00Med wrote:When the block is placed(on_construct), check if the block beside is empty(ie: air), and then use minetest:set_node(pos, {name="nodename"}).
Like this:But I don't know about making it dependant on the direction the player facesCode: Select all
on_construct = function(pos, node, _) local under = {x=pos.x, y=pos.y-1, z=pos.z} if minetest.get_node(under).name == "air" then minetest.set_node(under, {name = "test:node"}) end end,
- GreenXenith
- Member
- Posts: 1356
- Joined: Wed Oct 28, 2015 01:26
- GitHub: GreenXenith
- Location: UTC-8:00
- Contact:
Re: Post your modding questions here
W̶h̶e̶r̶e̶ ̶d̶o̶ ̶I̶ ̶p̶u̶t̶ ̶t̶h̶a̶t̶ ̶a̶n̶d̶ ̶h̶o̶w̶?̶ ̶(̶W̶h̶e̶r̶e̶ ̶i̶n̶ ̶t̶h̶e̶ ̶c̶o̶d̶e̶)̶D00Med wrote:When the block is placed(on_construct), check if the block beside is empty(ie: air), and then use minetest:set_node(pos, {name="nodename"}).
Like this:But I don't know about making it dependant on the direction the player facesCode: Select all
on_construct = function(pos, node, _) local under = {x=pos.x, y=pos.y-1, z=pos.z} if minetest.get_node(under).name == "air" then minetest.set_node(under, {name = "test:node"}) end end,
I̶ ̶t̶r̶i̶e̶d̶ ̶p̶u̶t̶t̶i̶n̶g̶ ̶a̶f̶t̶e̶r̶ ̶s̶o̶u̶n̶d̶s̶ ̶b̶u̶t̶ ̶d̶i̶d̶n̶t̶ ̶w̶o̶r̶k̶ ̶:̶P̶
EDIT: Figured that out, but the amount of blocks placed is infinite in that direction until obstructed... also, sounds don't seem to work. Keeps saying 'default' is nil in the default.node_sound_wood_defaults().
YouTube | Mods | Patreon | Minetest Discord @greenxenith
You should not be able to read this message.
You should not be able to read this message.
- D00Med
- Member
- Posts: 949
- Joined: Sat Feb 07, 2015 22:49
- GitHub: D00Med
- Location: Australia...somewhere
Re: Post your modding questions here
Oh yes I forgot to mention that, just make it check if there is not already a the same node 2 nodes above.
have you listed default as a dependancy?
have you listed default as a dependancy?
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242
My subgame: viewtopic.php?f=15&t=14051#p207242
Re: Post your modding questions here
How do I use listcolors twice in a formspec?
- 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
You mean upper inventory blue and lower red?
I think this isn't possible as of now.
But you could make a background and make slot background transparent
I think this isn't possible as of now.
But you could make a background and make slot background transparent
Re: Post your modding questions here
^Thats what I was thinking I might have to do.
Re: Post your modding questions here
Hi folks )
Is it right if attached entity (to other entity) disappear after restart singleplayer game ?
simplified code here:
Is it right if attached entity (to other entity) disappear after restart singleplayer game ?
simplified code here:
Spoiler
Code: Select all
local a = minetest.add_entity( pos, Proto)
local b = minetest.add_entity( pos, Proto)
b:set_attach( a, "", { x=10, y=0, z=0}, {x=0, y=0, z=0})
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 )
MT Strike 78a36b468554d101e0be3b0d1f587a555f396452 Great! Somebody have found it )
"My english isn't well" I know. I'm sorry )
- Desour
- Member
- Posts: 1473
- Joined: Thu Jun 19, 2014 19:49
- GitHub: Desour
- IRC: Desour
- In-game: DS
- Location: I'm scared that if this is too exact, I will be unable to use my keyboard.
Re: Post your modding questions here
i think no, it only gets detached
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)
- GreenXenith
- Member
- Posts: 1356
- Joined: Wed Oct 28, 2015 01:26
- GitHub: GreenXenith
- Location: UTC-8:00
- Contact:
Re: Post your modding questions here
Is there an on_player_construct function or anything? Using on_construct makes an infinite tower. If there was a construct function specific to a player placing a block, I would like to know what it is.
YouTube | Mods | Patreon | Minetest Discord @greenxenith
You should not be able to read this message.
You should not be able to read this message.
Re: Post your modding questions here
Use "after_place_node" in the node def.
- GreenXenith
- Member
- Posts: 1356
- Joined: Wed Oct 28, 2015 01:26
- GitHub: GreenXenith
- Location: UTC-8:00
- Contact:
Re: Post your modding questions here
Gave up on what I was doing. :P
YouTube | Mods | Patreon | Minetest Discord @greenxenith
You should not be able to read this message.
You should not be able to read this message.
- ExeterDad
- Member
- Posts: 1717
- Joined: Sun Jun 01, 2014 20:00
- In-game: ExeterDad
- Location: New Hampshire U.S.A
Re: Post your modding questions here
Is it possible to override a chat command registered by a mod to check for a condition? If so, how do I target it? Or would it be better to override the entire mod?
HOMETOWN -Our little server. Keep the HOMETOWN chatter @ http://hometownserver.com - Our server map: http://media.hometownserver.com
- 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
Yes you can, and that's cool about lua. You should avoid this practice, but here's how:
1. depend on the mod that registers the chatcommand, so that it loads first
2. take it and modify the function:
It's important that you understand what you're doing:
you are saving the original function that the mod registered as local variable, then you define a new function that replaces the original chatcommand's function with the above code.
if you condition is true, you call the original function.
1. depend on the mod that registers the chatcommand, so that it loads first
2. take it and modify the function:
Code: Select all
local original_func = minetest.chatcommands["chatcommandname"].func
minetest.chatcommands["chatcommandname"].func = function (name, param)
if your condition here then
original_func(name, param)
end
end
you are saving the original function that the mod registered as local variable, then you define a new function that replaces the original chatcommand's function with the above code.
if you condition is true, you call the original function.
Big signs
For Wild-West - themed buildings, I would need big signs on houses,
such as "Bank", "Saloon", "General Store", etc.
Obviously, I could make textures with parts of such a text,
(or just single big letters) to put on blocks.
Is there a better / more general way than to do it ?
E.g. a block made of 2 different materials, and a surface-pattern,
that makes it look like those ore-blocks. but shaped like a letter/symbol.
There is a mod for traffic-signs, and an idea for a sign-making machine, but still WIP.
such as "Bank", "Saloon", "General Store", etc.
Obviously, I could make textures with parts of such a text,
(or just single big letters) to put on blocks.
Is there a better / more general way than to do it ?
E.g. a block made of 2 different materials, and a surface-pattern,
that makes it look like those ore-blocks. but shaped like a letter/symbol.
There is a mod for traffic-signs, and an idea for a sign-making machine, but still WIP.
'My' wiki-pages: Build-a-home - basic-robot - basic_robot_csm - basic-machines - digtron - xdecor -
Map-Database
Map-Database
- 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
You could make one big mesh and place the sign texture on it. That mesh would then span ~5 nodes but only occupies the node you placed it to.
The homedecor soda vending machine is actually a mesh being 2 nodes high and having a texture. Or have a look at the rails from my trains mod.
- model it in blender and unwrap (detailed info on how to make textures for models you find on youtube)
(1 blender unit equals 1 node)
- export as b3d and write SALOON on the texture
- make a drawtype=mesh node in MT.
The homedecor soda vending machine is actually a mesh being 2 nodes high and having a texture. Or have a look at the rails from my trains mod.
- model it in blender and unwrap (detailed info on how to make textures for models you find on youtube)
(1 blender unit equals 1 node)
- export as b3d and write SALOON on the texture
- make a drawtype=mesh node in MT.
Last edited by orwell on Mon Dec 05, 2016 20:34, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 17 guests