• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Creating units not working

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2011
Messages
527
i was making a wave system for my map, but then i ran into some problems.

at map init, i set each trigger, unit-type, and unit spawning point to a variable:
  • trigger init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set spawn = (Center of unitspawn <gen>)
      • Set wavetrigger[1] = W1 <gen>
      • Set wavetrigger[2] = W2 <gen>
      • Set wavetrigger[3] = W3 <gen>
      • Set wavetrigger[4] = W4 <gen>
      • Set wavetrigger[5] = W5 <gen>
      • Set wavetrigger[6] = W6 <gen>
      • Set wavetrigger[7] = W7 <gen>
      • Set wavetrigger[8] = W8 <gen>
      • Set wavetrigger[9] = W9 <gen>
      • Set unit[0] = Unit 1
      • Set unit[1] = Unit 2
      • Set unit[2] = Unit 3
      • Set unit[3] = Unit 4
      • Set unit[4] = Unit 5
      • Set unit[5] = Unit 6
      • Set unit[6] = Unit 7
      • Set unit[7] = Unit 8
      • Set unit[8] = Unit 9
      • Set unit[9] = Unit 10
      • Set unit[10] = Unit 11
      • Set unit[11] = Unit 12
i made a trigger that starts every wave:
(i have another trigger that activates this)

  • wave timer
    • Events
      • Time - t expires
    • Conditions
    • Actions
      • Set r = (Random real number between 25.00 and 40.00)
      • Countdown Timer - Start t as a One-shot timer that will expire in r seconds
      • Set currentwave = (currentwave + 1)
      • Trigger - Run wavetrigger[currentwave] (ignoring conditions)
      • Trigger - Run wave attack <gen> (ignoring conditions)
each wave trigger just spawns the types of units for that wave:
(i added in some testing)
  • W1
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: this runs
      • For each (Integer loop) from 1 to 2, do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: this runs
          • Set i = (Random integer number between 0 and 1)
          • Unit - Create 1 unit[i] for Player 12 (Brown) at spawn facing Default building facing degrees
          • Game - Display to (All players) the text: (Name of (Last created unit))
      • Game - Display to (All players) the text: this runs
      • Set i = (Random integer number between 6 and 7)
      • Unit - Create 1 unit[i] for Player 12 (Brown) at spawn facing Default building facing degrees
      • Game - Display to (All players) the text: (Name of (Last created unit))
my problem is, the triggers run perfectly, but the units do not spawn. can anyone help me know why this is happening?


nevermind, i was just being dumb, it's fixed now.
 
My best guess is you are destroying the point "spawn" at somewhere.

Here my guess list:
2)Make sure unit is a valid unit type.Try displaying the name of unit type u
3)Try changing player from player 12 to you(player 1?), there might be a problem if your wave units cost food.(This happens with heroes, but don't think happens with normal units, this is very less likely anyway)
4)Maybe your point spawn is not a valid for unit creation.(blocked?) Try using center of someRegion directly.This solution also valid for problem 1.
 
Status
Not open for further replies.
Back
Top