Solar Powered Lamp

Place to get help with not working mods / modding interface.
Post Reply
Robodonkey
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Jul 27, 2015 5:16 pm
Contact:

Solar Powered Lamp

Post by Robodonkey »

Was working on writing a mod, and one part of it was going to be a solar powered lamp (In case you don't want to run power lines all over the place, you can have a lamp to just plonk down and have it always work).

My roadblock I'm hitting is I don't know what I could use as a type to allow for solar powered lamps. Lamps don't seem to have the ability to handle being a producer, a consumer, and an energy buffer to store extra solar power produced during the day.

Anyone know a prototype that can do this? Or have any ideas as to how I could do it?

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Solar Powered Lamp

Post by Klonan »

Hey i did something like this for inserters:

https://forums.factorio.com/forum/vie ... 14&t=12732

My trick is to spawn entities around the inserter which will do all the power stuff, the mod it for 0.11, so wont work.

Also i made a mod torches and iron lantern : https://forums.factorio.com/forum/vie ... 93&t=13479

Which uses a similar spawning thing, but has been updated for 0.12

Have a look and see if this method will work for your mod idea, if you need any advice i will keep an eye on this thread

kiba
Filter Inserter
Filter Inserter
Posts: 344
Joined: Thu Jun 11, 2015 5:32 am
Contact:

Re: Solar Powered Lamp

Post by kiba »

Just have the lamp create light and hope no ones look too closely?

Unless you're looking to do something more interesting with solar lamps.

Robodonkey
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Jul 27, 2015 5:16 pm
Contact:

Re: Solar Powered Lamp

Post by Robodonkey »

kiba wrote:Just have the lamp create light and hope no ones look too closely?

Unless you're looking to do something more interesting with solar lamps.
Hehehe, that's honestly a good step to get around this roadblock I hit. Was thinking about giving it the ability to consume from the power network as well, but that just seems to become awfully complicated fast.

I guess I could improve it for 0.12 (still on 0.11.22 until I can get a save to Rocket Defense) to do more like what I was originally intending. I'm also planning on looking at something like Torches and Iron Lanterns to get an idea of how they do it, and maybe do something similar.

Robodonkey
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Jul 27, 2015 5:16 pm
Contact:

Re: Solar Powered Lamp

Post by Robodonkey »

Klonan wrote:Hey i did something like this for inserters:

https://forums.factorio.com/forum/vie ... 14&t=12732

My trick is to spawn entities around the inserter which will do all the power stuff, the mod it for 0.11, so wont work.

Also i made a mod torches and iron lantern : https://forums.factorio.com/forum/vie ... 93&t=13479

Which uses a similar spawning thing, but has been updated for 0.12

Have a look and see if this method will work for your mod idea, if you need any advice i will keep an eye on this thread
You were actually one of the people I was going to be looking at. I like the other idea of just generate power from nothing for now, and I'll look at doing something like the torches and iron lantern mod once I update to 0.12 and get some better handling on modding.

I'll keep you in mind if I need some help.

Thank you for your reply.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Solar Powered Lamp

Post by Klonan »

Robodonkey wrote:I like the other idea of just generate power from nothing for now, and I'll look at doing something like the torches and iron lantern mod once I update to 0.12 and get some better handling on modding.

I've tried this, and it will work in the sense that it will turn on and illuminate an area, but it will have the constant flashing 'no power' icon, which i could never seem to get rid of

Robodonkey
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Jul 27, 2015 5:16 pm
Contact:

Re: Solar Powered Lamp

Post by Robodonkey »

Klonan wrote:
Robodonkey wrote:I like the other idea of just generate power from nothing for now, and I'll look at doing something like the torches and iron lantern mod once I update to 0.12 and get some better handling on modding.

I've tried this, and it will work in the sense that it will turn on and illuminate an area, but it will have the constant flashing 'no power' icon, which i could never seem to get rid of
That's fine by me for now. I'm mostly doing testing and trying out ideas until I can get done with Rocket Defense, then I'm upgrading my mod and my game to 0.12.

Got plenty of other ideas I'm trying to do my own interpretation of that it'll be a long time before I feel ready to publish my mod anyways.

It's both encouraging and disappointing to see some ideas that I had already be existing mods other people have done....

Post Reply

Return to “Modding help”