Page 1 of 1

Updating a property after research finishes

Posted: Fri Sep 29, 2017 5:36 pm
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?

Re: Updating a property after research finishes

Posted: Fri Sep 29, 2017 5:57 pm
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.

Re: Updating a property after research finishes

Posted: Fri Sep 29, 2017 9:51 pm
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.