Post your modding questions here

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Mon Jul 15, 2013 11:30

question about box in formspec, the API call:
box [<X>, <Y>; <W>, <H>; <color>]
^ Simple colored semitransparent box
^ X and y position the box relative to the top left of the menu
^ W and h are the size of box
^ Colorkey (see colorkeys)

So I tried it with:
"box [6.6, 1.1, 0xFF0000]"
or
"box [6.6, 1.1; FF0000]"
or
"box [6.6, 1.1; 000000]"
  and with other various forms of color definition. Minecraft always responds:


13:21:02: ERROR [main]: Invalid Box element (3): '6, 6, 1.1, 0xFF0000 'INVALID COLOR

Someone very kindly know the proper way to use the colors in the definition of a box within a formspec?
I hope you understand me.

EDIT!!
i need the latest git version up to use rgb colour definition.
the answer to my question is: update minetest!
Last edited by pandaro on Mon Jul 15, 2013 12:52, edited 1 time in total.
sorry for bad english
Linux debian 7 wheezy 64
kde
 

slenderman
New member
 
Posts: 5
Joined: Wed May 15, 2013 02:16

by slenderman » Wed Jul 17, 2013 02:39

thanks
 

User avatar
ch98
Member
 
Posts: 463
Joined: Wed Jan 02, 2013 06:14

by ch98 » Wed Jul 17, 2013 05:23

No one seemd to have looked at my post so I will repeat.

My concrete 2.2 mod seems to shut server down when you dig the concrete.
Code causing the problem most likely is...
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
minetest.register_node("concrete:concrete", {
    description = "Concrete",
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete4")
    end,
})

minetest.register_node("concrete:concrete1", {
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete2")
    end,
})

minetest.register_node("concrete:concrete2", {
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete3")
    end,
})

minetest.register_node("concrete:concrete3", {
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete")
    end,
})

minetest.register_node("concrete:concrete4", {
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete5")
    end,
})

minetest.register_node("concrete:concrete5", {
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete6")
    end,
})

minetest.register_node("concrete:concrete6", {
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
})

minetest.register_node("concrete:reinforced_concrete", {
    description = "Reinforced Concerte",
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete1")
    end,
})

can you find the problem?
Last edited by ch98 on Wed Jul 17, 2013 05:23, edited 1 time in total.
Mudslide mod Click Here
 

User avatar
ShadowNinja
Member
 
Posts: 194
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

by ShadowNinja » Wed Jul 17, 2013 14:53

ch98 wrote:No one seemd to have looked at my post so I will repeat.

My concrete 2.2 mod seems to shut server down when you dig the concrete.
Code causing the problem most likely is...
~~~~
minetest.env:set_node(pos, "concrete:concrete4")
~~~~
can you find the problem?


Yes, set_node and add_node take a table containing the fields 'name', 'param1', and 'param2'.
Also minetest.env:* was moved to minetest.*.

minetest.set_node(pos, {name="concrete:concrete4"})

Note: Technic also has a concrete mod, so watch out for conflicts.
Edit: Nevermind, it is under the technic namespace.
Last edited by ShadowNinja on Thu Jul 18, 2013 02:09, edited 1 time in total.
I play on my Minetest server and VanessaE's.
The best way to contact me is usually IRC (InchraNet, freenode).
 

User avatar
ch98
Member
 
Posts: 463
Joined: Wed Jan 02, 2013 06:14

by ch98 » Wed Jul 17, 2013 20:19

Shadow wrote:
ch98 wrote:No one seemd to have looked at my post so I will repeat.

My concrete 2.2 mod seems to shut server down when you dig the concrete.
Code causing the problem most likely is...
~~~~
minetest.env:set_node(pos, "concrete:concrete4")
~~~~
can you find the problem?


Yes, set_node and add_node take a table containing the fields 'name', 'param1', and 'param2'.
Also minetest.env:* was moved to minetest.*.

minetest.set_node(pos, {name="concrete:concrete4"})

Note: Technic also has a concrete mod, so watch out for conflicts.

I will try that.
Mudslide mod Click Here
 

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11

by Dan Duncombe » Thu Jul 18, 2013 00:02

Is there any way of running a certain lua file when a certain node is placed? So: If I placed mymod:mynode it would do the file mymod_second_part.lua
Also, is there any way of making it so only one of mymod:mynode can be placed in the world?
Lastly, can I make it so that if a stone node has air above it, every five seconds it has a 1/5 chance of spawning a fire node (ABM perhaps)

Please PM me with any answers.
Last edited by Dan Duncombe on Thu Jul 18, 2013 00:06, edited 1 time in total.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Thu Jul 18, 2013 14:55

Is it possible to put a modpack inside of other modpacks?
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
ShadowNinja
Member
 
Posts: 194
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

by ShadowNinja » Thu Jul 18, 2013 15:12

Evergreen wrote:Is it possible to put a modpack inside of other modpacks?

Yes, I have them nested to three of four levels.
I play on my Minetest server and VanessaE's.
The best way to contact me is usually IRC (InchraNet, freenode).
 

TeslaTest
New member
 
Posts: 3
Joined: Fri Jul 19, 2013 23:49

by TeslaTest » Sat Jul 20, 2013 00:17

wtebmaster wrote:For the life of me I CANNOT MOD.

I am on a 64-bit Windows 7 Toshiba laptop. I use the stable, official 0.4.6 release. I've tried both the installer (in beta) and just extracting it to a folder I named Minetest in WINDOWS (C:).

I know how to install them: it's easy, just extract into the mods folder. But nothing works. The mods simply won't run, even if the game does. Every single time I run a game it's like the mod was never there. I've uninstalled and reinstalled. I even tried PilzAdam's unofficial build. Nothing works.

I'll rename the mods folder like some people say I should with the name consisting only of lowercase letters. That doesn't work either. So what the heck is going on? I even tried to make a simple mod myself, the decowood mod that is used for the creating mods tutorial. That doesn't work either.

I've tried at least two mods, the mob framework and the PilzAdam's Minecraft-like item drop mod. It all refuses to run. Can anyone help? I'll try to give additional information as needed.


There is a configure button in the start screen of Minetest. With that you can decide what mods you want installed and what mods you don't. Hope this helps.
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Sat Jul 20, 2013 15:33

Dan Duncombe wrote:Is there any way of running a certain lua file when a certain node is placed? So: If I placed mymod:mynode it would do the file mymod_second_part.lua

see after_place_node in register_node. The function is usually used to setup nodes (i.e. set their owner).

Dan Duncombe wrote:Also, is there any way of making it so only one of mymod:mynode can be placed in the world?

Yes, but that takes more effort. You could store the information where the exclusive node was placed in a file in the world folder - and check each time a node of that type is to be placed if the file exists.

Dan Duncombe wrote:Lastly, can I make it so that if a stone node has air above it, every five seconds it has a 1/5 chance of spawning a fire node (ABM perhaps)

Yes, register_abm is the right place to look for.
A list of my mods can be found here.
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Mon Jul 22, 2013 18:36

In which folder is stored the starry sky of minetest?
sorry for bad english
Linux debian 7 wheezy 64
kde
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Jul 22, 2013 18:57

pandaro wrote:In which folder is stored the starry sky of minetest?

Its not stored anywhere, its generated at runtime.
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Mon Jul 22, 2013 22:15

I think about the possibility of creating a starry sky always the same, that would enable the player to navigate at night using the stars.
It would be possible at least in theory?
sorry for bad english
Linux debian 7 wheezy 64
kde
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Mon Jul 22, 2013 22:20

Hi, i searched but no success ... how would i control the order of execution of 'on generated' functions in various mods? ... dependancies maybe?
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

User avatar
qwrwed
Member
 
Posts: 323
Joined: Sun Jul 22, 2012 20:56
In-game: qwrwed or Nitro

by qwrwed » Wed Jul 24, 2013 14:38

How do I use add_node or set_node to create other nodes? i am making a plasma screen TV mod which has 6 nodes, arranged like this:
1 2 3
4 5 6
5 is the node that is placed, and when the player places it the other 5 nodes should generate. However, I don't know how to do this, and looking in the code for the stargate mod, doors mod and beds mod did not help - the first two were more complicated, and I don't even know where I'm going wrong using code from beds, so I would like to start from scratch.
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Wed Jul 24, 2013 16:34

webdesigner97 wrote:If you need your manually placed node to facedir, make sure to add param2 to the node:

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
    after_place_node = function(pos,placer,itemstack)
        --Don't forget to modify the <pos> table
        minetest.set_node(pos,{name="bla", param2=minetest.dir_to_facedir(placer:get_look_dir())})
    end


And for changing pictures: Why not use a texture animation?
 

dannydanger
Member
 
Posts: 40
Joined: Mon May 06, 2013 23:55

by dannydanger » Sun Jul 28, 2013 19:02

how do you make terracotta roof tile
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

by Topywo » Sun Jul 28, 2013 21:38

dannydanger wrote:how do you make terracotta roof tile


You mean the one from VanessaE's homedecor? -->

http://minetest-home-decor.wikia.com/wiki/Minetest_Home_Decor_Wiki
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Mon Jul 29, 2013 01:42

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_rightclick = function(pos, node, clicker)
        local inv = clicker:get_inventory()
        if inv:room_for_item("main", {name="flowers:pot", count=1, wear=0, metadata=""}) then
            node.name = "flowers:dandelion_white"
            minetest.env:set_node(pos, node)
            minetest.sound_play("default_dug_node", {pos,gain = 1.0})
            inv:add_item("main", "flowers:pot")
        end
    end,

Everything works, except adding the item. It is added when there is already a stack of flowers:pot in the inventory, but not when there is non.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Mon Jul 29, 2013 01:51

Casimir wrote:
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_rightclick = function(pos, node, clicker)
        local inv = clicker:get_inventory()
        if inv:room_for_item("main", {name="flowers:pot", count=1, wear=0, metadata=""}) then
            node.name = "flowers:dandelion_white"
            minetest.env:set_node(pos, node)
            minetest.sound_play("default_dug_node", {pos,gain = 1.0})
            inv:add_item("main", "flowers:pot")
        end
    end,

Everything works, except adding the item. It is added when there is already a stack of flowers:pot in the inventory, but not when there is non.

have you tried removing 'wear=0' from the room_for_item() call? It sounds silly, but 'wear' should only be set on tools (note that '0' is neither nil, nor a "false" boolean value).
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Mon Jul 29, 2013 02:35

Setting the node and playing sound is working, so that's not the problem.

At the moment I have a much bigger one: I moved a mod into another folder, because I wanted to publish it. Using strg-x and strg-v and then is just disappeared :(
Is is Mint, is it Thunar or is it me who has done something wrong? (Yes, I should have made backups.)
It might be to late at night - I'm very confused - in the game everything still works but the mod-folder is nowhere.
Last edited by Casimir on Mon Jul 29, 2013 02:42, edited 1 time in total.
 

User avatar
fairiestoy
Member
 
Posts: 191
Joined: Sun Jun 09, 2013 19:25

by fairiestoy » Mon Jul 29, 2013 21:38

Hello guys,

is it possible to access the tiles that were used on minetest.register_node( <parameters> ) ? I found param1 & param2 as well as the name, but no way to find the registered image files used for that specific tile. Is that somehow possible?
(If i missed something really obvious, sorry for that :-/ )

Greetings
Interesting about new things is, to figure out how it works ...
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Mon Jul 29, 2013 22:44

I don't understand what you mean but this might help: https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L1956
Do you want to change the texture of a node (like stone and desertstone) or the way it is displayed (like papyrus/stone/torch/sign/rail...)?
 

derpswa99
Member
 
Posts: 78
Joined: Sun Mar 24, 2013 21:26

by derpswa99 » Tue Jul 30, 2013 04:46

Is there any way someone can port minetest to a ps3?
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Tue Jul 30, 2013 10:20

derpswa99 wrote:Is there any way someone can port minetest to a ps3?


No.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Tue Jul 30, 2013 10:57

fairiestoy wrote:Hello guys,

is it possible to access the tiles that were used on minetest.register_node( <parameters> ) ? I found param1 & param2 as well as the name, but no way to find the registered image files used for that specific tile. Is that somehow possible?
(If i missed something really obvious, sorry for that :-/ )

Greetings


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 first_tile = minetest.registered_nodes["default:wood"].tiles[1]
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
fairiestoy
Member
 
Posts: 191
Joined: Sun Jun 09, 2013 19:25

by fairiestoy » Tue Jul 30, 2013 14:46

kaeza wrote:
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 first_tile = minetest.registered_nodes["default:wood"].tiles[1]


Thanks kaeza. Thats exactly what im looking for :3


Casimir wrote:I don't understand what you mean but this might help: https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L1956
Do you want to change the texture of a node (like stone and desertstone) or the way it is displayed (like papyrus/stone/torch/sign/rail...)?

I dont want to change it. I need the references to see, if i can create a way of changing the appearance of a node ( with use of a dummy node ) especially its mesh in a way that is not dependent on hard coded links to other mods. As example:
The stairpick mod uses references to the stairsplus stairs. So it looks up the fitting stairs out of this mod in order to replace the node you are pointing to and replace it with the stair.
BUT if you are capable of accessing the tiles of a registered node, you could create a stairpick (as example) that uses no references to other mods. Instead it uses a dummy model of a mesh (also an example) and assigns the texture of the node you were pointing to in the first place.

I hope this will work ( up to now its only a idea)
Interesting about new things is, to figure out how it works ...
 

Exilyth
Member
 
Posts: 60
Joined: Sun Jul 28, 2013 18:46

by Exilyth » Thu Aug 01, 2013 20:22

How do you use the facedir param (param2) of nodes? E.g. how do you make the facedir of a node depend on where the player looked when it is placed?
I'm running 0.4.13 stable with [technic][carts][farming_plus][biome_lib][unified_inventory] and a few other mods.
 

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11

by Dan Duncombe » Thu Aug 01, 2013 20:23

Exilyth wrote:How do you use the facedir param (param2) of nodes? E.g. how do you make the facedir of a node depend on where the player looked when it is placed?


To make a node have facedir:
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
paramtype2 = "facedir",
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

Exilyth
Member
 
Posts: 60
Joined: Sun Jul 28, 2013 18:46

by Exilyth » Thu Aug 01, 2013 20:43

Dan Duncombe wrote:
Exilyth wrote:How do you use the facedir param (param2) of nodes? E.g. how do you make the facedir of a node depend on where the player looked when it is placed?


To make a node have facedir:
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
paramtype2 = "facedir",


D'oh.
I looked up the paramtype2 line of my node definition in my code again and saw 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
          sounds = default.node_sound_wood_defaults(),
      paramtype = "light",
      paramtype2 == "facedir",
      on_construct = function(pos)
      ....


Obviosly, that comparision doesn't make for a proper paramtype ;)
I fixed that line, now it works like a charm.
I'm running 0.4.13 stable with [technic][carts][farming_plus][biome_lib][unified_inventory] and a few other mods.
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron