Post your modding questions here

User avatar
Rui
Member
 
Posts: 255
Joined: Wed Oct 01, 2014 12:59
GitHub: Rui-Minetest

[DELETED]

by Rui » Tue May 05, 2015 03:14

[DELETED]
Last edited by Rui on Fri Nov 04, 2016 12:58, edited 2 times in total.
 

red
Member
 
Posts: 30
Joined: Sun May 03, 2015 08:18

Re: Post your modding questions here

by red » Tue May 05, 2015 07:12

How do you add nodes to a group if they already exist?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Tue May 05, 2015 08:17

red wrote:How do you add nodes to a group if they already exist?


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 data = minetest.registered_items[item]
   local g = {}
   if data.groups then
      for k, v in pairs(data.groups) do
         g[k] = v
      end
   end
   g["group_name"] = 1
   minetest.override_item(item, {groups = g})


WTFPL, for you.

Based off of here: https://github.com/rubenwardy/food/blob ... ua#L54-L61
 

minetestcr
Member
 
Posts: 57
Joined: Fri Feb 13, 2015 21:31

Re: Post your modding questions here

by minetestcr » Tue May 05, 2015 13:48

Don wrote:Just add "static_spawnpoint = 0,0,0" to your mintest.conf


Hello Don... thanks, I tried this but it did not work. Each user spawned in a different point.

How do people that run servers to set the spawn point?

Also, why users can kill each other if I disabled Damage?

thanks again
 

User avatar
Rui
Member
 
Posts: 255
Joined: Wed Oct 01, 2014 12:59
GitHub: Rui-Minetest

[DELETED]

by Rui » Wed May 06, 2015 13:48

[DELETED]
Last edited by Rui on Fri Nov 04, 2016 12:59, edited 2 times in total.
 

minetestcr
Member
 
Posts: 57
Joined: Fri Feb 13, 2015 21:31

Re: Post your modding questions here

by minetestcr » Fri May 08, 2015 18:44

minetestcr wrote:
Don wrote:Just add "static_spawnpoint = 0,0,0" to your mintest.conf


Hello Don... thanks, I tried this but it did not work. Each user spawned in a different point.

How do people that run servers to set the spawn point?

Also, why users can kill each other if I disabled Damage?

thanks again


the static_spawnpoint started working after a couple of reboots on the pc.

I still need to know how to disable users killing each other....
thanks
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Fri May 08, 2015 20:55

minetestcr wrote:
minetestcr wrote:
Don wrote:Just add "static_spawnpoint = 0,0,0" to your mintest.conf


Hello Don... thanks, I tried this but it did not work. Each user spawned in a different point.

How do people that run servers to set the spawn point?

Also, why users can kill each other if I disabled Damage?

thanks again


the static_spawnpoint started working after a couple of reboots on the pc.

I still need to know how to disable users killing each other....
thanks

Maybe try upgrading. These are things that should just work. It is strange that they don't.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

Ivà
Member
 
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua

Re: Post your modding questions here

by Ivà » Sat May 09, 2015 06:53

minetestcr wrote:I still need to know how to disable users killing each other....
thanks


In minetest.conf you'll find this option:
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
#    Whether to enable players killing each other
#enable_pvp = true


Modify it to:
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
#    Whether to enable players killing each other
enable_pvp = false
 

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 » Sat May 09, 2015 12:21

Rui wrote:If Formspec has been removed by death, what is returned?

Screw this damned Google mistranslator
 

TeTpaAka
Member
 
Posts: 131
Joined: Sat Dec 28, 2013 21:54

Re: Post your modding questions here

by TeTpaAka » Sat May 09, 2015 21:19

Is there a way to get the time from the last use of a tool in on_use? I want to make a tool that needs a cool down before it can be used again. I know, I could use minetest.get_us_time() and compare it with a saved value, but is there an easier way?
 

red
Member
 
Posts: 30
Joined: Sun May 03, 2015 08:18

Re: Post your modding questions here

by red » Sun May 10, 2015 16:09

Is there any explanation of formspecs that doesn't leave you more confused then before?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Sun May 10, 2015 16:59

red wrote:Is there any explanation of formspecs that doesn't leave you more confused then before?


Have you read this? http://rubenwardy.com/minetest_modding_ ... specs.html
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

Re: Post your modding questions here

by DeepGaze » Sun May 10, 2015 17:33

Can I set a value via chat command for a block to use as a teleport point when a player is stood inside?
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: Post your modding questions here

by prestidigitator » Mon May 11, 2015 04:45

TeTpaAka wrote:Is there a way to get the time from the last use of a tool in on_use? I want to make a tool that needs a cool down before it can be used again. I know, I could use minetest.get_us_time() and compare it with a saved value, but is there an easier way?

Sure. Store it in the metadata of the tool's ItemStack (the metadata for an ItemStack is just a string, so you might need to serialize things that don't have a simple string representation).
 

TeTpaAka
Member
 
Posts: 131
Joined: Sat Dec 28, 2013 21:54

Re: Post your modding questions here

by TeTpaAka » Mon May 11, 2015 12:45

prestidigitator wrote:
TeTpaAka wrote:Is there a way to get the time from the last use of a tool in on_use? I want to make a tool that needs a cool down before it can be used again. I know, I could use minetest.get_us_time() and compare it with a saved value, but is there an easier way?

Sure. Store it in the metadata of the tool's ItemStack (the metadata for an ItemStack is just a string, so you might need to serialize things that don't have a simple string representation).

That is what I described. So I have to store the time of the last use and compare them with the current time.
I was thinking, there could be an easier way because the normal damage handling uses the full_punch_interval to influence the amount of damage.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: Post your modding questions here

by prestidigitator » Mon May 11, 2015 20:42

TeTpaAka wrote:So I have to store the time of the last use and compare them with the current time.
I was thinking, there could be an easier way because the normal damage handling uses the full_punch_interval to influence the amount of damage.


Unfortunately damage is completely handled by the engine, with almost zero control or visibility from Lua. You can set damage properties when you register the tool, and that's basically it. You also can't partially override the functionality or add to it. If you do, the default damage mechanism is lost.
 

TeTpaAka
Member
 
Posts: 131
Joined: Sat Dec 28, 2013 21:54

Re: Post your modding questions here

by TeTpaAka » Mon May 11, 2015 21:15

prestidigitator wrote:
TeTpaAka wrote:So I have to store the time of the last use and compare them with the current time.
I was thinking, there could be an easier way because the normal damage handling uses the full_punch_interval to influence the amount of damage.


Unfortunately damage is completely handled by the engine, with almost zero control or visibility from Lua. You can set damage properties when you register the tool, and that's basically it. You also can't partially override the functionality or add to it. If you do, the default damage mechanism is lost.

That's sad to hear, but it was suspected. I did barely hope there was an easy way.
Thank you, anyway.
 

User avatar
Rui
Member
 
Posts: 255
Joined: Wed Oct 01, 2014 12:59
GitHub: Rui-Minetest

[DELETED]

by Rui » Tue May 12, 2015 09:03

[DELETED]
Last edited by Rui on Fri Nov 04, 2016 13:00, edited 1 time in total.
 

Dr. Console
New member
 
Posts: 4
Joined: Sat Jan 17, 2015 16:12

Re: Post your modding questions here

by Dr. Console » Wed May 13, 2015 10:24

Can someone give me an example of how to use NodeMetaRef ?
E.g. if I have a node which holds a value caled test... ?
Didn't understand the article in the devWiki.

NG
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: Post your modding questions here

by Krock » Wed May 13, 2015 16:28

Dr. Console wrote:E.g. if I have a node which holds a value caled test... ?

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("foo:bar_node", {
   <some node definitions>
   on_construct = function(pos)
      local meta = minetest.get_meta(pos)
      meta:set_string("infotext", "Hello, I'm a visible meta string!")
      meta:set_string("test", "AB and C are the first letters of the alphabeth")
      minetest.log("action", "I've set test to: ".. meta:get_string("test"))
   end
}
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

red
Member
 
Posts: 30
Joined: Sun May 03, 2015 08:18

Re: Post your modding questions here

by red » Wed May 13, 2015 17:47

rubenwardy wrote:
red wrote:Is there any explanation of formspecs that doesn't leave you more confused then before?


Have you read this? http://rubenwardy.com/minetest_modding_ ... specs.html


Thanks. I think I understand formspecs now.
 

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 May 14, 2015 15:11

How do I enable TNT in multiplayer?
 

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 May 14, 2015 15:13

How do I make a node that can be placed on protected areas?
 

red
Member
 
Posts: 30
Joined: Sun May 03, 2015 08:18

Re: Post your modding questions here

by red » Thu May 14, 2015 16:31

Is there a maxium amount of metadata a node can hold?
 

Nubm
Member
 
Posts: 20
Joined: Thu Nov 20, 2014 09:33

Re: Post your modding questions here

by Nubm » Fri May 15, 2015 18:13

Hello!

I made a simple wodden bridge, several nodes long, using nodebox. Works fine with 3 nodes in lenght, but when i increase the size to 4 nodes i fall through the 4th node.
I used multiple nodes in lenght to have some variation in the planks size (as shown in the attached image).

Or is it possible to create multible nodebox models and pick a random one on build? My workaround so far was to create multiple nodes with some variations and cycle through them with crafting (e.g. bridge1 in hte crafting window turns into bridge2, bridge2 into bridge3, and bridge3 into bridge1 again).

Thanks for any help!
Attachments
minetest_bridge.jpg
minetest_bridge.jpg (597.92 KiB) Viewed 3371 times
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Fri May 15, 2015 18:51

there's another bridges mod viewtopic.php?id=3488
 

Nubm
Member
 
Posts: 20
Joined: Thu Nov 20, 2014 09:33

Re: Post your modding questions here

by Nubm » Fri May 15, 2015 19:53

Hybrid Dog wrote:there's another bridges mod viewtopic.php?id=3488


Thanks, looks nice.
However, didn't answer my questions tho: Why do i fall through the 4th node of my bridge, and can i place nodebox blocks randomly selected from a list? My goal is to create variations in the pattern of the bridge without the need for crafting and placing multiple nodes (which would work fine, so does the 3 node bridge).
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Fri May 15, 2015 20:03

I am working on updating mydeck. I want to make the stain brush wear out but I have not done much with tools. I am not sure how to do this.

What would be the best way to make it wear out?
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

TeTpaAka
Member
 
Posts: 131
Joined: Sat Dec 28, 2013 21:54

Re: Post your modding questions here

by TeTpaAka » Fri May 15, 2015 21:31

Don wrote:I am working on updating mydeck. I want to make the stain brush wear out but I have not done much with tools. I am not sure how to do this.

What would be the best way to make it wear out?

Take a look at the screwdriver mod:
https://github.com/minetest/minetest_ga ... it.lua#L81

Also you probably should probably check only once for the wielditem and not for every node. So, there is one if with the wielditem check that is around the other checks. (Hope this is clear)
Maybe you should consider using minetest.register_tool and using the on_use callback. Then you can omit the check for the wielditem.
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Fri May 15, 2015 21:57

Thank you. I will do that.
I appreciate your suggestion and welcome any other suggestions or comments you may have.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 10 guests

cron