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

[General] Random Unit

Status
Not open for further replies.
Level 4
Joined
Nov 17, 2015
Messages
91
Hello! I'd like a trigger to create a random unit from a variety of units. Can you tell me how to do this? Pictures appreciated, Thanks in advance! :goblin_good_job:

Other info:
I'm using this to make a random critter spawn after an enemy is killed. :grin:
 

ILH

ILH

Model Reviewer
Level 34
Joined
May 8, 2012
Messages
1,579
Here you go
  • RCreepsConfig
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set RCreepsUnits[1] = Chicken
      • Set RCreepsUnits[2] = Frog
      • Set RCreepsUnits[3] = Rabbit
      • Set RCreepsUnitsTotal = 3
  • RCreepsActive
    • Events
      • Unit - Peasant 0016 <gen> Dies
      • Unit - Peasant 0017 <gen> Dies
    • Conditions
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set RCreepsDice = (Random integer number between 1 and RCreepsUnitsTotal)
      • Unit - Create 1 RCreepsUnits[RCreepsDice] for (Triggering player) at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempPoint)
 

Attachments

  • BeeszBuzz's Request.w3x
    19.2 KB · Views: 44
Last edited:
Level 4
Joined
Nov 17, 2015
Messages
91
Here you go
  • RCreepsConfig
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set RCreepsUnits[1] = Chicken
      • Set RCreepsUnits[2] = Frog
      • Set RCreepsUnits[3] = Rabbit
      • Set RCreepsUnitsTotal = 3
  • RCreepsActive
    • Events
      • Unit - Peasant 0016 <gen> Dies
      • Unit - Peasant 0017 <gen> Dies
    • Conditions
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set RCreepsDice = (Random integer number between 1 and RCreepsUnitsTotal)
      • Unit - Create 1 RCreepsUnits[RCreepsDice] for (Triggering player) at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempPoint)

Sorry for late reply, but this is the most awesome post i've ever gotten in a response! Thanks a million!!!
 
Status
Not open for further replies.
Top