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
    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*

    Power of Corruption - A Warcraft III altered melee map   Chaos Realm - The world of Game modders and wc3 addicts     WC3JASS.com - The JASS Vault   Jetcraft - A Starcraft II mod