Are the FOCS scripts in techs, weapon parts, etc., like the one in SHP_FIGHTERS_2.focs.txt, executed every turn?
Could one of these alternatives be faster (require less condition checks) than the other?
One EffectsGroup with a single "scope" for different cases and a single "effects" with conditional effects to distinguish between cases.
Code: Select all
effectsgroups =
EffectsGroup
scope = And [
Ship
OwnedBy empire = Source.Owner
Or [
DesignHasPart name = "FT_HANGAR_1"
DesignHasPart name = "FT_HANGAR_2"
DesignHasPart name = "FT_HANGAR_3"
]
]
effects = [
SetMaxCapacity partname = "FT_HANGAR_1" value = Value + (PartsInShipDesign name = "FT_HANGAR_1" design = Target.DesignID)
SetMaxSecondaryStat partname = "FT_HANGAR_2" value = Value + 2
SetMaxSecondaryStat partname = "FT_HANGAR_3" value = Value + 3
]
One EffectsGroup for each scope case, each with a simple "effects":
Code: Select all
effectsgroups = [
EffectsGroup
scope = And [
Ship
OwnedBy empire = Source.Owner
DesignHasPart name = "FT_HANGAR_1"
]
effects = SetMaxCapacity partname = "FT_HANGAR_1" value = Value + (PartsInShipDesign name = "FT_HANGAR_1" design = Target.DesignID)
EffectsGroup
scope = And [
Ship
OwnedBy empire = Source.Owner
DesignHasPart name = "FT_HANGAR_2"
]
effects = SetMaxSecondaryStat partname = "FT_HANGAR_2" value = Value + 2
EffectsGroup
scope = And [
Ship
OwnedBy empire = Source.Owner
DesignHasPart name = "FT_HANGAR_3"
]
effects = SetMaxSecondaryStat partname = "FT_HANGAR_3" value = Value + 3
]
(Not sure if this should be here or in Programming.)