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

[Trigger] Randomizing problem (Random Hero selection, AoS Map)

Status
Not open for further replies.
Level 3
Joined
May 29, 2007
Messages
50
So yeah, I've been having trouble with a trigger-made random selection system in an AoS map I've been making.

I'm not at my computer currently, so I won't be able to write up a whole GUI trigger here accurately without reference of the editor itself. But yeah, it's still pretty clear.

  • Random P1
    • Events
      • Game - Player1(Red) types message -random
    • Conditions
    • Actions
      • SetVar HeroGroupAlliance[1]=Alleria
      • SetVar HeroGroupAlliance[2]=Turalyon
      • SetVar HeroGroupAlliance[3]=Danath
      • SetVar HeroGroupAlliance[4]=Khadgar
      • SetVar HeroGroupAlliance[5]=Kurdran
      • SetVar HeroGroupAlliance[6]=Lothar
      • Unit - Create 1 HerogroupAlliance[Random number between 1 and 6] for Player1(Red) at Center of HumanTavern <gen> facing 90.00 deg
Note: HeroGroupAlliance is not a unit group, but a unit-type var.

In case anyone is wondering, when they appear at the tavern region where they would be bought, it would make the buyer (a peasant in this case) die and then the Hero would be teleported to the base.

But here's the thing: it picks a random number and it stays with that number, causing me to always pick a Khadgar, for example. So it just grabs a number and sticks with it instead of grabbing another random number again.

Anyone got an idea on how to fix this?
 
Status
Not open for further replies.
Top