FreeOrion

Forums for the FreeOrion project
It is currently Thu Dec 14, 2017 12:30 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Jun 13, 2017 8:03 am 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 213
Hi,

i'm adding a detection bonus to following planets
Code:
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)?

_________________
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Last edited by Ophiuchus on Mon Jun 19, 2017 4:24 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue Jun 13, 2017 10:18 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12041
Location: Munich
something like
Code:
Or [
    Source
    And [
        Planet
        Contains Source
    ]
]

or
Code:
Or [
    Source
    Object id = Source.PlanetID
]

(not tested, might be wrong, particularly in the particulars)


Top
 Profile  
 
PostPosted: Mon Jun 19, 2017 4:23 pm 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 213
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group