• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

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