Hero Randomization Can Pick 2 or more of the same Heroes

Jolly chap*

New Member
Reaction score
34
I've used the tutorial below:

http://world-editor-tutorials.thehelper.net/herotavern.php

This system works and players can get random Heroes. However, I don't want two or more of the same type of Heroes in my map. I believe that this is a common problem and I have searched thehelper.net but have not found a satisfactory solution. Does anyone know of a way to solve this?

Thanks in advance! :D
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
I can give you the most easiest way. Preplace your heroes.

preplace all the possible heroes somewhere in the map, put them all in a unit group at initialization.

when a player wants to pick a random hero do the following:
Trigger:
  • set Hero = (Random unit from Random_Heroes_Group)
    • Unit Group - Remove Hero from Random_Heroes_Group)
    • [... do stuff...]

this way a picked hero is removed from the group and cannot be picked again.
the heroes and their abilities will be preloaded this way also, preventing lag in your game when creating a not loaded unit.

only con of this method is that you have to place these heroes somewhere. you could hide them of course or place them somewhere outside the map bounds though.
 

Jolly chap*

New Member
Reaction score
34
Oops, I've figured it out already. D: Nevermind ...

EDIT: Accidentally double-posted.

Accname, I tried that initially and it worked, but I decided that there had to be a better way to do it. I've figured it out, but thanks anyway! :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top