Is it feasible to dynamically modify production speeds?

Everything about mods can be found here.

Moderator: Morax

Is it feasible to dynamically modify production speeds?

Postby Zsombi » 18 Feb 2016, 18:07

I can't mod so it's just ideas, theory.
How feasible is it to dynamically increase or decrease production /construction /build speed of certain assets through another entity?

The idea is a structure, only placeable on mass points, and instead of mass it provides a "global" production speed boost as a fixed value (equal bonus to all) or a percentage (varying, dependent on affected asset's own value) - either just to the chosen faction or anything the player owns.
Zsombi
Avatar-of-War
 
Posts: 73
Joined: 20 Feb 2013, 16:04
Location: Romania
Has liked: 4 times
Been liked: 3 times
FAF User Name: Zsombi

Re: Is it feasible to dynamically modify production speeds?

Postby Mot » 18 Feb 2016, 19:47

you mean like kennels?
Mot
Avatar-of-War
 
Posts: 64
Joined: 22 Feb 2015, 21:50
Has liked: 2 times
Been liked: 3 times
FAF User Name: MayorDamage

Re: Is it feasible to dynamically modify production speeds?

Postby Sprouto » 18 Feb 2016, 19:56

There are some methods built-in to the code that would permit what I think you're asking for.

For example;

The buff system would allow you to create a structure that offers any number of enhancements or penalties to any units (yours, allies, enemies) that are within a range of the structure. The buff can be stackable, or not, and can apply to a wide range of factors;

- hit points
- regeneration
- mass or energy output
- mass or energy consumption
- intelligence radius (vision, radar, sonar, Omni)
- weapon range and damage
- unit speed

So, the short answer is yes.
Sprouto
Priest
 
Posts: 366
Joined: 08 Sep 2012, 05:40
Has liked: 54 times
Been liked: 74 times
FAF User Name: Sprouto

Re: Is it feasible to dynamically modify production speeds?

Postby Zsombi » 01 May 2016, 13:36

So there could exist let's say a factory whose production /build rate increases or decreases depending on how many mexes the owner has; with each owned mex increasing that rate by a fixed value. ?

.. a good example, I guess, would be from the game Warhammer 40k's Necron faction's "dynamic" build /production rate system - which increases the more they have from a certain structure, or decreases if they loose those.
Zsombi
Avatar-of-War
 
Posts: 73
Joined: 20 Feb 2013, 16:04
Location: Romania
Has liked: 4 times
Been liked: 3 times
FAF User Name: Zsombi

Re: Is it feasible to dynamically modify production speeds?

Postby Franck75 » 23 Aug 2016, 16:56

Zsombi wrote:So there could exist let's say a factory whose production /build rate increases or decreases depending on how many mexes the owner has; with each owned mex increasing that rate by a fixed value. ?

.. a good example, I guess, would be from the game Warhammer 40k's Necron faction's "dynamic" build /production rate system - which increases the more they have from a certain structure, or decreases if they loose those.


Yes, it is possible.

1. You can hook or add a OnCreate() function in your factory lua script.

2. You add a thread that watch the mexes around

You can catch the mexes with this code
Code: Select all
local units = AIUtils.GetOwnUnitsAroundPoint(self:GetAIBrain(), categories.MASSEXTRACTION, self:GetPosition(), 1000)


3. You modify the factory build rate with some code like this
Code: Select all
UnitFactory:SetBuildRate(NumMexes * BonusPerMexes)



You can do much more :
- process some formulas depending on Mexes level.
- process some formulas depending distance between factory and mexes.
- Process some formulas by adding a buildrate skill on your factory to be trained to increase the buildrate efficiency.
- Process some formulas by watching the storage distance between your factory
etc....
Franck75
Crusader
 
Posts: 13
Joined: 22 Aug 2016, 13:56
Has liked: 2 times
Been liked: 0 time
FAF User Name: Franck


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest