How does species/common/weapons.macros work?

For topics that do not fit in another sub-forum.
Post Reply
Message
Author
User avatar
Oberlus
Small Juggernaut
Posts: 738
Joined: Mon Apr 10, 2017 4:25 pm

How does species/common/weapons.macros work?

#1 Post by Oberlus » Wed May 23, 2018 10:50 am

How does ~/default/scripting/species/common/weapons.macros work?

For example:

Code: Select all

BAD_WEAPONS
'''EffectsGroup
            description = "BAD_WEAPONS_DESC"
            scope = Source
            activation = And [
                Ship
                Armed
                Or [
                    DesignHasPart name = "SR_WEAPON_1_1"
                    DesignHasPart name = "SR_WEAPON_2_1"
                    DesignHasPart name = "SR_WEAPON_3_1"
                    DesignHasPart name = "SR_WEAPON_4_1"
                ]
            ]
            effects = [
                SetMaxDamage partname = "SR_WEAPON_1_1" value = Value - 1
                SetMaxDamage partname = "SR_WEAPON_2_1" value = Value - 2
                SetMaxDamage partname = "SR_WEAPON_3_1" value = Value - 3
                SetMaxDamage partname = "SR_WEAPON_4_1" value = Value - 5
            ]

        EffectsGroup
            scope = Source
            activation = And [
                Ship
                Armed
                Or [
                    DesignHasPart name = "FT_HANGAR_1"
                    DesignHasPart name = "FT_HANGAR_2"
                    DesignHasPart name = "FT_HANGAR_3"
                    DesignHasPart name = "FT_HANGAR_4"
                ]
            ]
            effects = [
                SetMaxSecondaryStat partname = "FT_HANGAR_1" value = Value - 0.5
                SetMaxSecondaryStat partname = "FT_HANGAR_2" value = Value - 1
                SetMaxSecondaryStat partname = "FT_HANGAR_3" value = Value - 2
                SetMaxSecondaryStat partname = "FT_HANGAR_4" value = Value - 3
            ]

        EffectsGroup
            scope = Source
            activation = And [
                Ship
                Armed
                DesignHasPart name = "SR_WEAPON_0_1"
            ]
            effects =
                SetMaxSecondaryStat partname = "SR_WEAPON_0_1" value = Value - 1 
'''
First EffectsGroup codes the effect on regular ship weapons (mass driver, laser, plasma and death ray). All clear.

Second EffectsGroup codes it for... hangars.
Is SecondaryStat of an hangar the damage of its fighters?

And third EffectsGroup is for flak cannons, right? So a bad pilot species only has two shots (and a ultimate pilot species would have 6).

Ophiuchus
Vacuum Dragon
Posts: 569
Joined: Tue Sep 30, 2014 10:01 am

Re: How does species/common/weapons.macros work?

#2 Post by Ophiuchus » Wed May 23, 2018 3:21 pm

Oberlus wrote:Second EffectsGroup codes it for... hangars.
Is SecondaryStat of an hangar the damage of its fighters?

i think primarystat for hangars is capacity and secondarystat is damage.
Oberlus wrote:And third EffectsGroup is for flak cannons, right?
yes, SR_WEAPON_0_1 is flak
Oberlus wrote:So a bad pilot species only has two shots (and a ultimate pilot species would have 6).
for weapons primary stat is damage and secondary is shots
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Oberlus
Small Juggernaut
Posts: 738
Joined: Mon Apr 10, 2017 4:25 pm

Re: How does species/common/weapons.macros work?

#3 Post by Oberlus » Wed May 23, 2018 4:04 pm

Ok then.
I didn't know the weapons (pilots) species trait affected the fighters. Good to know.

Post Reply