Page 1 of 2
Mineral Detector

Posted:
Thu Dec 22, 2011 18:56
by randomproof
When placed the mineral detector scans all the blocks around it and gives you an indication of how much iron, coal and mese is found. The face of the detector will show colored dots if any is found and when you hove the cursor over the block it will tell you exact amounts.
UPDATE:
- Changed textures to remove compass style
- Added variable range (each time placed node is punched it will cycle through min and max ranges, 4 to 12 for now)
Updated for code changes March 2012License: Public Domain
https://gitorious.org/randomproofs-minetest-mods/mineral_detector/commits/masterCraft Recipe:

Detector in action:


Posted:
Thu Dec 22, 2011 19:04
by sfan5
I like the mod!

Posted:
Thu Dec 22, 2011 19:53
by MrThebuilder3
wow:)

Posted:
Thu Dec 22, 2011 22:16
by Gatharoth
LOVE IT! This will help solve the rare iron problem XP All a person needs to do is get lucky and find 1 iron.

Posted:
Thu Dec 22, 2011 23:00
by mcburgerbob
Gatharoth wrote:LOVE IT! This will help solve the rare iron problem XP All a person needs to do is get lucky and find 1 iron.
no, they have to find all the iron to make the iron blocks!

Posted:
Thu Dec 22, 2011 23:21
by Gatharoth
mcburgerbob wrote:Gatharoth wrote:LOVE IT! This will help solve the rare iron problem XP All a person needs to do is get lucky and find 1 iron.
no, they have to find all the iron to make the iron blocks!
Yeah, wasn't paying too much attention to the materials needed ^^; I = failed

Posted:
Fri Dec 23, 2011 00:38
by randomproof
I wanted to make this a non-trivial device to make so it takes a lot of iron to make (think of it as the casing and the electronics/magnetics inside) and a sample of each of the ores to be found.
Of course, I could add a version that doesn't use steel blocks and just make it have a smaller range?

Posted:
Fri Dec 23, 2011 00:48
by sapier
what about making it smaler range and only supporting on specific ore?

Posted:
Fri Dec 23, 2011 00:54
by MrThebuilder3
aww i really wanted to use this but: 18:52:17: ERROR[main]: Error loading mod "randomproofs-minetest-mods-mineral_detector": modname does not follow naming conventions: Only chararacters [a-z0-9_] are allowed.
18:52:17: ERROR[main]: Server: Failed to load and run C:\Users\family\Desktop\m4\bin\..\data\mods\randomproofs-minetest-mods-mineral_detector\init.lua
BanManager: saving to C:\Users\family\Desktop\m4\bin\..\world\ipban.txt
AuthManager: saving to C:\Users\family\Desktop\m4\bin\..\world\auth.txt
18:52:17: ERROR[main]: ModError: Failed to load and run C:\Users\family\Desktop\m4\bin\..\data\mods\randomproofs-minetest-mods-mineral_detector\init.lua
18:52:17: ERROR[main]: error_message = ModError: Failed to load and run C:\Users\family\Desktop\m4\bin\..\data\mods\randomproofs-minetest-mods-mineral_detector\init.lua
18:52:17: ERROR[main]: Check debug.txt for details.
18:52:17: INFO[main]: Created main menu

Posted:
Fri Dec 23, 2011 00:57
by randomproof
UPDATE:
- Changed textures to remove compass style
- Added variable range (each time placed node is punched it will cycle through min and max ranges, 4 to 12 for now)

Posted:
Fri Dec 23, 2011 01:00
by randomproof
MrThebuilder3 wrote:aww i really wanted to use this but: 18:52:17: ERROR[main]: Error loading mod "randomproofs-minetest-mods-mineral_detector": modname does not follow naming conventions: Only chararacters [a-z0-9_] are allowed.
18:52:17: ERROR[main]: Server: Failed to load and run C:\Users\family\Desktop\m4\bin\..\data\mods\randomproofs-minetest-mods-mineral_detector\init.lua
BanManager: saving to C:\Users\family\Desktop\m4\bin\..\world\ipban.txt
AuthManager: saving to C:\Users\family\Desktop\m4\bin\..\world\auth.txt
18:52:17: ERROR[main]: ModError: Failed to load and run C:\Users\family\Desktop\m4\bin\..\data\mods\randomproofs-minetest-mods-mineral_detector\init.lua
18:52:17: ERROR[main]: error_message = ModError: Failed to load and run C:\Users\family\Desktop\m4\bin\..\data\mods\randomproofs-minetest-mods-mineral_detector\init.lua
18:52:17: ERROR[main]: Check debug.txt for details.
18:52:17: INFO[main]: Created main menu
If you are downloading the compressed archive you need to change the directory it is in to "mineral_detector", take out the "randomproofs-minetest-mods-" part. I need to look in to renaming all of my mods to match the default created directory, but that will most likely have to wait until tomorrow.

Posted:
Fri Dec 23, 2011 01:05
by randomproof
sapier wrote:what about making it smaler range and only supporting on specific ore?
I've thought of that and I will do that tomorrow. I've been thinking about how much info to give the player. I could go so far as to say how many ore blocks are at each range. I don't think it is good to give to much, though.

Posted:
Fri Dec 23, 2011 01:30
by MrThebuilder3
randomproof wrote:MrThebuilder3 wrote:aww i really wanted to use this but: 18:52:17: ERROR[main]: Error loading mod "randomproofs-minetest-mods-mineral_detector": modname does not follow naming conventions: Only chararacters [a-z0-9_] are allowed.
18:52:17: ERROR[main]: Server: Failed to load and run C:\Users\family\Desktop\m4\bin\..\data\mods\randomproofs-minetest-mods-mineral_detector\init.lua
BanManager: saving to C:\Users\family\Desktop\m4\bin\..\world\ipban.txt
AuthManager: saving to C:\Users\family\Desktop\m4\bin\..\world\auth.txt
18:52:17: ERROR[main]: ModError: Failed to load and run C:\Users\family\Desktop\m4\bin\..\data\mods\randomproofs-minetest-mods-mineral_detector\init.lua
18:52:17: ERROR[main]: error_message = ModError: Failed to load and run C:\Users\family\Desktop\m4\bin\..\data\mods\randomproofs-minetest-mods-mineral_detector\init.lua
18:52:17: ERROR[main]: Check debug.txt for details.
18:52:17: INFO[main]: Created main menu
If you are downloading the compressed archive you need to change the directory it is in to "mineral_detector", take out the "randomproofs-minetest-mods-" part. I need to look in to renaming all of my mods to match the default created directory, but that will most likely have to wait until tomorrow.
ok thanks:)

Posted:
Fri Dec 23, 2011 01:32
by MrThebuilder3
it works:D

Posted:
Fri Dec 23, 2011 08:06
by Calinou
Wow, I like it.
You should add some confirmation message when changing its range, too (if not done already.)

Posted:
Fri Dec 23, 2011 15:17
by randomproof
Calinou wrote:Wow, I like it.
You should add some confirmation message when changing its range, too (if not done already.)
The infotext was changed to have the range listed first before the amounts are listed.

Posted:
Wed Dec 28, 2011 16:49
by randomproof
Added coal detector, iron detector, and mese detector. Look in the init.lua file for the recipes.

Posted:
Wed Dec 28, 2011 19:00
by hurufu
I've got this message while trying to put detector on the ground.
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
19:54:34: ACTION[ServerThread]: hurufu places material 2086 at (-14,-4,-72)
terminate called after throwing an instance of 'LuaError'
what(): LuaError: error: ...test-0.4d/bin/../data/mods/mineral_detector/init.lua:504: attempt to index global 'node' (a nil value)
stack traceback:
Aborted

Posted:
Wed Dec 28, 2011 21:15
by randomproof
hurufu wrote:I've got this message while trying to put detector on the ground.
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
19:54:34: ACTION[ServerThread]: hurufu places material 2086 at (-14,-4,-72)
terminate called after throwing an instance of 'LuaError'
what(): LuaError: error: ...test-0.4d/bin/../data/mods/mineral_detector/init.lua:504: attempt to index global 'node' (a nil value)
stack traceback:
Aborted
My bad for not testing the way I should have.
I've uploaded the fix but here it is too:
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_on_placenode(
function(pos, newnode, placer)
if string.match(newnode.name, "mineral_detector:") ~= nil then
local meta = minetest.env:get_meta(pos)
meta:set_infotext("")
if newnode.name == "mineral_detector:detector" then
UpdateDetectorAll(pos, min_search_distance)
elseif newnode.name == "mineral_detector:iron_detector" then
UpdateDetectorIron(pos, min_search_distance)
elseif newnode.name == "mineral_detector:coal_detector" then
UpdateDetectorCoal(pos, min_search_distance)
elseif newnode.name == "mineral_detector:mese_detector" then
UpdateDetectorMese(pos, min_search_distance)
end
end
end
)

Posted:
Wed Dec 28, 2011 21:39
by hurufu
Now it works :)

Posted:
Mon Jan 02, 2012 05:42
by hmmm
I hate how ores don't touch each other. In minecraft, if I find one ore I've found all the ore in that small deposite of like 3-5 ore. In minetest, I have to dig blindly around the area I found the one ore and hope there's more ore there.

Posted:
Mon Jan 02, 2012 12:23
by sdzen
it adds to the challenge after all this one is supposed to take survival multiplayer in a new direction

Posted:
Tue Jan 24, 2012 16:40
by randomproof
Just pushed the update for the new code changes.

Posted:
Tue Jan 24, 2012 17:00
by kahrl
I see in the diff that you use dug_item, which doesn't work anymore (I think?). The field is now called drop, e.g.
drop = 'mineral_detector:detector 1'
and so on.

Posted:
Wed Jan 25, 2012 01:12
by randomproof
kahrl wrote:I see in the diff that you use dug_item, which doesn't work anymore (I think?). The field is now called drop, e.g.
drop = 'mineral_detector:detector 1'
and so on.
Thank you. Now fixed.

Posted:
Sun Feb 12, 2012 04:10
by csbeav
I get this error when trying to pick detector back up to relocate:
11:48:53: ERROR[ServerThread]: ERROR: An unhandled exception occurred: LuaError: error: /root/.minetest/usermods/mineral_detector/init.lua:476: attempt to call method 'get_wield_digging_properties' (a nil value)
11:48:53: ERROR[ServerThread]: stack traceback:
Touching it with an empty hand or tool causes the game to crash and close.

Posted:
Tue Feb 14, 2012 14:05
by maddogg
I get this error when trying to pick detector back up to relocate:
11:48:53: ERROR[ServerThread]: ERROR: An unhandled exception occurred: LuaError: error: /root/.minetest/usermods/mineral_detector/init.lua:476: attempt to call method 'get_wield_digging_properties' (a nil value)
11:48:53: ERROR[ServerThread]: stack traceback:
Touching it with an empty hand or tool causes the game to crash and close.
i get the same thing aswel

Posted:
Tue Feb 14, 2012 15:38
by randomproof
I pushed the update just now. The change is below if you don't want to pull it from git.
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_on_punchnode(function(pos, node, puncher)
if string.match(node.name, "mineral_detector:") ~= nil then
if puncher:get_wielded_item():get_tool_digging_properties().dt_crumbliness ~= -1 then
return
end
...

Posted:
Wed Feb 22, 2012 03:35
by csbeav
Thanks Randomproof,
I copied the text from your fix above and opened init.lua inside the ~/.minetest/usermods/mineral_detector directory, and pasted it at line 476 and forward. Now it works great. Great mod and hopefully we won't have to remove mountains to find the gold anymore. ;)

Posted:
Sat Aug 04, 2012 20:12
by marc
what is that brown lump and i have a weird tar.gz file!