• 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 random train

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2011
Messages
527
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.
Top