3061 Posts in 559 Topics - by 2206 Members - Latest Member: Cozad

Warcraft III: MapsModelsSkinsIconsSpellsToolsTutorials
WC3 JASS: Code SnippetsJASS and vJASS Spells and SystemsJass Tutorials
Chat @Discord

Wiki

Welcome, Guest
to this wiki where you can help improve the wiki pages by editing them.

      CreateUnit

      The CreateUnit native creates a unit. It is defined as follows:

      native CreateUnit takes player id, integer unitid, real x, real y, real face returns unit

      The parameters are as follows:
      • player 'id' (The player for whom the unit is to be created)
      • integer 'unitid' (the unit type id of the unit to be created)
      • real 'x' (the x coordinate at which the unit should be placed)
      • real 'y' (the y coordinate at which the unit should be placed)
      • real 'face' (the angle, in degrees, that the unit should initially face)


      Example:

      Code: jass  [Select]
      1. local unit u = CreateUnit( Player(0), 'hfoo', 10., 40., bj_UNIT_FACING )
      2. /*
      3. Player(0) = Is the first player of the game, the actual owner of the unit about to be generated
      4. 'hfoo' = is the rawcode of the unit type to be created. In this case, 'hfoo' refers to a footman*

      Blizzard Modding Information Center Starcraft II Modding Information Center Wacraft III Modding Information Center WC3JASS.com - The JASS Vault Chronicles of Darkness - A Warcraft III mod Jetcraft - A Starcraft II mod Troll Smash - A Warcraft III Arena
        Mod DB - Change the Game Power of Corruption - A Warcraft III altered melee map Chaos Realm - The world of Game modders and wc3 addicts Follow us on Facebook!!