BuildingScripts

From Empires Wiki
Jump to: navigation, search
Empires Scripting Documentation
Scripting Overview | Vehicle Script Overview | Vehicle Handling Script Overview | Weapon Script Overview | Armor Script Overview | Building Script Overview | Infantry Script Overview | Hint Messages | Loading Screen Script Overview | Tutorials



Overview

This is a glossary of all the attributes that can be used in a building script.

You place comments in a script file by putting a "//" in front of the comment.

Building Properties

name
spotted name
model
model2
model4
model8
model16
model32
cost
max health
starting health
damaged model
damaged threshold
destroyed model
vehicle physbox
recycle time
carcass removal time
touchmessageid

Turret-Specific Properties

The following keyvalues are specified for turrets:

  • "turret range level X" (Range at which the turret will engage, measured in Hammer Units)
  • "turret rof level X" (Amount of seconds between each salvo. Defined as a float)
  • "turret turn speed level X" (How fast the turret can turn)
  • "turret turn missile level X" (ML only: How well the missiles of a turret can turn corners)
  • "turret starting hp level X" (Starting HP of the turret)
  • "turret max hp level X" (Max HP of the turret)

where X is the level (1-3).


Building Resistances

Buildings are able to have several resistances. A resistance is calculated using the following formula:

Damage = Damage - (Damage * Resistance)

This means that the higher a resistance attribute, the more damage that will be absorbed. A resistance attribute can lie between 0 and 1 and is defined as a floating-point variable.

The type of damage a weapon does can be set in the Damage Type attribute of a weapon.

List of resistances:

  • GeneralPhysicsResist - General Physics Tree Damage
  • GeneralChemistryResist - General Chemistry Tree Damage
  • GeneralMechanicalResist - General Mechanic Tree Damage
  • GeneralElectricResist - General Electric Tree Damage
  • GeneralBiologicalResist - General Biological Tree Damage


  • KineticResist - Railguns, Standard Cannons, Anything that is just force
  • ExplosiveResist - HE, Nukes, anything that explodes
  • BioResist - Has the bio effect


  • BulletResist - Non Armor damaging
  • APBulletResist - Armor Damaging
  • BulletExplosiveResist - Bullets that Explode


  • MissileResist - Generic Missile type of damage
  • MissileExplosiveResist - Explosive type.
  • MissileBioResist - Bio Missiles. Different than Bio?


  • KineticArtResist - Kinetic Artillery
  • ExplosiveArtResist - Explosive Artillery
  • BioArtResist - Bio Artillery


  • AircraftMissileResist - Aircraft Missiles
  • AircraftGroundMissleResist - Aircraft Missiles to hit ground targets
  • AircraftBulletResist - Aircraft to Aircraft bullets
  • AircraftAPBulletResist - Aircraft Bullets to hit ground targets
  • AircraftBombResist - Bombs
  • AircraftBombBioResist - Bio Bombs?


  • InfantryGrenadeResist - Player Thrown Grenades
  • InfantryMineResist - Player Tossed Mines
  • InfantryMissileResist - Gren Missiles
  • InfantryMortarResist - Gren Mortars
  • InfantryStickyResist - Sticky Grenades
  • InfantrySeismicResist - Seismic Grenades
  • InfantryBulletResist - Infantry Bullets
  • InfantryUtilityResist - Concussion nades, various infantry stuff that does special things but no damage


  • ExtraType1Resist - Anti Building weapons
  • ExtraType2Resist
  • ExtraType3Resist

Boundary Vectors

The boundary vectors are the boundary vectors used to calculate the "footprint" that a building makes. There are two vectors: Min and Max. They use the following attributes.

  • MinColBoundX
  • MinColBoundY
  • MinColBoundZ


  • MaxColBoundX
  • MaxColBoundY
  • MaxColBoundZ

Particle Attachments

Using these attributes, you can have up to 10 different particles on a single model show when the building is destroyed. The attributes go from 0-9. You must always state both attributes.

WRONG:

ExplosionAttachment0" "explosion1" // Attachment 0 in the model.
ExplosionParticle0" "Explosion_std" // Particle 0 on attachment 0.
ExplosionParticle1" "Explosion_std" // Particle 1 on attachment 0.

CORRECT:

ExplosionAttachment0" "explosion1" // Attachment 0 in the model.
ExplosionParticle0" "Explosion_std" // Particle 0 on attachment 0.
ExplosionAttachment1" "explosion1" // Attachment 1 in the model. This attachment can be the same as the previous attachment.
ExplosionParticle1" "Explosion_std" // Particle 1 on attachment 1.

  • ExplosionAttachmentX - This attribute contains the model attachment, which is where the particle will be created.
  • ExplosionParticleX - This attribute contains the name of the particle that will be created.