Homeworld 2 : VariableShip
Karos Graveyard ::
Function Reference :: Scope Reference :: Variable Reference
Ship Variables

Syntax
<ShipTable> = StartShipConfig()
<ShipTable>.<Variable> = <Value>
(Can also be written as <ShipTable>["<Variable>"] = <Value>)

Description
Within every ".ship" file, there are over a hundred variables defining such things as the ship's health (armor), maximum speed and manuverability, as well as many unseen statistics. They are all initialized using the StartShipConfig function, and are stored within a table-type variable, called NewShipType. (See the Table Constructor for more information on table type variables.)

Example
NewShipType = StartShipConfig()
NewShipType.mainEngineMaxSpeed = 215

Variables
See below...



The following list needs a lot of work. If anyone with information about any of these values, please help fill in the details. Thanks!
Much of this information can also be found in "ShipTuning.xls", or Mikail's Updated ShipTuning.xls A complete list of variables can also be found in the Objects Dump
Variables
Basic Ship Stats


Formations


Ship Physics
Mass
  • mass = <fMass>: Mass in kilograms of the ship. Used to determine damage in a collision.
  • collisionMultiplier = <fMultiplier>: Multiplier to collision damage from a kamikaze attack.

Maximum Speeds
  • thrusterMaxSpeed = <fSpeed>: Maximum forward speed in meters/second when the target is not in the forward cone (see acceleration Angle) [Changed by TheBlind]
  • mainEngineMaxSpeed = <fSpeed>: Maximum forward speed in meters/second.
  • rotationMaxSpeed = <fSpeed>: Maximum turning speed in degrees/second.

Accelerations
  • thrusterAccelTime = <fTime>: Time, in seconds, it takes to accelerate to maximum speed when the target is not in the forward cone.
  • thrusterBrakeTime = <fTime>: Time, in seconds, it takes to stop when the target is not in the forward cone.
  • mainEngineAccelTime = <fTime>: Time, in seconds, it takes to accelerate to maximum speed.
  • mainEngineBrakeTime = <fTime>: Time, in seconds, it takes to stop.
  • rotationAccelTime = <fTime>: Time, in seconds, it takes to accelerate to maximum rotation (turning) speed.
  • rotationBrakeTime = <fTime>: Time, in seconds, it takes to accelerate to stop rotating (turning).

Misc
  • thrusterUsage = <fPercent> Float value between 0 and 1.
  • accelerationAngle = <fAngle>: The angle (in degrees) of the forward cone of the ship that determines when a ship starts accelerating towards the goal. For fighter, this is usually a high number, because you want them to speed up immediately, while for a battlecruiser this is usually a low number, because the turning speed of the BC is so slow that you want to be pointing more at the target before it accelerates. [Description by TheDutch]
  • mirrorAngle = <fAngle>: The angle of the cone behind the ship. If you give a move order within this cone behind the ship, the ships will to a mirror-maneuver, which is also defined in the ship file. [Description by TheDutch]
  • secondaryTurnAngle = <fAngle>
  • maxBankingAmount = <fAngle>
  • descendPitch = <fAngle>: If set to 360, along with maxBankingAmount, ships can achieve rolls/dives/etc, however, depending on the ship, this can be really undesirable.
  • goalReachEpsilon = <fDistance>: The minimal distance in meters between a ship and it's destination, before it is said to have reached that destination.
  • slideMoveRange = <iRange>: vgr_shipyard=600 and hgn_scout=0 ; seemingly INT, as no hw2 ships use FL
  • controllerType = <sControllerType>: (e.g. "Ship")

Death Tumble
  • tumbleStaticX = <fAmount> Pitch.
  • tumbleStaticY = <fAmount> Heading.
  • tumbleStaticZ = <fAmount> Roll.
  • tumbleDynamicX = <fAmount> Pitch.
  • tumbleDynamicY = <fAmount> Heading.
  • tumbleDynamicZ = <fAmount> Roll.
  • tumbleSpecialDynamicX = <fAmount> Pitch.
  • tumbleSpecialDynamicY = <fAmount> Heading.
  • tumbleSpecialDynamicZ = <fAmount> Roll.

Relative Move Factor
  • relativeMoveFactor = <fMultiplier>: The value is multiplied by the ship's radius to determine how close, in meters, the ship can get to a piece of terrain, such as an asteroid.

Swaying
  • swayUpdateTime = <fTime>
  • swayOffsetRandomX = <fAmount>
  • swayOffsetRandomY = <fAmount>
  • swayOffsetRandomZ = <fAmount>
  • swayBobbingFactor = <fAmount> Looks to be between 0 and 1.
  • swayRotateFactor = <fAmount> Looks to be between 0 and 1.


Targeting
TargetRandom
  • useTargetRandom = <bEnable> 1 or 0. Activate or desactivate target random. If not activated, enemy ships will shoot toward the ship root point position, if activated, enemy ships shoot at random points in a box defined by the parameters below
  • targetRandomPointXMin = <fAmount> theoretically values between 0 and 1 but greater number seems to work. DON'T KNOW how work exactly this values.use negative value to go left from the root position and positive for right.this is the left side position of the random shooting box.
  • targetRandomPointXMax = <fAmount> this is the right side position of the random shooting box
  • targetRandomPointYMin = <fAmount> use negative value to go down and positive to go up. this is the bottom position of the random shooting box
  • targetRandomPointYMax = <fAmount> this is the top position of the random shooting box
  • targetRandomPointZMin = <fAmount> use negative value to go back and positive to go front.this is the back position of the random shooting box
  • targetRandomPointZMax = <fAmount> this is the front position of the random shooting box


DustCloud and Nebula Damage


Avoidance
Avoidance Capsule
  • MinimalFamilyToFindPathAround = <sFamilyName>: The minimal family of ships that this ship will fly around instead of attempting to fly past. See AvoidanceFamily in the "familylist.lua" file for possible values.


Flight Maneuvers
Maneuvers
  • mirrorAboveManeuver = <sManeuverName>: The ship performs the specified flight maneuver when an enemy is above it.
  • mirrorBelowManeuver = <sManeuverName>: The ship performs the specified flight maneuver when an enemy is below it.


Families


Ship Counter Rating


Construction


Sensors
If the detection on a ship is higher than the cloaking, then it is visible.


UI / Rendering


Commands & Abilities
Docking
  • dockTimeBetweenTwoFormations = <fTime>
  • dockTimeBeforeStart = <fTime>
  • dockNrOfShipsInDockFormation = <iNumberOfShips>
  • dockFormation = <sFormationName>: Formation used while the ship waits to dock. Typically has a value of dockline.
  • queueFormation = <sFormationName> (e.g. "dockline")
  • dontDockWithOtherRaceShips = <bEnable>: This allows you to disable docking with ships that are not of the same race. Needs to be enabled for most frigate and up ships, except the single player ships. (Otherwise, you would be able to recycle ships.)
  • ignoreRaceWhenDocking = <bEnable>: 0 = cannot dock with allies of another race, 1 = can dock with allies of another race.

Launch Command
  • launchTimeBetweenTwoFormations = <fTime>
  • launchTimeBeforeStart = <fTime>
  • launchNrOfShipsInDockFormation = <iNumberOfShips>
  • launchFormation = <sFormationName>: Formation used after the ship launches. Typically has a value of dockline.


Effects



Shared Model Options


Spawn Salvage When Killed
Skeleton
  • spawnShipOnDeath = <sShipName>: This spawns a Skeleton ship when this ship is blown up. The skeleton can be used for debris that dead motherships leave behind. The debris will basically be treated as a megalith. Noone owns it, and noone can select it. The name is tha name of the HOD file to load.


Missing from Ship-Tuning These variables are not described in the Ship-Tuning, but are present in the dump.


Related Pages:

There are 6 comments on this page. [Display comments]

:: ::