Mineral Detector

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

Mineral Detector

by randomproof » Post

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-mine ... its/master

Craft Recipe:
Image

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

sfan5
Moderator
Posts: 4095
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

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 » Post

wow:)

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

by Gatharoth » Post

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
Location: B.C Canada

by mcburgerbob » Post

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 » Post

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
Location: California, USA

by randomproof » Post

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
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Post

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 » Post

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
Location: California, USA

by randomproof » Post

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
Location: California, USA

by randomproof » Post

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
Location: California, USA

by randomproof » Post

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 » Post

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 » Post

it works:D

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

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
Location: California, USA

by randomproof » Post

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
Location: California, USA

by randomproof » Post

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 » Post

I've got this message while trying to put detector on the ground.

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
Location: California, USA

by randomproof » Post

hurufu wrote:I've got this message while trying to put detector on the ground.

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:

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 » Post

Now it works :)

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

by hmmm » Post

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
Location: Paradise (your not allowed)

by sdzen » Post

it adds to the challenge after all this one is supposed to take survival multiplayer in a new direction

Zen S.D.

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
Location: California, USA

by randomproof » Post

Just pushed the update for the new code changes.

kahrl
Member
Posts: 236
Joined: Fri Sep 02, 2011 07:51
Location: Rös̓̇chenhof

by kahrl » Post

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
Location: California, USA

by randomproof » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests