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

Place to get help with not working mods / modding interface.
Post Reply
User avatar
PanTobi
Fast Inserter
Fast Inserter
Posts: 112
Joined: Fri Feb 05, 2016 12:34 am
Contact:

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

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

qqwertt
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri May 08, 2020 6:26 pm
Contact:

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

Post by qqwertt »

set the type in energy_source to "void"

User avatar
PanTobi
Fast Inserter
Fast Inserter
Posts: 112
Joined: Fri Feb 05, 2016 12:34 am
Contact:

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

Post by PanTobi »

How?...
I'm not making Mod, im making Scenario Map :x...
img

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2610
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

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

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

User avatar
PanTobi
Fast Inserter
Fast Inserter
Posts: 112
Joined: Fri Feb 05, 2016 12:34 am
Contact:

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

Post 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 !
Last edited by PanTobi on Mon May 25, 2020 9:42 am, edited 2 times in total.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2610
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

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

Post 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

User avatar
PanTobi
Fast Inserter
Fast Inserter
Posts: 112
Joined: Fri Feb 05, 2016 12:34 am
Contact:

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

Post 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 30 times

Post Reply

Return to “Modding help”

Who is online

Users browsing this forum: No registered users