Post your modding questions here
- 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
@BrunoMine: #players doesn't work with such tables. Count the players in the for thing.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)
-
- Member
- Posts: 3015
- Joined: Sun Jan 18, 2015 13:02
- GitHub: ABJ-MV
- In-game: ABJ
- Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.
Re: Post your modding questions here
How do I create something that runs as long as a block exists but disappears when it is dug? EG: smoke for fire.
- BrunoMine
- Member
- Posts: 1082
- Joined: Thu Apr 25, 2013 17:29
- GitHub: BrunoMine
- Location: SP-Brasil
- Contact:
Re: Post your modding questions here
I am not able to use the dsdsds method. minetest.rollback_get_node_actions.
Results:
What is wrong?
EDIT:
I forgot to enable it in minetest.conf
SOLVED!
Code: Select all
minetest.register_on_dignode(function(pos, oldnode, digger)
local rollback = minetest.rollback_get_node_actions(
pos, -- pos
10, -- range
5, -- seconds
5 -- limit
) or {}
minetest.chat_send_all(table.maxn(rollback).." actions")
end)
Code: Select all
0 actions
0 actions
0 actions
...
EDIT:
I forgot to enable it in minetest.conf
SOLVED!
Last edited by BrunoMine on Tue Feb 07, 2017 16:29, edited 2 times in total.
- BrunoMine
- Member
- Posts: 1082
- Joined: Thu Apr 25, 2013 17:29
- GitHub: BrunoMine
- Location: SP-Brasil
- Contact:
Re: Post your modding questions here
Have you tried an ABM?ABJ wrote:How do I create something that runs as long as a block exists but disappears when it is dug? EG: smoke for fire.
This allows you to execute a function repeatedly while a node is active.
- 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
An abm wouldn't make much sense here.BrunoMine wrote:Have you tried an ABM?ABJ wrote:How do I create something that runs as long as a block exists but disappears when it is dug? EG: smoke for fire.
This allows you to execute a function repeatedly while a node is active.
on_construct: Add a particlespawner in a variable (bla = minetest.add_particlespawner(particlespawner definition)) and store this variable somewhere, like in metadata.
on_destruct: Get this variable and remove the particlespawner again.
api:
particlespawner
on_construct and destruct
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)
Re: Post your modding questions here
The documentation says, that get_node_timer accepts fractional values. But this code doesn't work. I only get full seconds
What's wrong? The documentation, the function or I?
Code: Select all
minetest.get_node_timer(leaves_near[i]):start(math.random() * 10.0)
- 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
The documentation, I think. Mesecons pressure plates also only work at an 1s interval.
- 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
Particle spawners get removed when the block is unloaded I think. Use LBM to spawn it again.DS-minetest wrote:An abm wouldn't make much sense here.BrunoMine wrote:Have you tried an ABM?ABJ wrote:How do I create something that runs as long as a block exists but disappears when it is dug? EG: smoke for fire.
This allows you to execute a function repeatedly while a node is active.
on_construct: Add a particlespawner in a variable (bla = minetest.add_particlespawner(particlespawner definition)) and store this variable somewhere, like in metadata.
on_destruct: Get this variable and remove the particlespawner again.
api:
particlespawner
on_construct and destruct
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: Post your modding questions here
burli wrote:The documentation says, that get_node_timer accepts fractional values. But this code doesn't work. I only get full seconds
What's wrong? The documentation, the function or I?Code: Select all
minetest.get_node_timer(leaves_near[i]):start(math.random() * 10.0)
There's a setting which makes this run faster. By default it only runs once a second
- GreenXenith
- Member
- Posts: 1356
- Joined: Wed Oct 28, 2015 01:26
- GitHub: GreenXenith
- Location: UTC-8:00
- Contact:
Re: Post your modding questions here
How do I make items spawn in a certain area?
Explain:
I have block A and block B.
bA and bB form opposite corners of a cubic area.
I want a certain item to spawn anywhere in that area at a certain rate (appear and fall to the floor).
How do I do this (needs to be according to bA and BB so the area can be however I want)?
Explain:
I have block A and block B.
bA and bB form opposite corners of a cubic area.
I want a certain item to spawn anywhere in that area at a certain rate (appear and fall to the floor).
How do I do this (needs to be according to bA and BB so the area can be however I want)?
YouTube | Mods | Patreon | Minetest Discord @greenxenith
You should not be able to read this message.
You should not be able to read this message.
-
- Member
- Posts: 3015
- Joined: Sun Jan 18, 2015 13:02
- GitHub: ABJ-MV
- In-game: ABJ
- Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.
Re: Post your modding questions here
How do I make something that gets created with a block and deleted with it?
- GreenXenith
- Member
- Posts: 1356
- Joined: Wed Oct 28, 2015 01:26
- GitHub: GreenXenith
- Location: UTC-8:00
- Contact:
Re: Post your modding questions here
Another question: Is it possible to use items as buttons in a custom chest?
Explain:
Have a chest with 2 items.
Click/select an item and it takes you to another "page" in the chest.
In that "page", have a "back" item so when pressed takes you back to main "page".
Explain:
Have a chest with 2 items.
Click/select an item and it takes you to another "page" in the chest.
In that "page", have a "back" item so when pressed takes you back to main "page".
YouTube | Mods | Patreon | Minetest Discord @greenxenith
You should not be able to read this message.
You should not be able to read this message.
- 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 can add image buttons that look like the item. (item_image_button[])
- Hybrid Dog
- Member
- Posts: 2836
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
-
- Member
- Posts: 180
- Joined: Wed Oct 07, 2015 20:59
- In-game: ozkur or XoRoUZ
- Location: 6 minutes in the future
Re: Post your modding questions here
Sorry that this is the derpiest of all derpy and stupid questions:
How do I upload a mod to the forums?
How do I upload a mod to the forums?
Biplanes! 'Nuff said
I am a native English speaker, Ich spreche kein Deuscht, mais je parle un pue français.
I am a native English speaker, Ich spreche kein Deuscht, mais je parle un pue français.
- Hybrid Dog
- Member
- Posts: 2836
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
- BrunoMine
- Member
- Posts: 1082
- Joined: Thu Apr 25, 2013 17:29
- GitHub: BrunoMine
- Location: SP-Brasil
- Contact:
Re: Post your modding questions here
Hello guys.
I'm having trouble for detect objects in an area. I have used the minetest.get_objects_inside_radius method, but it does not work correctly. Sometimes it does not work, usually when I'm at a disancia of approximately 20 blocks.
Is there any more consistent way to perform this verification?
I'm having trouble for detect objects in an area. I have used the minetest.get_objects_inside_radius method, but it does not work correctly. Sometimes it does not work, usually when I'm at a disancia of approximately 20 blocks.
Is there any more consistent way to perform this verification?
-
- Member
- Posts: 180
- Joined: Wed Oct 07, 2015 20:59
- In-game: ozkur or XoRoUZ
- Location: 6 minutes in the future
Re:
Thanks for trying, but I still am confused.Hybrid Dog wrote:ozkur, there are lots of ways to upload a mod, e.g. here's the init.lua of my version of the drippingwater mod as png:
(it's grey because ascii)
Are you saying I do something like turn the entire folder into a .png file?
Biplanes! 'Nuff said
I am a native English speaker, Ich spreche kein Deuscht, mais je parle un pue français.
I am a native English speaker, Ich spreche kein Deuscht, mais je parle un pue français.
- kaeza
- Moderator
- Posts: 2162
- Joined: Thu Oct 18, 2012 05:00
- GitHub: kaeza
- IRC: kaeza diemartin blaaaaargh
- In-game: kaeza
- Location: Montevideo, Uruguay
- Contact:
Re: Post your modding questions here
Use an archiving program(*) to compress your folder in a ZIP file, create a new topic for it in the WIP Mods subforum(**), and upload the ZIP file as an attachment ("Upload attachment" tab under the posting text box).ozkur wrote:Sorry that this is the derpiest of all derpy and stupid questions:
How do I upload a mod to the forums?
(*) Windows comes with support to compress folders, or you can use an external program like 7-zip.
(**) See also the guidelines for mod releases.
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
Check out my stuff! | Donations greatly appreciated! PayPal
-
- Member
- Posts: 180
- Joined: Wed Oct 07, 2015 20:59
- In-game: ozkur or XoRoUZ
- Location: 6 minutes in the future
Re: Post your modding questions here
Thanks!kaeza wrote:Use an archiving program(*) to compress your folder in a ZIP file, create a new topic for it in the WIP Mods subforum(**), and upload the ZIP file as an attachment ("Upload attachment" tab under the posting text box).ozkur wrote:Sorry that this is the derpiest of all derpy and stupid questions:
How do I upload a mod to the forums?
(*) Windows comes with support to compress folders, or you can use an external program like 7-zip.
(**) See also the guidelines for mod releases.
Biplanes! 'Nuff said
I am a native English speaker, Ich spreche kein Deuscht, mais je parle un pue français.
I am a native English speaker, Ich spreche kein Deuscht, mais je parle un pue français.
- Hybrid Dog
- Member
- Posts: 2836
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: Post your modding questions here
BrunoMine, you can only get active objects. Maybe you need to forceload some chunks.
- 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
Are you scanning for objects that your mod defines? Then let them save their last active position in a table and just search this yourself. Then just forceload that area(*)Hybrid Dog wrote:BrunoMine, you can only get active objects. Maybe you need to forceload some chunks.
#screwminetestsbuggyobjectmanagementsystem
To work consistently, that table has to be saved on shutdown.
(*) use that forceload anchors library, it handles forceloads better than minetest's internal.
Re: Post your modding questions here
How can I place a locked chest and a key to unlock to a map from a script?
- GreenXenith
- Member
- Posts: 1356
- Joined: Wed Oct 28, 2015 01:26
- GitHub: GreenXenith
- Location: UTC-8:00
- Contact:
Re: Post your modding questions here
I seem to be having trouble with registering 2 'on_punch' to the same node.
This is only one example of what I have tried. In this particular case, only the first function happens. Other times it was just the latter. I want both to happen. How do I do this?
Code: Select all
on_punch = function(pos, node, player, pointed_thing)
local inv = player:get_inventory()
inv:add_item("main", "modname:node")
on_punch = function(pos, node, puncher, pointed_thing)
minetest.set_node(pos, {name = "modename:othernode", param2 = node.param2})
end
end
YouTube | Mods | Patreon | Minetest Discord @greenxenith
You should not be able to read this message.
You should not be able to read this message.
Who is online
Users browsing this forum: No registered users and 7 guests