Animation-CobLuaDifferences: Difference between revisions

From Spring
Jump to navigationJump to search
Tobi (talk | contribs)
New page: == Overview of differences between COB unit scripts and Lua unit scripts == * Units of measurement: Lua uses elmos and radians consistently. * Coordinate system: In Lua, coordinate system...
 
Koshi (talk | contribs)
fix category
Line 11: Line 11:
* Where COB uses ''SetSpeed'' and ''SetDirection'', Lua uses ''WindChanged'' and ''ExtractionRateChanged''.
* Where COB uses ''SetSpeed'' and ''SetDirection'', Lua uses ''WindChanged'' and ''ExtractionRateChanged''.
* Lua does not have ''Go'' (this is called for activated extractors immediately after each ''SetSpeed'' call.)
* Lua does not have ''Go'' (this is called for activated extractors immediately after each ''SetSpeed'' call.)
[[Category:Unit_development]]
[[Category:Animation]]
[[Category:Lua]]

Revision as of 18:38, 13 March 2010

Overview of differences between COB unit scripts and Lua unit scripts

  • Units of measurement: Lua uses elmos and radians consistently.
  • Coordinate system: In Lua, coordinate system is same as world coordinate system, with all rotations right-handed. In COB, the moves along the x-axis and rotations around the z-axis have a different sign.
  • In Lua, Killed gets recentDamage and maxHealth as separate arguments. In COB, you get only the ratio recentDamage/maxHealth*100.
  • Where COB uses SetMaxReloadTime, Lua uses GetMaxReloadTime.
  • Where COB uses QueryLandingPadCount and QueryLandingPad, Lua uses QueryLandingPads
  • The x and z arguments to HitByWeapon, HitByWeaponId and RockUnit are given in (x, z) order in Lua, and the opposite order in COB.
  • BeginTransport and EndTransport take the height of the unit in COB and the unitID in Lua. (Use 'local height = Spring.GetUnitHeight(unitID)' to get the height.)
  • TransportDrop gets PACKXZ(x,z) in COB; in Lua, it gets the entire vector (x, y, z) as three arguments.
  • Where COB uses SetSpeed and SetDirection, Lua uses WindChanged and ExtractionRateChanged.
  • Lua does not have Go (this is called for activated extractors immediately after each SetSpeed call.)