• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Random Heroes

Status
Not open for further replies.
Level 6
Joined
Jan 2, 2007
Messages
189
I have been looking around and I have not found a very clear awnser.
Players pick a hero from a tavern. If they pick random they get a random hero (duh). ...I can do all that. I just need a way that when a player picks a random hero, no other player can randomize that same hero. Thanks in advance for your replies.
 
Level 2
Joined
Nov 22, 2007
Messages
18
Why don't you make a variable group of hero types.
Then you need to add them to the group.
Before making the trigger.

Then the trigger pick random hero from unit group.
Then remove unit from unit group.

If you don't get it il make it for u.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Hero is a Unit Type variable with arrays (array size is number of heroes)
You need to set every hero in initialization
Events - Map Initialization
Actions-
Set Hero[1] to <Unit Type of 1st hero>
Set Hero[2] to <Unit Type of 2nd hero>
and more

Events - Unit sells unit
Conditions - Unit Type of Sold Unit equal to <Random Unit>
Actions - Unit - Create 1 Hero[Random integer number between 1 and <number of heroes> at <Spawning Location> facing Default Building facing degrees
 
Level 2
Joined
Nov 22, 2007
Messages
18
Hero is a Unit Type variable with arrays (array size is number of heroes)
You need to set every hero in initialization
Events - Map Initialization
Actions-
Set Hero[1] to <Unit Type of 1st hero>
Set Hero[2] to <Unit Type of 2nd hero>
and more

Events - Unit sells unit
Conditions - Unit Type of Sold Unit equal to <Random Unit>
Actions - Unit - Create 1 Hero[Random integer number between 1 and <number of heroes> at <Spawning Location> facing Default Building facing degrees

You forgot Remove all units of unit type last created unit from unit group.
That prevents from getting same hero.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
>.< its no unit group anyway its a tavern if you are looking for trouble or a good hero selection system PM me Ive a great one
 
Status
Not open for further replies.
Top