Skip to content
ChiefOfGxBxL edited this page Jun 2, 2018 · 7 revisions

Translator

Translator.Units

Usage

var result = new Translator.Units.jsonToWar(unitData);
// Now you can write result.buffer to a war3mapUnits.doo file

Specification

unitData: [<Unit>]; // Array of units

Where <Unit> is a unit structure defined by:

{
  id: <Int>,
  type: <String>, // Unit type - lookup
  variation: <Int = 0>,
  position: [<Float>, <Float>, <Float>], // x,y,z coords
  rotation: <Float = 0>, // in degrees
  scale: [<Float = 1>, <Float = 1>, <Float = 1>], // x,y,z scaling factor
  player: <Int>,
  hitpoints: <Int>,
  mana: <Int = 0>,
  gold: <Int = 0>, // required for gold mines (ugol), optional for all other units
  targetAcquisition: <Int = 0>,
  hero: { <Object = { level: 1, str: 1, agi: 1, int: 1 }> // can safely skip if unit is not a hero
      level: <Int = 1>,
      str: <Int = 1>,
      agi: <Int = 1>,
      int: <Int = 1>
  },
  inventory: [ <Array = []>
      // Up to 6 items: slot index starts at 1,
      // and type is item id string (lookup)
      { slot: <Int>, type: <String> },
      { slot: <Int>, type: <String> }
      ...
  ],
  abilities: [ <Array = []>
      // Array of abilities
      // Ability is ability id string (lookup)
      { ability: <String>, active: <Boolean>, level: <Int> },
      { ability: <String>, active: <Boolean>, level: <Int> },
      ...
  ],
  color: <Int = unit `player` value> // specify custom unit color; defaults to owning player
}

Unsupported fields

  • Dropped item sets
  • Waygate
  • Unit flags - testing it out didn't yield any results for values 0, 1, 2

Translators

World entities

Place entities like units, doodads, etc. on the map

Units (unit or item)
Doodads
Terrain
Regions
Cameras
Sounds

Object definitions

Edit objects in the object editor

Units
Items
Destructables
Doodads
Abilities
Buffs
Upgrades

Other

Miscellaneous files like imports and strings

Imports
Strings
Info

Clone this wiki locally