Revamp Exobots and flat bonuses

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderators: Oberlus, Oberlus

Message
Author
User avatar
Oberlus
Cosmic Dragon
Posts: 1418
Joined: Mon Apr 10, 2017 4:25 pm

Re: Revamp Exobots and flat bonuses

#16 Post by Oberlus » Thu May 09, 2019 4:00 pm

Morlic wrote:
Thu May 09, 2019 10:30 am
There should be a "SetSpecies" effect which you could probably use.
Thank you, Morlic :D

Everything works except the change of species, SetSpecies name = "SP_EXOBOT" doesn't seem to work, or probably I haven't changed something necessary in the Scope.
Anyway, the Human ships I made with the new warbot troop pod have the expected capacity (same as Exobots, half of Human's), so the basics do work.
Also, I haven't tried if it would work on NO_OFFENSE_TROOPS species (I have no such playable species right now), but I guess it would work with the modifications I've made (comment out "Not HasTag name = "NO_ATTACKTROOPS"" and "Troops low = X").

I did this:

Edit: corrected as per Ophiuchus advice

New ship part default/scripting/ship_parts/Troops/GT_WARBOT_POD.focs.txt :

Code: Select all

Part
    name = "GT_WARBOT_POD"
    description = "GT_WARBOT_POD_DESC"
    class = Troops
    capacity = 1
    mountableSlotTypes = [External Internal]
    buildcost = 3 * [[FLEET_UPKEEP_MULTIPLICATOR]] * [[SHIP_PART_COST_MULTIPLIER]]
    buildtime = 3
    tags = [ "PEDIA_PC_TROOPS" ]
    location = OwnedBy empire = Source.Owner
    effectsgroups = [
        EffectsGroup
            description = "WARBOT_OFFENSE_TROOPS_DESC" // There is no BAD/AVERAGE/GOOD/GREAT/ULTIMA_OFFENSE_TROOPS_DESC so I didn't do WARBOT's
            scope = Source
            activation = And [
                Ship
                Or [
                    DesignHasPart name = "GT_WARBOT_POD"
                    DesignHasPart name = "GT_WARBOT_POD_2"
                ]
            ]
            stackinggroup = "WARBOT_OFFENSIVE_TROOPS_STACK" // Idem as above
            accountinglabel = "WARBOT_OFFENSIVE_TROOPS_LABEL" // Idem as above
            effects = SetSpecies name = "SP_EXOBOT"
        ]
    icon = "icons/meter/warbots.png"
#include "/scripting/common/upkeep.macros"
New ship part default/scripting/ship_parts/Troops/GT_WARBOT_POD_2.focs.txt :

Code: Select all

Part
    name = "GT_WARBOT_POD_2"
    description = "GT_WARBOT_POD_2_DESC"
    class = Troops
    capacity = 2
    mountableSlotTypes = [External Internal]
    buildcost = 6 * [[FLEET_UPKEEP_MULTIPLICATOR]] * [[SHIP_PART_COST_MULTIPLIER]]
    buildtime = 3
    tags = [ "PEDIA_PC_TROOPS" ]
    location = OwnedBy empire = Source.Owner
    effectsgroups = [
        EffectsGroup
            description = "WARBOT_OFFENSE_TROOPS_DESC"
            scope = Source
            activation = And [
                Ship
                Or [
                    DesignHasPart name = "GT_WARBOT_POD"
                    DesignHasPart name = "GT_WARBOT_POD_2"
                ]
            ]
            stackinggroup = "WARBOT_OFFENSIVE_TROOPS_STACK" // Idem as above
            accountinglabel = "WARBOT_OFFENSIVE_TROOPS_LABEL" // Idem as above
            effects = SetSpecies name = "SP_EXOBOT"
        ]
    icon = "icons/meter/warbots2.png"

#include "/scripting/common/upkeep.macros"
Add in default/stringtables/en.txt :

Code: Select all

GT_WARBOT_POD
Warbot Pod

GT_WARBOT_POD_DESC
'''Carries 1 units of warbot ground [[metertype METER_TROOPS]] and equipment that can be deployed onto a planet.

[[TROOP_POD_OPERATION_TEXT]]'''

GT_WARBOT_POD_2
Advanced Warbot Pod

GT_WARBOT_POD_2_DESC
'''Carries 2 units of advanced warbot ground [[metertype METER_TROOPS]] and equipment that can be deployed onto a planet.

[[TROOP_POD_OPERATION_TEXT]]'''
Modify tech default/scripting/techs/production/EXOBOTS.focs.txt :

Code: Select all

Tech
    name = "PRO_EXOBOTS"
    description = "PRO_EXOBOTS_DESC"
    short_description = "EXOBOT_SHORT_DESC"
    category = "PRODUCTION_CATEGORY"
    researchcost = 50 * [[TECH_COST_MULTIPLIER]]
    researchturns = 5
    tags = [ "PEDIA_PRODUCTION_CATEGORY" ]
    prerequisites = "PRO_SENTIENT_AUTOMATION"
    unlock = [
        Item type = Building name = "BLD_COL_EXOBOT"
        Item type = ShipPart name = "GT_WARBOT_POD"
    ]

    graphic = "icons/species/robotic-01.png"

#include "/scripting/common/base_prod.macros"
Pending: add new tech to unlock GT_WARBOT_POD_2

Ophiuchus
Programmer
Posts: 894
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Revamp Exobots and flat bonuses

#17 Post by Ophiuchus » Thu May 09, 2019 5:48 pm

Oberlus wrote:
Thu May 09, 2019 4:00 pm
Everything works except the change of species, SetSpecies name = "SP_EXOBOT" doesn't seem to work, or probably I haven't changed something necessary in the Scope.
Your effectsgroup macro is not used anywhere. So the effectsgroup does not fire.

Capacity 1 comes directly from the Part Definition, not from the macro.

You want the effect to be species independent, so
the normal troop structure does not fit. Use the macro in the ship part Definition or directly put the Code there.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Furthermore, I propse... we should default to four combat rounds instead of three ...for the good of playerkind.

User avatar
Oberlus
Cosmic Dragon
Posts: 1418
Joined: Mon Apr 10, 2017 4:25 pm

Re: Revamp Exobots and flat bonuses

#18 Post by Oberlus » Thu May 09, 2019 6:35 pm

Ophiuchus wrote:
Thu May 09, 2019 5:48 pm
You want the effect to be species independent, so
the normal troop structure does not fit. Use the macro in the ship part Definition or directly put the Code there.
Thank you! :D

Edit: works like a charm. Editing the above post witht the fix.

User avatar
em3
Vacuum Dragon
Posts: 574
Joined: Sun Sep 25, 2011 2:51 pm

Re: Revamp Exobots and flat bonuses

#19 Post by em3 » Fri May 10, 2019 11:55 am

So... this changes the species of the entire ship, right? So if I wanted (however dump that might sound) to create a troop ship with good pilots (or good stealth or whatever) species piloting and with warbot troops this would not be possible, right?
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556

User avatar
Oberlus
Cosmic Dragon
Posts: 1418
Joined: Mon Apr 10, 2017 4:25 pm

Re: Revamp Exobots and flat bonuses

#20 Post by Oberlus » Fri May 10, 2019 2:31 pm

em3 wrote:
Fri May 10, 2019 11:55 am
So... this changes the species of the entire ship, right? So if I wanted (however dump that might sound) to create a troop ship with good pilots (or good stealth or whatever) species piloting and with warbot troops this would not be possible, right?
Good catch! There's no reason to stop the player from building armed/equiped warbot ships with the builder species' traits for anything but the warbot troop pods.
Thinking of this, the best is to remove the SetSpecies command. There's no need to change the species, because the warbot capacity is independent from the species troop modifiers and because it does not break any game mechanic.
In my tests I used humans to build warbot ships that had the intended stats (1 troop per pod). Although this is intended to be used with NO_OFFENSE_TROOPS species (Nerada), it might had some use in the species values game (some might dislike sending their sons to war and would be happier if you send puny warbots instead). For this I guess there will be no problem witht the fact that the invading troop ships are still labeled as human, because the opinion effect could be based on the ship part type.
The change in the code would be to remove all the effects group from the ship part definition.

Post Reply