• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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