[Solved] Effect to scanning facility & the containing planet

Creation, discussion, and balancing of game content such as techs, buildings, ship parts.

Moderators: Oberlus, Committer

Post Reply
Message
Author
Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

[Solved] Effect to scanning facility & the containing planet

#1 Post by Ophiuchus »

Hi,

i'm adding a detection bonus to following planets

Code: Select all

scope = And [
                Planet 
                Contains Building name = "BLD_SCANNING_FACILITY"
                OwnedBy empire = Source.Owner
            ]
I would like to add a stealth bonus to the building as well, if it is no performance hit.
I assume that duplicating the effectsgroup would double the execution time (as the same activation will be executed twice).

Is it possible to add an effect applying to the building in the effects if the target is a planet?
Maybe there is another way (maybe reusing the activation condition result)?
Last edited by Ophiuchus on Mon Jun 19, 2017 4:24 pm, edited 1 time in total.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Apply effect to scanning facility and the containing pla

#2 Post by Geoff the Medio »

something like

Code: Select all

Or [
    Source
    And [
        Planet
        Contains Source
    ]
]
or

Code: Select all

Or [
    Source
    Object id = Source.PlanetID
]
(not tested, might be wrong, particularly in the particulars)

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

Re: Apply effect to scanning facility and the containing pla

#3 Post by Ophiuchus »

Putting the building also in the scope using an Or worked.
Using an Effect::Conditional If to differentiate the effects between target planet and building also worked.

Then I realized that I need two different stacking groups (one for stealth and one for detection).
So I know now that I would need to different effectGroups.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Post Reply