Post your modding questions here

User avatar
pithy
Member
 
Posts: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Thu Nov 24, 2016 18:54

DS-minetest wrote:
pithy wrote:@DS-minetest: Your signature uses the word too. I do not think it means what you think it means.

is it better now?

Yes it is better.

Linuxdirk wrote:
pithy wrote:@Linuxdirk: To add a setting to the configuration UI see settingtypes.txt in lua_api.txt.

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?


Yes mods can have a settingtypes.txt to.

If it is not in minetest.conf then the value is nil.

Germans like to use the word too.

Image
 

User avatar
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Post your modding questions here

by Linuxdirk » Thu Nov 24, 2016 20:10

pithy wrote:Yes mods can have a settingtypes.txt to.

If it is not in minetest.conf then the value is nil.

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:Germans like to use the word too.

Wenn du willst, können wir auch gern auf Deutsch weiterdiskutieren. Ansonsten lasse mich bitte aus diesem OT-Quatsch raus. :)
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: Post your modding questions here

by ABJ » Thu Nov 24, 2016 22:32

idiocy mod
 

User avatar
pithy
Member
 
Posts: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Thu Nov 24, 2016 22:36

Linuxdirk wrote:Wenn du willst, können wir auch gern auf Deutsch weiterdiskutieren. Ansonsten lasse mich bitte aus diesem OT-Quatsch raus. :)


Google Übersetzer funktioniert gut.

Vielleicht sollte ich aufhören, ich bin sowieso schlecht.
 

User avatar
GreenDimond
Member
 
Posts: 460
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond

Re: Post your modding questions here

by GreenDimond » Sat Nov 26, 2016 18:02

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 am Green. I tend to binge-post. "All of this over a 16x16 representation of a cartoon cat ?!?! what has this world come to..." -TenPlus1, 2017.
Diz mah mods! :D ↑ github.com/minetest/minetest_game/issues/1647#issuecomment-288134572 ↑
Sand Plus - Tac Nayn - Waffles - Coming Soon: Caverealms Plus
 

User avatar
D00Med
Member
 
Posts: 712
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med

Re: Post your modding questions here

by D00Med » Sat Nov 26, 2016 19:38

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:
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
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,

But I don't know about making it dependant on the direction the player faces
Look! I have a signature :]
My subgame: https://forum.minetest.net/viewtopic.php?f=15&t=14051#p207242
dmobs2 is coming...
 

User avatar
RHR
Member
 
Posts: 214
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Sat Nov 26, 2016 21:50

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.


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:
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
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,

But I don't know about making it dependant on the direction the player faces


I think it is probably better to place them as schematics
 

User avatar
GreenDimond
Member
 
Posts: 460
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond

Re: Post your modding questions here

by GreenDimond » Sun Nov 27, 2016 01:03

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:
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
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,

But I don't know about making it dependant on the direction the player faces


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̶)̶
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().
I am Green. I tend to binge-post. "All of this over a 16x16 representation of a cartoon cat ?!?! what has this world come to..." -TenPlus1, 2017.
Diz mah mods! :D ↑ github.com/minetest/minetest_game/issues/1647#issuecomment-288134572 ↑
Sand Plus - Tac Nayn - Waffles - Coming Soon: Caverealms Plus
 

User avatar
D00Med
Member
 
Posts: 712
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med

Re: Post your modding questions here

by D00Med » Sun Nov 27, 2016 06:40

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?
Look! I have a signature :]
My subgame: https://forum.minetest.net/viewtopic.php?f=15&t=14051#p207242
dmobs2 is coming...
 

User avatar
pithy
Member
 
Posts: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Mon Nov 28, 2016 16:26

How do I use listcolors twice in a formspec?
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Post your modding questions here

by orwell » Tue Nov 29, 2016 15:31

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
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
pithy
Member
 
Posts: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Tue Nov 29, 2016 15:55

^Thats what I was thinking I might have to do.
 

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

Re: Post your modding questions here

by Nyarg » Wed Nov 30, 2016 04:08

Hi folks )
Is it right if attached entity (to other entity) disappear after restart singleplayer game ?

simplified code here:
+ Spoiler
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: Post your modding questions here

by DS-minetest » Wed Nov 30, 2016 14:15

i think no, it only gets detached
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
GreenDimond
Member
 
Posts: 460
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond

Re: Post your modding questions here

by GreenDimond » Wed Nov 30, 2016 17:41

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.
I am Green. I tend to binge-post. "All of this over a 16x16 representation of a cartoon cat ?!?! what has this world come to..." -TenPlus1, 2017.
Diz mah mods! :D ↑ github.com/minetest/minetest_game/issues/1647#issuecomment-288134572 ↑
Sand Plus - Tac Nayn - Waffles - Coming Soon: Caverealms Plus
 

User avatar
pithy
Member
 
Posts: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Wed Nov 30, 2016 18:07

Use "after_place_node" in the node def.
 

User avatar
GreenDimond
Member
 
Posts: 460
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond

Re: Post your modding questions here

by GreenDimond » Fri Dec 02, 2016 16:31

Gave up on what I was doing. :P
I am Green. I tend to binge-post. "All of this over a 16x16 representation of a cartoon cat ?!?! what has this world come to..." -TenPlus1, 2017.
Diz mah mods! :D ↑ github.com/minetest/minetest_game/issues/1647#issuecomment-288134572 ↑
Sand Plus - Tac Nayn - Waffles - Coming Soon: Caverealms Plus
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

Re: Post your modding questions here

by ExeterDad » Sat Dec 03, 2016 20:45

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?
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Post your modding questions here

by orwell » Sat Dec 03, 2016 22:36

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:
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 original_func = minetest.chatcommands["chatcommandname"].func
minetest.chatcommands["chatcommandname"].func = function (name, param)
        if your condition here then
                original_func(name, param)
        end
end

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.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Big signs

by hajo » Sun Dec 04, 2016 12:09

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.
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Post your modding questions here

by orwell » Sun Dec 04, 2016 16:23

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.
Last edited by orwell on Mon Dec 05, 2016 20:34, edited 1 time in total.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: Post your modding questions here

by DS-minetest » Sun Dec 04, 2016 16:55

10 blender units equal 1 node at entities, at nodes, its 1:1
and .obj (wavefront) takes less disc space
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
D00Med
Member
 
Posts: 712
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med

Re: Post your modding questions here

by D00Med » Sun Dec 04, 2016 19:10

^can .obj files be animated?
Look! I have a signature :]
My subgame: https://forum.minetest.net/viewtopic.php?f=15&t=14051#p207242
dmobs2 is coming...
 

User avatar
Christian9
Member
 
Posts: 273
Joined: Fri Sep 19, 2014 20:29
In-game: Christian9

Re: Post your modding questions here

by Christian9 » Sun Dec 04, 2016 19:33

Yes, one example is the fan in VanessaE's Homedecor modpack
"I dreamed of becoming a scientist, in general, and a paleontologist, in particular, ever since the Tyrannosaurus skeleton awed and scared me" - Steven Jay Gould

My Deviantart Page
My Website
 

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

Re: Post your modding questions here

by sofar » Sun Dec 04, 2016 21:02

D00Med wrote:^can .obj files be animated?


No.

Christian9 wrote:Yes, one example is the fan in VanessaE's Homedecor modpack


The fan in homedecor_modpack is a .b3d model, not an .obj model.
 

User avatar
D00Med
Member
 
Posts: 712
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med

Re: Post your modding questions here

by D00Med » Sun Dec 04, 2016 21:04

Ok thanks.
Look! I have a signature :]
My subgame: https://forum.minetest.net/viewtopic.php?f=15&t=14051#p207242
dmobs2 is coming...
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: Post your modding questions here

by hajo » Mon Dec 05, 2016 14:58

orwell wrote:You could make one big mesh and place the sign texture on it. .

Well, textures are static, and would need one for each text/sign.
And the text couldn't be changed ingame.

With "better solution" for big signs I meant a way to avoid such textures,
perhaps like the current signs with a formspec, but shown as big text
visible on a number of blocks.
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Post your modding questions here

by orwell » Mon Dec 05, 2016 20:37

Dynamic text is complicated ATM, because you can only change the texture of entities. Maybe have a look at display_lib, that looks promising.
The point is that a 'mesh' sign does not consist of multiple blocks. That was the simplification I wanted to advise.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

Re: Post your modding questions here

by ExeterDad » Tue Dec 06, 2016 02:13

orwell wrote: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:
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 original_func = minetest.chatcommands["chatcommandname"].func
minetest.chatcommands["chatcommandname"].func = function (name, param)
        if your condition here then
                original_func(name, param)
        end
end

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.

Wow! Thanks a bunch orwell! It's going to take me a bit to wrap my brain around that... but I appreciate the example and explanation. I'm pretty sure it looks like what I need :)
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

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

Re: Post your modding questions here

by Nyarg » Wed Dec 07, 2016 09:38

Is here something like on_collide for entities ?
Half of hour RTFM but nothing yet :/

Another question:
Entities after game loading stay visible after 2-4 sec than nodes.
Is it common behaviour ?
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 11 guests

cron