Mineral Detector

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

Mineral Detector

by randomproof » Thu Dec 22, 2011 18:56

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 2012

License: Public Domain

https://gitorious.org/randomproofs-minetest-mods/mineral_detector/commits/master

Craft Recipe:
Image

Detector in action:
Image
Last edited by randomproof on Mon Mar 19, 2012 23:09, edited 1 time in total.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Thu Dec 22, 2011 19:04

I like the mod!
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
MrThebuilder3
Member
 
Posts: 104
Joined: Sat Nov 19, 2011 18:26

by MrThebuilder3 » Thu Dec 22, 2011 19:53

wow:)
 

Gatharoth
Member
 
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Thu Dec 22, 2011 22:16

LOVE IT! This will help solve the rare iron problem XP All a person needs to do is get lucky and find 1 iron.
 

mcburgerbob
Member
 
Posts: 141
Joined: Wed Dec 14, 2011 19:50

by mcburgerbob » Thu Dec 22, 2011 23:00

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!
MY CAKE!
 

Gatharoth
Member
 
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Thu Dec 22, 2011 23:21

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
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Fri Dec 23, 2011 00:38

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?
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Fri Dec 23, 2011 00:48

what about making it smaler range and only supporting on specific ore?
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
MrThebuilder3
Member
 
Posts: 104
Joined: Sat Nov 19, 2011 18:26

by MrThebuilder3 » Fri Dec 23, 2011 00:54

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
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Fri Dec 23, 2011 00:57

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)
Last edited by randomproof on Fri Dec 23, 2011 00:57, edited 1 time in total.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Fri Dec 23, 2011 01:00

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.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Fri Dec 23, 2011 01:05

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.
Last edited by randomproof on Fri Dec 23, 2011 01:05, edited 1 time in total.
 

User avatar
MrThebuilder3
Member
 
Posts: 104
Joined: Sat Nov 19, 2011 18:26

by MrThebuilder3 » Fri Dec 23, 2011 01:30

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:)
 

User avatar
MrThebuilder3
Member
 
Posts: 104
Joined: Sat Nov 19, 2011 18:26

by MrThebuilder3 » Fri Dec 23, 2011 01:32

it works:D
 

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

by Calinou » Fri Dec 23, 2011 08:06

Wow, I like it.
You should add some confirmation message when changing its range, too (if not done already.)
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Fri Dec 23, 2011 15:17

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.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Wed Dec 28, 2011 16:49

Added coal detector, iron detector, and mese detector. Look in the init.lua file for the recipes.
 

hurufu
Member
 
Posts: 21
Joined: Sat Dec 24, 2011 18:52

by hurufu » Wed Dec 28, 2011 19:00

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
Last edited by hurufu on Wed Dec 28, 2011 19:01, edited 1 time in total.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Wed Dec 28, 2011 21:15

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
)
 

hurufu
Member
 
Posts: 21
Joined: Sat Dec 24, 2011 18:52

by hurufu » Wed Dec 28, 2011 21:39

Now it works :)
 

hmmm
Member
 
Posts: 69
Joined: Sun Aug 07, 2011 17:49

by hmmm » Mon Jan 02, 2012 05:42

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.
 

User avatar
sdzen
Member
 
Posts: 1170
Joined: Fri Aug 05, 2011 22:33

by sdzen » Mon Jan 02, 2012 12:23

it adds to the challenge after all this one is supposed to take survival multiplayer in a new direction
[h]Zen S.D.[/h] The next generation of tranquility!
malheureusement mon français n'est pas bon :<
Owner of the Zelo's
In game name: MuadTralk, spdtainted, sdzen, sd zen, sdzeno
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Tue Jan 24, 2012 16:40

Just pushed the update for the new code changes.
 

kahrl
Member
 
Posts: 236
Joined: Fri Sep 02, 2011 07:51

by kahrl » Tue Jan 24, 2012 17:00

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.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Wed Jan 25, 2012 01:12

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.
 

User avatar
csbeav
New member
 
Posts: 9
Joined: Sun Feb 05, 2012 02:36

by csbeav » Sun Feb 12, 2012 04:10

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.
 

maddogg
Member
 
Posts: 27
Joined: Wed Dec 21, 2011 23:55

by maddogg » Tue Feb 14, 2012 14:05

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
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Tue Feb 14, 2012 15:38

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

User avatar
csbeav
New member
 
Posts: 9
Joined: Sun Feb 05, 2012 02:36

by csbeav » Wed Feb 22, 2012 03:35

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

marc
 

by marc » Sat Aug 04, 2012 20:12

what is that brown lump and i have a weird tar.gz file!
 

Next

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 38 guests

cron