[Mod] Mini Sun, Pesudo Brighter Light Source [mini_sun]

User avatar
bdjnk
Member
Posts: 104
Joined: Wed Mar 20, 2013 21:03
GitHub: bdjnk
Location: New York
Contact:

Re: Mini Sun, Pesudo Brighter Light Source. Updated.

by bdjnk » Post

Doh, sorry about that. The glow texture being visible like that is something I use for debugging. It got left in by mistake. I've fixed it on github.

As a note, it's a very easy thing to toggle. Lines 5 and 6 of init.lua in the version with visible glow texture read

Code: Select all

  drawtype = "plantlike",
  --drawtype = "airlike",
A plantlike drawtype results in textured glow. while with an airlike drawtype the glow is untextured. All you need to do is swap the comment so lines 5 and 6 read

Code: Select all

  --drawtype = "plantlike",
  drawtype = "airlike",

User avatar
balthazariv
Member
Posts: 214
Joined: Mon Apr 07, 2014 15:48
Contact:

Re: Mini Sun, Pesudo Brighter Light Source. Updated.

by balthazariv » Post

Hello,

I like this but no items to my inventory.
I added

Code: Select all

description = "glow",
to

Code: Select all

minetest.register_node("mini_sun:glow", {
	description = "glow",
and

Code: Select all

description = "mini_sun",
to

Code: Select all

minetest.register_node("mini_sun:source", {
	inventory_image = minetest.inventorycube("mini_sun.png", "mini_sun.png", "mini_sun.png"),
	description = "mini_sun", (description = "mini_sun", 
You can also rename your post to [Mod] Mini Sun, Pesudo Brighter Light Source. Updated. [mini_sun] if you want that your mod is detect by the new interface of Krock Search Minetest mods

Thanks for all your works

User avatar
bdjnk
Member
Posts: 104
Joined: Wed Mar 20, 2013 21:03
GitHub: bdjnk
Location: New York
Contact:

Re: [Mod] Mini Sun, Pesudo Brighter Light Source [mini_sun]

by bdjnk » Post

Thanks balthazariv,

It took a while, but I've renamed the first post. I've also given the mod a license and dependencies.

What I really what now is a better recipe. Something involving Mese perhaps?

User avatar
Napiophelios
Member
Posts: 1019
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [Mod] Mini Sun, Pesudo Brighter Light Source [mini_sun]

by Napiophelios » Post

bdjnk wrote:Thanks balthazariv,

It took a while, but I've renamed the first post. I've also given the mod a license and dependencies.

What I really what now is a better recipe. Something involving Mese perhaps?
Its not that great, but in my little subgame; the recipe is a mese block surrounded by mese crystals and mese fragments.
Its supposed to look like a little sun on the crafting grid:

Code: Select all

minetest.register_craft({
output = "mini_sun:sun_source",
recipe = {
   {'default:mese_crystal_fragment',  'default:mese_crystal',  'default:mese_crystal_fragment'},
   {'default:mese_crystal', 'default:mese', 'default:mese_crystal'},
   {'default:mese_crystal_fragment',  'default:mese_crystal',  'default:mese_crystal_fragment'}
  }
})
I also made a nice little texture for it Image
Attachments
mini_sun.png
Created by Napiophelios_license: WTFPL
(2.75 KiB) Not downloaded yet

User avatar
dgm5555
Member
Posts: 245
Joined: Tue Apr 08, 2014 19:45

Re: [Mod] Mini Sun, Pesudo Brighter Light Source [mini_sun]

by dgm5555 » Post

I just wanted to say this is my favorite mod of all time, but I've always found it intensly irritating that it didn't show up in the inventory. Thanks to balthazariv, I now know the following needs to be added to the register function and it shows up fine (so could you please merge this suggestion):-

Code: Select all

description = "mini_sun",
And I really like Napiophelios' texture and recipe, so my vote for that too (actually my perfect texture would improve it to include some animated brightening, but this one is pretty close)!!

User avatar
bdjnk
Member
Posts: 104
Joined: Wed Mar 20, 2013 21:03
GitHub: bdjnk
Location: New York
Contact:

Re: [Mod] Mini Sun, Pesudo Brighter Light Source [mini_sun]

by bdjnk » Post

dgm5555 wrote:I just wanted to say this is my favorite mod of all time, but I've always found it intensely irritating that it didn't show up in the inventory. Thanks to balthazariv, I now know the following needs to be added to the register function and it shows up fine

And I really like Napiophelios' texture and recipe, so my vote for that too (actually my perfect texture would improve it to include some animated brightening, but this one is pretty close)!!
Geh, I thought I'd merged the inventory fix ages ago. I really need to pay more attention. It's merged now. Thanks balthazariv. Sorry it took forever.

Thanks for the compliment though. Glad you like it.

Napiophelios, thanks for the recipe suggestion and texture. I like the texture, but it feels stone-like. It's also 32x32, while I like my included textures to be 16x16 to match the default textures. As to the recipe, that seems like it might be too much Mese.

Anyway, it's motivated me to update the recipe, and thus the texture. Here's the new recipe:

Code: Select all

copper_ingot  glass         copper_ingot
glass         mese_crystal  glass
copper_ingot  glass         copper_ingot
And here is the slightly updated texture to match:
mini_sun.png
(407 Bytes) Not downloaded yet
Edit: It doesn't look so good here, but in the game it looks fine.

User avatar
yyt16384
Member
Posts: 46
Joined: Mon Nov 03, 2014 12:16
GitHub: yyt16384
IRC: yyt16384
In-game: yyt16384
Location: China

Re: Mini Sun, Pesudo Brighter Light Source. Updated.

by yyt16384 » Post

bdjnk wrote:
  • Line of slight only glow node placement, which I'm not even sure is a good idea.
It would be better to do a floodfill in the air nodes, so only the nodes connected with the source will be replaced. (It may be slow, though)

User avatar
bdjnk
Member
Posts: 104
Joined: Wed Mar 20, 2013 21:03
GitHub: bdjnk
Location: New York
Contact:

Re: Mini Sun, Pesudo Brighter Light Source. Updated.

by bdjnk » Post

yyt16384 wrote:
bdjnk wrote:
  • Line of slight only glow node placement, which I'm not even sure is a good idea.
It would be better to do a floodfill in the air nodes, so only the nodes connected with the source will be replaced. (It may be slow, though)
It would be both easier and more realistic to use line of sight, but even that requires thought in terms of optimization and correctness.

I do know that when you're in an adjacent hallway, and it's bright like the noon-day sun, despite the source being on the other side of the wall, it feels a bit awkward.

If you feel strongly about it, and know a bit how to program, you could code it up and submit a pull request. Otherwise, I likely will do line of sight eventually, but not today ;)

User avatar
cHyper
Member
Posts: 900
Joined: Fri May 06, 2011 08:49
GitHub: cHyper-0815OL
IRC: cHyper cHyper_de
In-game: cHyper cHyper_0815
Location: Austria
Contact:

Re: [Mod] Mini Sun, Pesudo Brighter Light Source [mini_sun]

by cHyper » Post

+1 awesome mod...

User avatar
Napiophelios
Member
Posts: 1019
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [Mod] Mini Sun, Pesudo Brighter Light Source [mini_sun]

by Napiophelios » Post

bdjnk wrote: Napiophelios, thanks for the recipe suggestion and texture. I like the texture, but it feels stone-like. It's also 32x32, while I like my included textures to be 16x16 to match the default textures. As to the recipe, that seems like it might be too much Mese.
Oh I didnt mean to suggest you include the texture with the mod,
Its created from a Nasa picture of the sun's surface,
I just thought it was neat looking and wanted to share it with others.

I make the craft recipe expensive because I think this is a powerful mod
and should be hard to get. Its awesome advantage for farming underground.

fergoy
New member
Posts: 8
Joined: Wed Aug 30, 2017 15:47
GitHub: fergoy
In-game: fgoy

Re: [Mod] Mini Sun, Pesudo Brighter Light Source [mini_sun]

by fergoy » Post

Hi, I'm here just to tell about some ideas over this concept. I'm using 4.13 version and playing solo, so many mods are too mutch or just incompatible to me. So, to help me explore caves withour putting hundreds of torchs for each inch I step, I found out this mod but wasn't just fine for me so I did mine based on this concept.

I'm not publishing mine version because it's too simple and I don't know if it can cause some trouble on servers. I home my idea help another mod to became the one we all hope.

So, my mod is a block made of 9 torches, it's like a block of torches. It glows with the 14 lightmax limit, so I've included an airblock that glows too, but it's still air. The trick is that an ABM searches every time for a random node around 6 blocks from the block of torches, so if this random node is air, it changes it for my glowing air. So the block spawn as many blocks as the room space, but slowly to not compromise the processes.

The second trick is a second ABM to the air blocks, they have a life = 12 and every 10 seconds they lose 1. When gets to 0 the blocks comes back to be just air, not glowing. So, this block live 120 seconds. If you dig back the block of torches, all the air blocks remains until the life goes 0.

Hope my idea helps! Thank you.

Here is the code:

Code: Select all

minetest.register_node("supertorch:torch", {
	description = "Super Torch",
	inventory_image = "icon.png",
	paramtype = "light",
	tiles = { {
	name = "torch_up.png",
	animation = {
		type = "vertical_frames",
		aspect_w=16,
		aspect_h=16,
		lenght = 2.0
	}}},
	is_ground_content = false,
	groups = {crumbly = 3},
	light_source = 14,

})
minetest.register_abm({
	label = "supertorch light propagation",
	nodenames = {"supertorch:torch"},
	interval = 1,
	chance = 1,
	action = function(pos,node)
		local v = vector.new(math.random(-6,6),math.random(-6,6),math.random(-6,6))
		local p = vector.add(pos,v)
		local node = minetest.get_node(p)
		if node.name == "air" then
			minetest.set_node(p,{name = "supertorch:airlight"})
		end
	end
})
minetest.register_node("supertorch:airlight", {
	description = "Super torch air light",
	paramtype = "light",
	drawtype = "airlike",
	light_source = 14,
	sunlight_propagates = true,
	walkable = false,
	pointable = false,
	diggable = false,
	buildable_to = true,
	on_construct = function(pos)
		local meta = minetest.get_meta(pos)
		meta:set_int("life", 12)
	end
})
minetest.register_abm({
	label = "supertorch light remove",
	nodenames = {"supertorch:airlight"},
	interval = 10,
	chance = 1,
	action = function(pos,node)
		local meta = minetest.get_meta(pos)
		local life = meta:get_int("life")
		if life <= 0 then
			minetest.set_node(pos,{name = "air"})
		else
			meta:set_int("life", life - 1)
		end
	end
})
minetest.register_craft({
    output = "supertorch:torch",
    recipe = {{"default:torch","default:torch","default:torch"},
	{"default:torch","default:torch","default:torch"},
	{"default:torch","default:torch","default:torch"}}
})

User avatar
rubenwardy
Moderator
Posts: 6281
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: [Mod] Mini Sun, Pesudo Brighter Light Source [mini_sun]

by rubenwardy » Post

fergoy wrote:I'm using 4.13 version and playing solo
Your Minetest version is almost 3 years old. Please update to 0.4.16

To do that on Ubuntu, run the following commands:

Code: Select all

sudo add-apt-repository ppa:minetestdevs/stable
sudo apt update
sudo apt upgrade

Post Reply

Who is online

Users browsing this forum: Bing [Bot], ComputeGraphics and 8 guests