Page 1 of 1

Lamps that don't need power ? :3...

Posted: Fri May 22, 2020 2:08 pm
by PanTobi
Hey, another Question ^_^

Ty darkfrei for help in last:
viewtopic.php?f=25&t=85163


Now when everything is dark, i want to add some laps to game,
But...

is that possible to make Lamp light without power connection?
and is that possible to manipulate color and POWER or light without any combinators?...


Player live in Underground labolatory, he have 2 ways to get power
1 - Steam Engines, but for that You need water and Fuel
2 - Generators, ( they are ofc. limited in power ^_^ )
Generator
Water Source
But ofc. if he want more resources like for example water, he need to open Gates
all resources rooms are connected to Splitter / Biter Spawners that player can't destroy ^_^

Price for more resources :3...

But i want to add some Light editing and i dont want to waste Power for Player :/...
and i dont want to add Extra Poles...

Re: Lamps that don't need power ? :3...

Posted: Fri May 22, 2020 5:13 pm
by qqwertt
set the type in energy_source to "void"

Re: Lamps that don't need power ? :3...

Posted: Fri May 22, 2020 9:56 pm
by PanTobi
How?...
I'm not making Mod, im making Scenario Map :x...
img

Re: Lamps that don't need power ? :3...

Posted: Sun May 24, 2020 12:25 pm
by darkfrei
PanTobi wrote:
Fri May 22, 2020 2:08 pm
Hey, another Question ^_^

Ty darkfrei for help in last:
viewtopic.php?f=25&t=85163


Now when everything is dark, i want to add some laps to game,
But...

is that possible to make Lamp light without power connection?
and is that possible to manipulate color and POWER or light without any combinators?...
https://lua-api.factorio.com/latest/LuaRendering.html
https://lua-api.factorio.com/latest/Lua ... draw_light #LuaRendering.draw_light

Code: Select all

/c
local entity = game.player.selected
rendering.draw_light {sprite = "utility/light_small", surface = entity.surface, target = entity}
Also

Code: Select all

/c
local entity = game.player.selected
rendering.draw_light {sprite = "utility/light_medium", surface = entity.surface, target = entity}

Re: Lamps that don't need power ? :3...

Posted: Mon May 25, 2020 9:18 am
by PanTobi
Wow Darkfrei i love You :o
it works ^_^...

TY AGAIN :D


//Edit:
ohh and it works with colors <3
img
in case sm1 look for similar stuff,
Here is Function i use after some testing:

Code: Select all

/c
local entity = game.player.selected
	rendering.draw_light 
		{
			sprite = "utility/light_medium", 
			scale = 0.4,
			color = {255,255,255},
			surface = entity.surface, 
			target = entity
		}
	// Info about draw_light function:
	// https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light
	
	// Sprites for use:
	// https://wiki.factorio.com/Prototype/UtilitySprites
	
	// in scale float value
	// in color RGB value
i tested it with other sprites than light, you can use for example hint arrows or those icons for stuff
but some sprites dont work xD try urself :D !

Re: Lamps that don't need power ? :3...

Posted: Mon May 25, 2020 9:38 am
by darkfrei
PanTobi wrote:
Mon May 25, 2020 9:18 am
ohh and it works with colors <3
You are welcome!
It works also with orientation, scale and target_offset, see code this mod: https://mods.factorio.com/mod/TorchLight

Re: Lamps that don't need power ? :3...

Posted: Mon May 25, 2020 9:41 am
by PanTobi
Ohh ye :D
im still testing it xD

Some lights created: :D
427520_20200525124134_1.png
427520_20200525124134_1.png (825.94 KiB) Viewed 29 times