xlightwavex wrote:Why would it be 'Not' Contains instead of just Contains ?
Second what exactly does the 'Planet' keyword here specify or how does it act as a instruction ?
http://www.freeorion.org/index.php/Effe ... cification
As is, the building may be constructed
- Planet on any Planet object
- Not Contains which does not already contain
- Building name = "BUILDING_NAME" any building with this name
If you removed
Not, you would only be able to build it on planets that have the building already constructed.
Then i see InSystem id ? i have no clue what this alludes to.
https://github.com/freeorion/freeorion/ ... 2.cpp#L103
https://github.com/freeorion/freeorion/ ... ion.h#L828
InSystem: Matches all objects that are in the system with the indicated id
id is optional, if omitted it will default to the source object system
I have to say the script command syntax is not intuitive at all. In fact i've been running macro tests just to see if i can wrap it up as i learn it to simplify it.
While I find it pretty straight forward, if a method opens it up to more people and doesn't cause issues, that might be helpful.
Code: Select all
[[TargetLocationBegins]]
[[ThisEmpireLocationContainsBuilding("BLD_SHIPYARD_BASE")]]
[[ThisEmpireSystemLocationContainsBuilding("BLD_SHIPYARD_AST")]]
[[TargetLocationEnds]]
Might read better as
Code: Select all
location = And [
[[ContainsOwnedBuilding("BLD_SHIPYARD_BASE")]]
[[ContainedBySystemWIth(ContainsOwnedBuilding("BLD_SHIPYARD_AST"))]]
]
Something to keep in mind down the road, maintaining consistent syntax is important, so a switch from macro case to camel case here would likely be frowned on in any PR.
Im thinking i could probably simply use macro's and a disable txt file
The
.disabled extension is typically used for entries which are mostly correct, but are not used for some reason (problem with script or not balanced well).
The only files that are read are those with the
.focs.txt extension and specific files denoted with the
.inf extension.
The exception is when one of those files contains an
#include statement, which basically replaces the statement with the contents of the requested file(s).
It is safe to use any extension other than
.focs.txt, though for review it should follow the existing guidelines.
(see the README in default/scripting)
Were can i find information on what the scripting keywords are doing and how they are different or relate. Such as Contains And [ ContainedBy And [ or is it best to simply ask as i am now.
Viewing the source with an editor with syntax highlighting (e.g. an IDE) is probably the most common method.
For any exposed token, limit the search to the
parse/ directory for a shorter reference (or omit the default/ directory).
If you compile from source with cmake (not certain if a doc target is specified for MSVC/XCode), you can edit doc/Doxyfile.in to include source files and graphs, then "make doc".
This would give you a localized version of the cpp documentation with source linking and call graphs.
its not clear to me what the 'location' we are actually referring to is ? in the below is it the Planet or the System.
Code: Select all
location = And [
Contains And
[
Building name = "BLD_SHIPYARD_BASE"
OwnedBy empire = Source.Owner
]
It is any object that contains the building (with the source owner).
Currently only planets can contain buildings, but there is no requirement here for a planet or system.
It would probably be more efficient to limit this to planets first, instead of trying to match with every object.
Generally you want to try for the smallest group first, checking if each ship contains a building is kind of pointless
After constraining the number of objects down some, being more generic is less of a burden (any object from 30 objects vs any from 30,000).