Jass documentation Database

JASS Documentation Database REFORGED


Results for the query "CreateUnit" as a "function"

The search keyword must be a single word (no spaces).

Function CreateUnit

Line: 2863
Location: common.j
Constant? no
Type: native
Arguments: player id, integer unitid, real x, real y, real face
Returns: unit

Preview

Extra spaces may have been removed from the original file to show the function in a comfortable way.
  1. native CreateUnit takes player id, integer unitid, real x, real y, real face returns unit

Information about CreateUnit

Information contributed by City17
on February 24, 2022, 04:37:37 PM.
creates a unit of type unitid for player id, facing a certain direction at the provided coordinates. Returns handle to unit

Example: Create a human footman for first player (red) at map coordinates -30, 0, facing north:
Code: jass
  1. // Jass
  2. call CreateUnit(Player(0), 'hfoo', -30, 0, 90)
  3. -- Lua
  4. CreateUnit(Player(0), FourCC("hfoo"), -30, 0, 90)


See: bj_UNIT_FACING constant for default facing direction of units in BJ scripts and GUI.

Unit facing is in degrees (type: real). Describes unit rotation:
  • 0   = East
  • 90  = North
  • 180 = West
  • 270 = South
  • -90 = South (wraps around)
Page loaded in 0.0804 seconds.
Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...