Updating a property after research finishes

Place to get help with not working mods / modding interface.
Post Reply
deer_buster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Wed Aug 31, 2016 3:35 am
Contact:

Updating a property after research finishes

Post by deer_buster »

If I wanted to create some technology that, when researched, changed the cooldown time for the laser turrets, how would I go about doing that?

I think I would create a set of technologies that had an empty object for the effect, but would do something on the "on_research_finished" event? Can I somehow modify the cooldown property of all turrets that a player has placed/places? Do I have to create new entities and replace all existing with the new one and replace all newly placed ones with the new one as they place them?

deer_buster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Wed Aug 31, 2016 3:35 am
Contact:

Re: Updating a property after research finishes

Post by deer_buster »

unless anyone else has some magical knowledge, I will assume I will have to replace every instance of the placed turret with a slightly modified entity. A rather poor design.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Updating a property after research finishes

Post by DaveMcW »

Yes, you need to replace entities unless your property is attached to LuaForce.

Laser turret cooldown seems like a good addition to LuaForce, maybe you can make a modding interface request.

Post Reply

Return to “Modding help”