Difference between revisions of "FOCS Scripting Details"

From FreeOrionWiki
Jump to: navigation, search
Line 1: Line 1:
 
=Unofficial=
 
=Unofficial=
Contents of this document have not undergone public review.  --drek
+
Contents of this document have not passed public review.  --drek
  
 
=Introduction=
 
=Introduction=

Revision as of 05:14, 7 July 2004

Unofficial

Contents of this document have not passed public review. --drek

Introduction

Each tech, building, and planet special will probably be encoded as XML, including mark-up tags describing the effects of the object. Most effects have a scope (galaxy wide, empire wide, sector, system, planet). Within that scope, Effects operate on targets that fulfill any listed conditions.

In v.3, if these are the only two classes of effects: Modify Meter and Unlock Item. An objects can have multiple effects, but no conditions beyond what is offered by the Effect Classes.

Modify Meter

Effect Name

The name of the effect, mostly for internal usage. Effects can share the same name, meaning they will not stack if the stacking flag is set. Effects that share names should have identical bonuses.)

(programming note: "sharing a name" means that they share the same StackingID.)

Scope

  • Galaxy The effect operates on the meters of every planet in the galaxy
  • Empire The effect operates on the meters belonging to every planet in the empire.
  • Sector The effect operates on the meters belonging to the planets contained by the Target system and any planets in systems connected to the target system by a starlane or wormhole.
  • System The effect operates on the meters belonging to the planets contained by the Target system.
  • Planet The effect operates on a single planet.

Effect Affiliation

  • All: The effect influences the meters of every planet, regardless of empire affiliation.
  • Exclusive: The effect only acts on planets owned by the target Empire.
  • Friends: The effect only acts the meters of on objects owned by the target Empire and allied Empires. (not required in v.3)
  • Enemies: The effect only acts the meters of objects owned by empires unfriendly with the target Empire. (every empire is considered unfriendly in v.3)

Meter

  • Farming
  • Industry
  • Mining
  • Science
  • Economic
  • Health (growth of Population)
  • Construction (growth of Infra)
  • Enviroment (The results of Enviromental Preference)
  • Security (not in v.3)
  • Happiness (not in v.3)

Type of Modification

  • Additive The default.
  • Multiplicative Should be used rarely. The Modification value is multiplied with the Multiplier of the meter. (The Meter’s multiplier is then multiplied with the meter itself after all effects have executed.)

Value of Modification

The value that is added to or multipled with the meter.

Stacking

Does the effect stack?

Focus Condition

  • None Effect occurs regardless of planet focus
  • Primary Effect only occurs if the Meter being modified is set as the Primary
  • Secondary Effect only occurs if the Meter being modified is set as Primary or Secondary

Infra Condition

If total infrastructure is less than this value, the effect is canceled. (this will probably change once an infrastucture system passes public review.)

Enviromental Condition

Either None, or the Enviroment in which this effect operates:

  • Terran
  • Ocean
  • Swamp
  • Toxic
  • Inferno
  • Radiated
  • Barren
  • Turdra
  • Desert
  • Gaian
  • Asteriod Field (not used in v.3)
  • Gas Giant (not used in v.3)

Description

Appended to the tooltip of the affected meter.

Unlock Item

Techs, buildings, and ship parts can be unlocked. An unlocked Tech can be researched, an unlocked building or ship part can be constructed.

Type

The nature of the item being unlocked:

  • Tech A single technology
  • Tech Branch An entire branch of the tech tree.
  • Building
  • Ship Part (in version v.3, ship "parts" are scout, colony, mark I-V)

ItemID

The unique name of the item being unlocked.

Duration

  • Permanent The item remains unlocked for the entire game.
  • Life of Effect When the effect is destoyed, the item returns to being locked. For example, if a buiding that opens up a special part of the tech tree is lost, that branch of the tree would be closed for research.


Examples

Universal University

(building) The Universal University offers a quality education to budding young science geeks.

The U.U. has two effects:

Advanced Education

  • Scope: Empire
  • Affliation: Exclusive
  • Meter: Science
  • Type of Modification: Additive
  • Value of Modification: +1
  • Stacking: Does not stack
  • Focus Condition: None
  • Infra Condition: 5
  • Enviro Condition: None
  • Description: +1 Science to Developed worlds from Universal University

Science Inspiration

  • Scope: Sector
  • Affliation: Friends
  • Meter: Science
  • Type of Modification: Additive
  • Value of Modification: +1
  • Stacking: Does not stack
  • Focus Conditions: Primary
  • Infra Conitions: 5
  • Enviro Condidtion: None
  • Description: +1 Research to Developed Science worlds, due to a nearby Universal University

Ocean Survival

(Tech) Your empire has developed methods of surviving and exploiting Ocean worlds.

Two effects:

Floating Platforms

  • Scope: Empire
  • Affliation: Exclusive
  • Meter: Enviroment
  • Type of Modification: Additive
  • Value of Modification: +2
  • Stacking: Does not stack
  • Focus Condition: None
  • Infra Condition: None
  • Enviro Condition: Ocean
  • Description: +2 Enviroment from Ocean Survival

Fish n' Chips

  • Scope: Empire
  • Affliation: Exclusive
  • Meter: Farming
  • Type of Modification: Additive
  • Value of Modification: +1
  • Stacking: Does not stack
  • Focus Condition: Secondary
  • Infra Condition: 1
  • Enviro Condition: Ocean
  • Description: +1 Food to Ocean Farming Worlds from Ocean Survial

Hostile Microcobes

(Planet Special) Nasty little one celled horrors have proven resistant to extermination.

Two effects:

Sickness

  • Scope: Planet
  • Affliation: Exclusive
  • Meter: Health
  • Type of Modification: Additive
  • Value of Modification: -1
  • Stacking: Stacks
  • Focus Condition: None
  • Infra Condition: 0
  • Enviro Condition: None
  • Description: -1 Health due to the Hostile Microcobes

Hostile Biology

  • Scope: Planet
  • Affliation: Exclusive
  • Meter: Enviroment
  • Type of Modification: Additive
  • Value of Modification: -2
  • Stacking: Does not stack
  • Focus Condition: None
  • Infra Condition: 0
  • Enviro Condition: None
  • Description: -2 Enviroment, because this planet's life hates you


Future Effects

There will be more Effect Classes in future versions, possibly including:

Modify ShipPart

A modification of ship parts, improving or penalizing various stats.

This is meant for techs that refine parts, or buildings that give bonuses to certain unit types.

Modify Infrastructure

Directly effects the infrastructure (ie, Current Meter) of a planet, rather than the Max Meter. Useful for events like bombings or earthquakes.