Sketchy Power Lamps


Adds medium and high power lamps that use more power to illuminate a larger area. Includes slightly altered vanilla textures.

Utilities
3 years ago
0.16 - 1.1
1.17K

i Upgrade planner

4 years ago

Hi !

I have been using this mod in factorio 0.17, and noticed that these lamps are not considered as being part of the same item line, and thus cannot be upgraded into each other via an upgrade planner.

It could be a cool feature to include in future versions of the mod.

4 years ago

Thanks for the feedback!

I spent a couple hours trying to look into how this is done (I'm a fairly inexperienced modder) and I ran into a road block. Making it so that the medium lamp can be upgraded into the high power lamp is no problem. However, in order to make the vanilla lamp work with the other two, I need to add flags to the vanilla entity. This is simple enough to do and works if my mod is the only one being loaded, but editing the vanilla entity of something seems to have mod compatibility problems. Specifically the one I ran into, Cargo Ships, copies the vanilla small lamp and uses it for their oil rigs, which throws an error because oil rigs are then considered an upgrade to a lamp.

If you or anyone else has knowledge on how to circumvent that, I'd love to learn how! The ideal solution would be to edit the vanilla lamp "late" so that mods that need to copy the original data do so before my mod is loaded. Another solution (that I don't really want to do) would be to disable the vanilla lamp recipe in the game and make a copy that's functionally the same, but is exclusive to my mod. I'd prefer not to do that one because I don't like the idea of removing existing parts of the game for such a tiny mod.

4 years ago

Thanks for your reply !

I'm a total beginner when it comes to modding, but after doing some research, that "late edit" should be what happens if you add the relevant mod as an optional dependency. You could try this.
If this does not work, I'll do more research. I would be glad to help !

3 years ago

Hm... What kind of compatibility issue did you face? How can I reproduce the problem?

I tried setting-up the lamp -> medium power lamp -> high power lamp upgrade locally, loading Cargo Ships together with Sketchy Power Lamps, and I did not encounter any issues - the oil rig is not upgradeable to medium power lamp.

I can see that Cargo Ships mods does copy the lamp entity, but it is not used as a main entity (and has flags that disallow copying it and deconstructing it).

As a side-note, you could also question whether lamp should be upgradeable - with smaller lamps you might spam them a bit more frequently, and then using medium/high power lamps could result in a lot of light in the area :)

New response