• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

JASS - create unit at X/Y

Status
Not open for further replies.
Level 12
Joined
Jan 13, 2008
Messages
559
Why does the unit not get created? I use JNGP and don't receive any error while saving, so I guess the custom script is correct?

I have a grid of size 14x16 and want to spawn a unit at a random area in this grid but the unit doesn't appear.

  • PlayerSpawn
    • Events
      • Player - Player 1 (Red) types a chat message containing c as An exact match
    • Conditions
    • Actions
      • Set tempInteger = (Random integer number between 1 and 14)
      • Game - Display to (All players) the text: (String(tempInteger))
      • Set player_X[1] = ((Real(tempInteger)) x 2000.00)
      • Set tempInteger = (Random integer number between 1 and 16)
      • Game - Display to (All players) the text: (String(tempInteger))
      • Set player_Y[1] = ((Real(tempInteger)) x 2000.00)
      • Custom script: call CreateUnit(Player(0), 'htwo', udg_player_X[1],udg_player_Y[1], bj_UNIT_FACING )
 
Status
Not open for further replies.
Top