XML Description Examples
From FreeOrionWiki
|
WARNING: The contents of this page are out of date. The game content scripting system is no longer based on XML. See the Effects page for details on the current system. |
Contents |
Intro
This page provides example of (what we think are) well-formed XML Tech and Building descriptions. These use the XML format described on the Effects page, including various values from the Tech Description Enumerations page.
There's also on a wiki page entitled EffectsTutorial, nearing completion.
The examples on this page are not yet verified in-game or by tzlaine's forthcoming utility, but may be useful for those having difficulty understanding how to put together an XML formatted Tech or Building.
Techs
Post-Exodus Architecture (Theory)
By drek
<Tech>
<name>CON_ARCHITECTURE</name>
<description>CON_ARCHITECURE_DESC</description>
<type>TT_THEORY</type>
<category>CONSTRUCTION_CATAGORY</category>
<research_cost>10</research_cost>
<research_turns>5</research_turns>
<prerequisites></prerequisites>
<unlocked_items></unlocked_items>
</Tech>
Descriptive text: “Building techniques have continued to progress on the ground, even as the population looks toward the stars. In addition, technology developed to facilitate the Exodus to space has been found to have many applications in architecture.”
Large Scale Building Techniques (Application)
By drek
<Tech>
<name>CON_BUILDING_TECHNIQUES</name>
<description>CON_BUILDING_TECHIQUES_DESC</description>
<type>TT_APPLICATION</type>
<category>CONSTRUCTION_CATEGORY</category>
<research_cost>10</research_cost>
<research_turns>3</research_turns>
<prerequisites>
<prereq>CON_ARCHITECTURE</prereq>
</prerequisites>
<effects>
<EffectsGroup>
<scope>
<Condition::And>
<Condition::EmpireAffiliation>
<empire_id>Source.Owner</empire_id>
<affiliation>AFFIL_SELF</affiliation>
<exclusive>1</exclusive>
</Condition::EmpireAffiliation>
<Condition::Type>OBJ_POP_CENTER</Condition::Type>
</Condition::And>
</scope>
<activation><Condition::Self/></activation>
<effects>
<Effect::SetMeter>
<meter>METER_CONSTRUCTION</meter>
<value>Target.MaxConstruction+1</value>
<max>1</max>
</Effect::SetMeter>
</effects>
</EffectsGroup>
</effects>
<unlocked_items></unlocked_items>
</Tech>
Descriptive text: "The alloys and anti-grav tech developed for space travel has also proved a boon to the construction industry. Materials are easier to ferry across the surface of a planet, and construction equipment is generally much more powerful."
Effect Summary:
+1 Max Construction on all worlds.
Crown Jewel Starscrapper (Application)
By drek
<Tech>
<name>CON_MEGALITH</name>
<description>CON_MEGALITH_DESC</description>
<type>TT_APPLICATION</type>
<category>CONSTRUCTION_CATEGORY</category>
<research_cost>15</research_cost>
<research_turns>3</research_turns>
<prerequisites>
<prereq>CON_ARCHITECTURE</prereq>
<prereq>CON_STARSCRAPPERS</prereq>
</prerequisites>
<unlocked_items>
<Item>
<type>UIT_BUILDING</type>
<name>BUILDING_MEGALITH</name>
</Item>
</unlocked_items>
</Tech>
Descriptive text: “A marvel of Exodus-era Architecture, the Megalith is an abnormally massive Starscrapper, kilometers in diameter. The Megalith is an inspiration to architects sector-wide and is often the crown jewel of a powerful real estate mogul’s empire."
Effects Summary:
Unlocks Megalilth build project.
Translinguistic Thought (Theory)
By Geoff the Medio
<Tech>
<name>LRN_TRANSLING_THT_THEORY</name>
<type>TT_THEORY</type>
<description>
LRN_TRANSLING_THT_THEORY_DESC
</description>
<category>LEARNING_CATEGORY</category>
<research_cost>200</research_cost>
<research_turns>15</research_turns>
<prerequisites>
<prereq>LRN_AI_THEORY</prereq>
</prerequisites>
<effects>
<EffectsGroup>
<scope>
<Condition::And>
<Condition::FocusType>
<primary>1</primary>
<FocusType>FOCUS_RESEARCH</FocusType>
</Condition::FocusType>
<Condition::EmpireAffiliation>
<empire_id>Source.Owner</empire_id>
<affiliation>AFFIL_SELF</affiliation>
<exclusive>0</exclusive>
</Condition::EmpireAffiliation>
</Condition::And>
</scope>
<activation><Condition::Self/></activation>
<stacking_group>TLTTECHBIGBONUS</stacking_group>
<effects>
<Effect::SetMeter>
<meter>METER_RESEARCH</meter>
<value>Target.MaxResearch + 3</value>
<max>1</max>
</Effect::SetMeter>
</effects>
</EffectsGroup>
<EffectsGroup>
<scope>
<Condition::And>
<Condition::Or>
<Condition::FocusType>
<primary>1</primary>
<FocusType>FOCUS_BALANCED</FocusType>
</Condition::FocusType>
<Condition::FocusType>
<primary>0</primary>
<FocusType>FOCUS_RESEARCH</FocusType>
</Condition::FocusType>
</Condition::Or>
<Condition::EmpireAffiliation>
<empire_id>Source.Owner</empire_id>
<affiliation>AFFIL_SELF</affiliation>
<exclusive>0</exclusive>
</Condition::EmpireAffiliation>
</Condition::And>
</scope>
<activation><Condition::Self/></activation>
<stacking_group>TLTTECHSMALLBONUS</stacking_group>
<effects>
<Effect::SetMeter>
<meter>METER_RESEARCH</meter>
<value>Target.MaxResearch + 1</value>
<max>1</max>
</Effect::SetMeter>
</effects>
</EffectsGroup>
</effects>
<unlocked_items></unlocked_items>
</Tech>
English Text for Language file:
LRN_TRANSLING_THT_THEORY
Translinguistic Thought
LRN_TRANSLING_THT_THEORY_DESC
Lesser minds struggle with, or accept the confines of the language they have learned. Adequate minds reach and feel constrained by the concepts they are given ways to express. Truely great minds break free of the bounds of language, forming and analyzing thoughts that verge on the transcendental. But merely great minds are left isolated and futile, for without language to express thoughts, how can they share their insights?
Human Readable Effects Summary:
Gives +3 to Primary Research Focused World of own empire
Gives +1 to Primary Balanced or Secondary Research Focused Worlds of own empire
These two effects stack with eachother, so Research/Research worlds get +4, but do not stack with themselves, so if somehow two empires own a single appropriately focused object, it only gets at most one each of the two possible bonuses, and if a world is balanced/research, it only gets +1, even if it somehow gets this tech's effects fired on it twice in one turn
Buildings
Megalith (Build Project)
<BuildingType>
<name>BUILDING_MEGALITH</name>
<description>BUILDING_MEGALITH_DESC</description>
<build_cost>30</build_cost>
<build_time>5</build_time>
<maintenance_cost>10</maintenance_cost>
<effects>
<EffectsGroup>
<scope>
<Condition::Contains>
<Condition::Self>
</Condition::Contains>
</scope>
<activation>
<Condition::MeterValue>
<meter>METER_CONSTRUCTION</meter>
<low>30</low>
<high>999</high>
<max_meter>0</max_meter>
</Condition::MeterValue>
</activation>
<effects>
<Effect::SetMeter>
<meter>METER_POPULATION</meter>
<value>MaxPopulation+1</value>
<max>1</max>
</Effect::SetMeter>
<Effect::SetMeter>
<meter>METER_TRADE</meter>
<value>MaxTrade+1</value>
<max>1</max>
</Effect::SetMeter>
</effects>
</EffectsGroup>
<EffectsGroup>
<scope>
<Condition::And>
<Condition::WithinStarlaneJumps>
<jumps>1</jumps>
<condition><Condition::Self/></condition>
</Condition::WithinStarlaneJumps>
<Condition::EmpireAffiliation>
<empire_id>Source.Owner</empire_id>
<affiliation>AFFIL_SELF</affiliation>
<exclusive>1</exclusive>
</Condition::EmpireAffiliation>
<Condition::Type>OBJ_POP_CENTER</Condition::Type>
</Condition::And>
</scope>
<activation>
<Condition::MeterValue>
<meter>METER_CONSTRUCTION</meter>
<low>30</low>
<high>999</high>
<max_meter>0</max_meter>
</Condition::MeterValue>
</activation>
<effects>
<Effect::SetMeter>
<meter>METER_CONSTRUCTION</meter>
<value>Target.MaxConstruction+3</value>
<max>1</max>
</Effect::SetMeter>
</effects>
</EffectsGroup>
</effects>
</BuildingType>
Descriptive text: “A marvel of Exodus-era Architecture, the Megalith is an abnormally massive Starscrapper, kilometers in diameter. The Megalith is an inspiration to architects sector-wide and is often the crown jewel of a powerful real estate mogul’s empire.”
Effect Summary:
The Megalith needs to be on a developed world to function: 30 Current Construction or greater.
+1 Max Population/Max Trade on the Megalith’s planet.
+3 Max Construction all worlds within 1 starlane hop.
(neither effect is stackable)