[Solved] Effect to scanning facility & the containing planet

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

Moderator: Committer

Post Reply
Message
Author
Ophiuchus
Vacuum Dragon
Posts: 506
Joined: Tue Sep 30, 2014 10:01 am

[Solved] Effect to scanning facility & the containing planet

#1 Post by Ophiuchus » Tue Jun 13, 2017 8:03 am

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.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12249
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 » Tue Jun 13, 2017 10:18 am

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
Vacuum Dragon
Posts: 506
Joined: Tue Sep 30, 2014 10:01 am

Re: Apply effect to scanning facility and the containing pla

#3 Post by Ophiuchus » Mon Jun 19, 2017 4:23 pm

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.

Post Reply