-
Notifications
You must be signed in to change notification settings - Fork 31
Units
ChiefOfGxBxL edited this page Jun 2, 2018
·
7 revisions
Translator.Units
var result = new Translator.Units.jsonToWar(unitData);
// Now you can write result.buffer to a war3mapUnits.doo file
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
}
- Dropped item sets
- Waygate
- Unit
flags
- testing it out didn't yield any results for values 0, 1, 2
Made with ❤️ for ⚔️ WarCraft III
Need help: Check the Wiki
Found bug: Create an issue