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

How to make random train

Status
Not open for further replies.
You want an ability or a dummy unit that when cast/trained, spawns a unit from a list, yeah?
You need 2 triggers, one to set the group and one to detect the spawning.

  • randominit
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set RandomUnit[1] = Wisp
    • Set RandomUnit[2] = Footman
    • Set RandomUnit[3] = Frost Wyrm
    • Set MaxRandomUnit = 3
And so on, adding more units as you like and setting MaxRandomUnit to how many you added.

  • Events
    • (Either)
    • Unit - A unit finishes Training
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Either)
    • (Unit-type of (Triggering unit)) Equal to RandomUnit
    • (Ability being cast) Equal to RandomAbility
  • Actions
    • Set integer = (Random number between 1 and MaxRandomUnit)
    • Set point = (Position of (Triggering unit))
    • Unit - Create 1 RandomUnit[integer] for (Owner of (Triggering unit)) at point facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_point)
 
Status
Not open for further replies.
Back
Top