Page 1 of 1

[Mod] Flood Light [flood_light]

PostPosted: Thu Mar 16, 2017 00:08
by zm78
adds a flood light.

screenshots: Image

crafting:
flood light: M=mese_crystall E=empty S=steel_ingot
(E)(M)(E)
(E)(S)(E)
(S)(S)(S)

Code: LGPLv2.1+, textures: CC BY-SA 3.0 Unported

Mod dependencies: default

Download: https://github.com/zander999/flood_light
zip:
flood_light.zip
(1.07 KiB) Downloaded 123 times

Re: [Mod]flood light[flood_light]

PostPosted: Thu Mar 16, 2017 00:50
by octacian
The meselamp is already as bright as possible (in 0.4.15). Also, rather than uploading a ZIP, since your mod is on GitHub you can just link to https://github.com/zander999/flood_ligh ... master.zip (the same goes for anything on GitHub - to get this link click "Clone or Download", right-click "Download ZIP" and select "Copy Address").

Re: [Mod]flood light[flood_light]

PostPosted: Thu Mar 16, 2017 03:47
by zm78
ok just made it for fun

Re: [Mod]flood light[flood_light]

PostPosted: Thu Mar 16, 2017 03:49
by octacian
Yep, that's what mods are for :D

Re: [Mod]flood light[flood_light]

PostPosted: Thu Mar 16, 2017 17:32
by Diamond knight
The brightness of 15 being highest needs to change sometime.
You should make it generate airlike nodes around it that each have a brightness of 15 (by abm) as a hacky way for right now.

PostPosted: Thu Mar 16, 2017 20:08
by Hybrid Dog
You don't need additional nodes, you can set the light manually using vmanip.
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.override_item("default:wood", {
   on_construct = function(pos)
      local pos1 = vector.add(pos, -5)
      local pos2 = vector.add(pos, 5)

      -- Get the vmanip object and the area and nodes
      local manip = minetest.get_voxel_manip()
      local e1, e2 = manip:read_from_map(pos1, pos2)
      local area = VoxelArea:new{MinEdge=e1, MaxEdge=e2}
      local data = manip:get_light_data()

      -- set non-sunlight everywhere to 15
      for i in area:iterp(pos1, pos2) do
         -- 4 Bit independent light, 4 Bit sunlight
         data[i] = 0xf0 + data[i] % 0x10
      end

      -- Return the changed, change map and show it to the players
      manip:set_light_data(data)
      manip:write_to_map()
   end
})

Image
l need to rework my shadows mod…

Re: [Mod]flood light[flood_light]

PostPosted: Thu Mar 16, 2017 20:31
by zm78
ok but it was made a bright decoration