Question Re: Disabling Resource Production Whilst Upgrading

Everything about mods can be found here.

Moderator: Morax

Question Re: Disabling Resource Production Whilst Upgrading

Postby anselhelm » 29 Dec 2016, 18:50

Hi all,

I've recently joined this community for local gaming with my wife and possibly in the future with other family members.

I've been tinkering with some existing mods that people have made in terms of small things (i.e., costs, footprint, build times etc.), but I can't seem to work out where or how it's coded to pause resource production of a unit whilst it's upgrading.

The unit I'm trying to tinker with specifically is the T2 and T3 hydrocarbon plants in the BlackOps Unleashed mod pack, since they seem to keep producing energy whilst they're being upgraded.

Could someone please advise where this information is contained and what to add to make these pause energy production during upgrade?

Thanks :)
anselhelm
 
Posts: 5
Joined: 22 Dec 2016, 21:28
Has liked: 2 times
Been liked: 0 time
FAF User Name: anselhelm

Re: Question Re: Disabling Resource Production Whilst Upgrad

Postby Sprouto » 29 Dec 2016, 20:01

Greetings !

What you are looking for is the function SetProductionActive().

Unlike mass fabricators, energy producing buildings don't usually have an ON/OFF toggle switch. That doesn't mean that they can't. The mechanism of this toggle is built around the SetProductionActive() function.

Ideally - you would want the act of upgrading to trigger off this function and then turn it back on when the upgrade was complete.
Sprouto
Priest
 
Posts: 366
Joined: 08 Sep 2012, 05:40
Has liked: 54 times
Been liked: 74 times
FAF User Name: Sprouto

Re: Question Re: Disabling Resource Production Whilst Upgrad

Postby anselhelm » 29 Dec 2016, 21:46

Sprouto wrote:Greetings !

What you are looking for is the function SetProductionActive().

Unlike mass fabricators, energy producing buildings don't usually have an ON/OFF toggle switch. That doesn't mean that they can't. The mechanism of this toggle is built around the SetProductionActive() function.

Ideally - you would want the act of upgrading to trigger off this function and then turn it back on when the upgrade was complete.


Thank you kindly for the information there :)

Would you happen to know a good unit example (other than a Mass Extractor) that I can have a look at to see how this is handled? If not, I'll see what I can find, as now I know what I'm looking for, it should make my search that much easier.
anselhelm
 
Posts: 5
Joined: 22 Dec 2016, 21:28
Has liked: 2 times
Been liked: 0 time
FAF User Name: anselhelm

Re: Question Re: Disabling Resource Production Whilst Upgrad

Postby Sprouto » 30 Dec 2016, 04:56

Try the T3 Mass Fabricator - it has the on/off production toggle - but, you won't likely find all you need there -- the capability is native to the Mass Fabrication 'class' of structures - which you'll find in the defaultunits.lua file.
Sprouto
Priest
 
Posts: 366
Joined: 08 Sep 2012, 05:40
Has liked: 54 times
Been liked: 74 times
FAF User Name: Sprouto


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest