• 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.

How to make a random monster spawn???

Status
Not open for further replies.
Level 34
Joined
Sep 6, 2006
Messages
8,873
Wrong forum, pretty obviously really. Should be in World Editor Help Zone. Please post in the proper section next time. ;)

There should be good tutorials here.
 
Level 6
Joined
Feb 2, 2005
Messages
205
You need basicly two things first an integer like valkemiere said plus an unit array.

  • Events
    • Your timed Event
  • Conditions
  • Actions
    • Custom script: local location udg_tmppoint
    • -------- This is needed for leak free scripting --------
    • Set randomInt = Random integer number between 1 and 100
    • -------- Here we set a integer Variable to a random Number --------
    • Set tmppoint = Center of (Your Spawn area)
    • -------- we set a variable to the point we want to spawn --------
    • Unit - Create 1 UnitArray[randomInt] for Player 12 at (tmppoint) facing....
    • -------- create a Unit out of an Array using the random Number at the point we set up --------
    • Custom script: call RemoveLocation(udg_tmppoint)
    • -------- With this we remove the used point out of the memory (removeing leaks) --------
To use the Array you will have to set it up in an Map Init Trigger. You could use a smaller Number, that way you wont need that many Units.

  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set UnitArray[1] = Grunt
    • Set UnitArray[2] = BadGuy2
    • Set UnitArray[2] = BadGuy3
    • -------- and so on --------
 
Status
Not open for further replies.
Top