Post your modding questions here

Locked
User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

How do I go about creating "groups" of nodes? Like wood, stone, wool, etc.
Back from the dead!

1244
Member
Posts: 45
Joined: Fri Jul 13, 2012 16:40
Location: Poland

by 1244 » Post

Is possible to load chunk in given position?
My mods:
Barrels, Chemistry

Nore
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

I saw in IRC that it was possible with VoxelManipulator... However, I have no idea how to do it.

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

by PilzAdam » Post

1244 wrote:Is possible to load chunk in given position?
Just call read() of a VocelManipulator in the block.
Last edited by PilzAdam on Wed Jul 03, 2013 20:06, edited 1 time in total.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

How would I go about detecting whether fancy trees are enabled or not? (fyi, it doesn't have to be entirely in lua)
Back from the dead!

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

Evergreen wrote:How would I go about detecting whether fancy trees are enabled or not? (fyi, it doesn't have to be entirely in lua)

Code: Select all

if minetest.setting_getbool("new_style_leaves") then
  -- Do something here
end
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

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

by PilzAdam » Post

Evergreen wrote:How would I go about detecting whether fancy trees are enabled or not? (fyi, it doesn't have to be entirely in lua)
The drawtype "allfaces_optional" is only drawn as "allfaces" if fancy leaves are enabled, otherwise its drawn as a solid node.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

PilzAdam wrote:
Evergreen wrote:How would I go about detecting whether fancy trees are enabled or not? (fyi, it doesn't have to be entirely in lua)
The drawtype "allfaces_optional" is only drawn as "allfaces" if fancy leaves are enabled, otherwise its drawn as a solid node.
How would I detect that though? I'm planning on making different textures for when fancy trees are turned off.
Last edited by Evergreen on Sat Jul 06, 2013 11:05, edited 1 time in total.
Back from the dead!

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

by PilzAdam » Post

Evergreen wrote:
PilzAdam wrote:
Evergreen wrote:How would I go about detecting whether fancy trees are enabled or not? (fyi, it doesn't have to be entirely in lua)
The drawtype "allfaces_optional" is only drawn as "allfaces" if fancy leaves are enabled, otherwise its drawn as a solid node.
How would I detect that though? I'm planning on making different textures for when fancy trees are turned off.
kaeza wrote:

Code: Select all

if minetest.setting_getbool("new_style_leaves") then
  -- Do something here
end

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

Ah, I was looking at the minetest.conf, and changed fancy trees on and off, but nothing seemed to change in the conf file. I actually knew the code for getting a setting from the conf file, I was just confused that the new_style_leaves setting wasn't changing. Thanks though. :P
Back from the dead!

6r1d
New member
Posts: 1
Joined: Sun Jul 07, 2013 03:38

by 6r1d » Post

How do I delete nodes around moving object? For example, I want to program this object to remove coalblocks and cobblestones I've dropped.
I'm using "on_step" function.

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

by fairiestoy » Post

Hey guys.

Im playing minetest a few weeks now and was interested in learning a bit Lua and the minetest Lua API. But the starts also shows me an End for which i have a question for. Maybe im wrong, but for what i've read up to now, all Lua code is executed on server-side and the results are send to the connected client. I only wanted to make a little HUD element that only needs the local data of the client. Is it somehow possible that i am wrong and mods that only take local used data are also executed only local?

As explanation:
I want to make some kind of compass which shows up as a image in the HUD. It has to turn around according to the current YAW value of the user. The only data that is needed from the server once, is the position of possible 'important points' which will be shown as colored dots on the compass with the fitting direction of that destination. I came up with this idea since i saw very much especially new players who are not able of finding specific spots in the world. They just start running and end up in the big nowhere.
Im aware of the fact that i need more data from the server for the user location, but how should i refresh the compass without to heavy load on the server with globalstep?

Any help would be nice.

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

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

by Casimir » Post

6r1d wrote:[fullqoute]
This might help:

Code: Select all

    local objects = minetest.env:get_objects_inside_radius(pos, 0.5)
    for _, v in ipairs(objects) do
        if v:get_entity_name() == "gemalde:"..number.."" then
            v:remove()
        end
    end

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

by PilzAdam » Post

fairiestoy wrote:Hey guys.

Im playing minetest a few weeks now and was interested in learning a bit Lua and the minetest Lua API. But the starts also shows me an End for which i have a question for. Maybe im wrong, but for what i've read up to now, all Lua code is executed on server-side and the results are send to the connected client. I only wanted to make a little HUD element that only needs the local data of the client. Is it somehow possible that i am wrong and mods that only take local used data are also executed only local?

As explanation:
I want to make some kind of compass which shows up as a image in the HUD. It has to turn around according to the current YAW value of the user. The only data that is needed from the server once, is the position of possible 'important points' which will be shown as colored dots on the compass with the fitting direction of that destination. I came up with this idea since i saw very much especially new players who are not able of finding specific spots in the world. They just start running and end up in the big nowhere.
Im aware of the fact that i need more data from the server for the user location, but how should i refresh the compass without to heavy load on the server with globalstep?

Any help would be nice.

Greetings ... fairiestoy
Lua code always runs on the server, no chance to get it in the client.

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

I have a question about overlaying textures.
I'm aware you can overlay one texture with another such as stone and iron but is it possible to layer another animated texture over both of the previous ones I'm aware I could test this myself but I am away from my computer for a few weeks and I am programming on my phone.
Last edited by Chinchow on Sat Jul 13, 2013 06:49, edited 1 time in total.
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

User avatar
pandaro
Member
Posts: 327
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro
Location: behind

by pandaro » Post

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
Location: in the bin

by slenderman » Post

thanks

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

by ch98 » Post

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...

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.
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.

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

by ShadowNinja » Post

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.

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

by ch98 » Post

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.
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

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: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

Is it possible to put a modpack inside of other modpacks?
Back from the dead!

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

by ShadowNinja » Post

Evergreen wrote:Is it possible to put a modpack inside of other modpacks?
Yes, I have them nested to three of four levels.

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

by TeslaTest » Post

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: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

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.

Locked

Who is online

Users browsing this forum: No registered users and 4 guests