Tutorial Random Hero Spawning For Hero Arenas

BornANoob[MR]

Member
Reaction score
21
Hey all, i've seen a few posts over the last few days about how to make a random hero chooser for Hero arenas and similar games, so i thought i would post a little trigger which will choose a random hero for you if you are using the old Circle of Power method.

Choosing a random hero by walking into a designated random hero circle:
Code:
Random Hero
    Events
        Unit - A unit comes within 5.00 of Circle of Power 0000 <gen>
    Conditions
        (Unit-type of (Triggering unit)) Equal to (Your Choosing Unit)
    Actions
        Unit - Move (Triggering unit) instantly to (Position of (Random unit from (Units in Region 0000 <gen> matching ((Unit-type of (Matching unit)) Equal to Circle of Power))))

Using a similar trigger to the one above, having everyone choose a random hero, by way of the host typing a message.

Code:
All Random
    Events
        Player - Player 1 (Red) types a chat message containing -ar as An exact match
    Conditions
    Actions
        Trigger - Turn off (This trigger)
        Unit - Move Chooser 0001 <gen> instantly to (Position of Circle of Power 0000 <gen>)
        Unit - Move Chooser 0002 <gen> instantly to (Position of Circle of Power 0000 <gen>)
        Unit - Move Chooser 0003 <gen> instantly to (Position of Circle of Power 0000 <gen>)
        Unit - Move Chooser 0004 <gen> instantly to (Position of Circle of Power 0000 <gen>)
        Wait 0.01 seconds
        Unit - Move Chooser 0005 <gen> instantly to (Position of Circle of Power 0000 <gen>)
        Unit - Move Chooser 0006 <gen> instantly to (Position of Circle of Power 0000 <gen>)
        Unit - Move Chooser 0007 <gen> instantly to (Position of Circle of Power 0055 <gen>)
        Unit - Move Chooser 0008 <gen> instantly to (Position of Circle of Power 0000 <gen>)
        Wait 0.01 seconds
        Unit - Move Chooser 0009 <gen> instantly to (Position of Circle of Power 0000 <gen>)
        Unit - Move Chooser 0010 <gen> instantly to (Position of Circle of Power 0000 <gen>)
        Unit - Move Chooser 0011 <gen> instantly to (Position of Circle of Power 0000 <gen>)
        Unit - Move Chooser 0012 <gen> instantly to (Position of Circle of Power 0000 <gen>)
        Trigger - Turn off (This trigger)

This basically teleports all the choosers to the random chooser circle of power, which in turn selects a random hero!

I hope this helps all you people wanting to select random things, enjoy!
 

BornANoob[MR]

Member
Reaction score
21
Thanks for the reply... As for it being brief/basic, its only a very small part of a very wide topic... much more to come from me.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Your submission must have no memory leaks, yours is filled with leaks.

Plus, this is a system not a tutorial.
 

Exide

I am amazingly focused right now!
Reaction score
448
What's up with the waits and the double Trigger - Turn off function?
 

BornANoob[MR]

Member
Reaction score
21
So it doesnt run until triggered, and stops once heroes have been selected, or it would automatically do it 5000 times
 

Exide

I am amazingly focused right now!
Reaction score
448
I don't believe there's a need for the waits at all.

Code:
Unit - Move Chooser 0007 <gen> instantly to (Position of Circle of Power 0055 <gen>)

This little piggy goes to another circle, it seems.

You only need 1 'Trigger - Turn off (This Trigger)' function. At the top or bottom or in between, doesn't matter. The trigger will run, finish all it's actions and then turn itself off, either way.
And as someone already mentioned, all your 'Unit - Move' functions leaks a point.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top