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,456
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 The Helper:
    Happy Friday Night!
    +1
  • V-SNES V-SNES:
    Happy Friday Night!
    +1
  • The Helper The Helper:
    Going out of a town for the weekend will be back sunday night! Hope everyone has a great weekend!
    +2
  • The Helper The Helper:
    Happy Monday!
  • Ghan Ghan:
    Monday? Speak for yourself. :p
    +2
  • The Helper The Helper:
    Happy Taco Tuesday!
    +1
  • The Helper The Helper:
    Tacos! :)
  • The Helper The Helper:
    Check out the discord for taco pictures :) You cannot put pictures in this chat
    +1
  • The Helper The Helper:
    Damn here come the bots again - 193 online but they are totally invisible to any stats - bunch of bots!'
  • C cubanismo:
    Re: Taco Tuesday, if there were some way to share edible tacos over the internet, technology would be complete.
    +2
  • The Helper The Helper:
    One can only wish!
  • tom_mai78101 tom_mai78101:
    I'm back from Taiwan
    +1
  • The Helper The Helper:
    I am reorganizing the site I know nobody will notice but I am not done quite yet but the main forums order has been changed and there is a new news category in Other News which is all the remaining headline news stuff not categorized - Headline News is just the stuff that shows on the main page now and the news archive is off the main forums page
  • The Helper The Helper:
    and the real archive lives off of headline news
  • The Helper The Helper:
    Happy Monday!
  • V-SNES V-SNES:
    Happy Saturday!
  • The Helper The Helper:
    Happy Saturday Night!

    The Helper Discord

    Members online

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top