Page 1 of 2

[Mod] Night Vision Goggles! See Day In The Dark! [4.1] [night_vision]

PostPosted: Tue Jan 01, 2013 00:34
by Aqua
Image
Happy New Year Everyone!! Best wishes for 2013!! This adds Night Vision Goggles as requested by Josh! This will be my last mod! This is also a revamped and improved version of Echo's Walking Light! I need better crafting recipes, will accept better ones!

BE A SAM FISHER FROM SPLINTER CELL WITH THESE AWESOME NIGHT VISION GOGGLES!
Image

Features:
-No more torches!
-You can see in the dark using these awesome Night Vision Goggles!
-Now you don't need to hold it just have it in your first 8 slots to make light(Thanks to RealBadAngel)! Also light increased!

Crafting:
SUGGEST BETTER RECIPES!
4.1:
Image
4.0:
Image
3.0 and lower:
Image

Omploader:
Download 1.0.zip Initial Release
Download 2.0.zip No need to hold Night Vision Goggles(Thanks to RealBadAngel)! Also light increased!
Download 3.0.zip NO MORE FLYING COBBLE AND GLITCHES! I registered a new node with an invisible texture...Also changed name to "night_vision"! Less buggy code!
Download 4.0.zip New texture(more like Sam Fisher's thanks to Josh)! Light increased! Power decreased! New crafting! Smaller file size(4KB).
Download 4.1.zip New crafting!

Code: WTFPL
Textures: WTFPL

NOTE: Currently it is using code from Echo's Walking Light Mod. I am making my own code right now instead of using his.

Screenshots:

4.0 and higher:
Image

Image

3.0 and lower:
Image

Image

Before
Image

After
Image

PostPosted: Tue Jan 01, 2013 00:38
by davidpace
Nicey! +1

PostPosted: Tue Jan 01, 2013 00:44
by Chinchow
No why your last mod and that texture looks like a butterfly
Great mod btw

PostPosted: Tue Jan 01, 2013 00:51
by Aqua
Chinchow wrote:No why your last mod and that texture looks like a butterfly
Great mod btw


So many people says it looks like a butterfly, lol.
And it is my last mod because I'm going to take a long break from minetest.

PostPosted: Tue Jan 01, 2013 01:03
by Chinchow
Oh well be sure to come back

PostPosted: Tue Jan 01, 2013 02:03
by cornellius
Sorry To Say This Maybe Night Vision Goggles need more light when used thank you
one more when we use it maybe it we can see heat signature

PostPosted: Tue Jan 01, 2013 02:05
by jojoa1997
cornellius wrote:Sorry To Say This Maybe Night Vision Goggles need more light when used thank you

yes make the light 15

PostPosted: Tue Jan 01, 2013 02:24
by Josh
Yes!!!!!!!!!!!!!!!! Now i can be Sam Fisher :) +30
I see you took a look at my idea!

PostPosted: Tue Jan 01, 2013 04:02
by Aqua
jojoa1997 wrote:
cornellius wrote:Sorry To Say This Maybe Night Vision Goggles need more light when used thank you

yes make the light 15

Uh, the maximum for light_source is 14... But I will make an alternate one with higher light if you want..

PostPosted: Tue Jan 01, 2013 04:05
by jojoa1997
ok thanks and you can set light to 15. it works this way for me

PostPosted: Tue Jan 01, 2013 07:44
by Mito551
uhmm, i don't want to seem to be rude but something like this has been done before, hasn't it?
http://minetest.net/forum/viewtopic.php?id=2621

PostPosted: Tue Jan 01, 2013 07:49
by Chinchow
It would be cool if we didn't need to hold the goggles so we can do other things

PostPosted: Tue Jan 01, 2013 08:34
by RealBadAngel
Chinchow wrote:It would be cool if we didn't need to hold the goggles so we can do other things


local hotbar=inv:get_list("main")
for index=1,8,1 do

if hotbar[index]:get_name() ==

just use this to check if item is put on the hotbar (first 8 inventory slots). Then it hasnt to be wielded.

PostPosted: Tue Jan 01, 2013 08:59
by Jeija
Mito551 wrote:uhmm, i don't want to seem to be rude but something like this has been done before, hasn't it?
http://minetest.net/forum/viewtopic.php?id=2621


But there are no similarities in the code... Wait, what??
Walking light:
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
    if wielded_item ~= "default:torch" and wielded_item ~= "walking_light:pick_mese" then
        -- Neuberechnung des Lichts erzwingen
        minetest.env:add_node(rounded_pos,{type="node",name="default:cobble"})
        minetest.env:add_node(rounded_pos,{type="node",name="air"})
    end

Night goggles:
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
    if wielded_item ~= "night_goggles:night_vision_goggles" then
        minetest.env:add_node(rounded_pos,{type="node",name="default:cobble"})
        minetest.env:add_node(rounded_pos,{type="node",name="air"})
    end

Caught you! Why would you put "type=node"?

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
    player_positions[player_name]["x"] = rounded_pos.x;
    player_positions[player_name]["y"] = rounded_pos.y;
    player_positions[player_name]["z"] = rounded_pos.z;

Also is just the same in your code. You cannot have written that from scratch, noone would randomly use such a strange construction if he didn't just copypaste it.
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.env:add_node(old_pos,{type="node",name="default:cobble"})
minetest.env:add_node(old_pos,{type="node",name="air"})

That doesn't even make sense, but you copied it. You could have used dig_node or remove_node instead I guess.
Basically the whole code is copied,

I know, walking light's license is WTFPL and you are allowed copy it, but you should give credit, that's good manner. I'm sure you can do better than just stealing other people's work.

PostPosted: Tue Jan 01, 2013 09:03
by Aqua
Mito551 wrote:uhmm, i don't want to seem to be rude but something like this has been done before, hasn't it?
http://minetest.net/forum/viewtopic.php?id=2621

Yes I know, but that was being buried in the forums(on page 6 of mod releases) so I wanted to remake it and improve on it(revamp)!

PostPosted: Tue Jan 01, 2013 09:08
by Aqua
Jeija wrote:(...)

Your right Jeija, I'm starting this from scratch and writing my own code. I was just trying to revive Echo's Walking Light in a different way.

PostPosted: Tue Jan 01, 2013 09:24
by Aqua
RealBadAngel wrote:
Chinchow wrote:It would be cool if we didn't need to hold the goggles so we can do other things


local hotbar=inv:get_list("main")
for index=1,8,1 do

if hotbar[index]:get_name() ==

just use this to check if item is put on the hotbar (first 8 inventory slots). Then it hasnt to be wielded.

Where do I put this?

PostPosted: Tue Jan 01, 2013 11:33
by RealBadAngel
Aqua wrote:
RealBadAngel wrote:
Chinchow wrote:It would be cool if we didn't need to hold the goggles so we can do other things


local hotbar=inv:get_list("main")
for index=1,8,1 do

if hotbar[index]:get_name() ==

just use this to check if item is put on the hotbar (first 8 inventory slots). Then it hasnt to be wielded.

Where do I put this?


make a function like this:

function check_for_googles (player)
if player==nil then return false end
local inv = player:get_inventory()
local hotbar=inv:get_list("main")
for index=1,8,1 do
if hotbar[index]:get_name() == "night_goggles:night_vision_goggles" then
return "night_goggles:night_vision_goggles"
end
end
return false
end

and replace:
local wielded_item = player:get_wielded_item():get_name()
with:
local wielded_item = check_for_googles(player)

PostPosted: Tue Jan 01, 2013 11:36
by Aqua
Works great! Thank you!

PostPosted: Tue Jan 01, 2013 11:42
by Aqua
Josh wrote:Yes!!!!!!!!!!!!!!!! Now i can be Sam Fisher :) +30
I see you took a look at my idea!

Cool I'll try to make the textures more like Sam's..!

Version 2.0 released!
New features:
-No need to hold just have it in your first 8 slots!(Thanks to RealBadAngel)!
-Light increased!

PostPosted: Tue Jan 01, 2013 12:03
by Aqua
@Jeija I am writing my own code...
But I have a question:
Can abm be used with a craftitem? If not is it possible to make it so?

EDIT: dig_node and remove_node don't work..

PostPosted: Wed Jan 02, 2013 02:00
by Aqua
Request move to mod releases!

PostPosted: Wed Jan 02, 2013 09:15
by Aqua
cornellius wrote:Sorry To Say This Maybe Night Vision Goggles need more light when used thank you
one more when we use it maybe it we can see heat signature


Nice Idea!

Version 3 Released:
-NO MORE FLYING COBBLE AND GLITCHES!! I registered a new node with an invisible texture!!
-Less buggy and faster code!

PostPosted: Wed Jan 02, 2013 13:52
by Dopium
Nice mod! Installed on singleplayer and it works very well, very interesting

PostPosted: Wed Jan 02, 2013 19:32
by nomohakon
Night vision enhances all light it catches, so this is more like cheap key-light.

PostPosted: Wed Jan 02, 2013 19:48
by Decon03
WHAT ON EARTH IS THE FIRST PICTURE SUPPOSE TO BE!?

PostPosted: Wed Jan 02, 2013 21:59
by Josh
Decon03 wrote:WHAT ON EARTH IS THE FIRST PICTURE SUPPOSE TO BE!?

It's Sam Fisher.
P.S: I can make some better textures for the night vision goggles later, more like Sam Fisher's :)

PostPosted: Thu Jan 03, 2013 00:18
by Aqua
@nomohakon. There is no other way in lua to make it like that.
@Decon03. That's Sam Fisher from a game. I tried to make my textures like his.
@Josh. Sure if you can make better textures. I'll add you to the credit list!
EDIT: Poll Added! No need to continue a mod no one wants.

PostPosted: Thu Jan 03, 2013 02:12
by Josh

PostPosted: Thu Jan 03, 2013 09:56
by Aqua
Looks great will add it in next version and add your name in the credits ;-)