How can I create a simple all random trigger/s?

millzy

Ultra Cool Member
Reaction score
44
what u do is
set all the heros
with a varble

e.g set hero[1]pally
hero[2]blood mage



then when its the ar made

Unit - Create 1 hero[(Random integer number between 1 and 2)] for Player 1 (Red) at (your location) facing Default building facing degrees

and do that for all the players

if need more info ask
 

millzy

Ultra Cool Member
Reaction score
44
dont for get to add condition that the player is playing and = to user or you will make heros for players that arnt playing
 

nardretor

New Member
Reaction score
6
Ahm.... Can you please show me the conditions? I dont understand how to put it there And... one problem...

Actually it isn't random cause everytime I restart the game and activate the random hero trigger, the chosen heroes aren't changing. And...

Some heroes are doubled! These must be a way how to solve this...
 

nardretor

New Member
Reaction score
6
DotA template's trigger for all random isn't helpful! If it is, can you please tell me what are the things that should be changed,....
 

Lumograph090

New Member
Reaction score
22
Based on the link you gave, Sir Gordon, I really don't know what kind of variables are those!

I think what you really need to do is read some Tutorials. There are dozens of them all over the net, and many, many dozens located right here on TH.

Take a look at this website, focus mainly on reading the "Beginner Tutorials" section (http://www.jx3.net/TDG/wiki/index.php/Image:Tutorials.gif)

Also, take a look at the Tutorial's and Resources section of this website.
(http://www.thehelper.net/forums/forumdisplay.php?f=131)
 

velnias

New Member
Reaction score
13
unitarray: unit-type array[number of heroes u want random]

Code:
Random
    Events
        Map initialization
    Conditions
    Actions
        Set unitarray[1] = hero1
        Set unitarray[2] = hero2
        Set unitarray[3] = hero3
        Set unitarray[4] = hero4

Code:
Random Pick
    Events
        Player - Player 1 (Red) types a chat message containing -ar as An exact match
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Unit - Create 1 unitarray[(Random integer number between 1 and 4)] for (Picked player) at ((Picked player) start location) facing Default building facing degrees
                Game - Display to (All players) the text: (((Name of (Picked player)) + |r has randomed ) + (Name of (Last created unit)))
                Selection - Select (Last created unit) for (Picked player)

here u go
 

nardretor

New Member
Reaction score
6
I've done that trigger for so many times... It works but it ain't random... It is always the same when you restart the game.
 

Lumograph090

New Member
Reaction score
22
I've done that trigger for so many times... It works but it ain't random... It is always the same when you restart the game.

random action is random.

Unless you've tested this well over a dozen times all 12+ times receiving the same hero then its a little early to claim it isn't working. If you feel this is the issue, test the trigger with only 2 heroes. Again, this will still be a 50/50 chance, but you will get a better idea if its truly broken.
 

velnias

New Member
Reaction score
13
File->preferences->test map-> take off "v" from use fixed random seed

and again stop double posting...
 

nardretor

New Member
Reaction score
6
Thanks, velnias! What you told me made in work... But... sometimes, heroes are doubled... and how can i make player 11 and 12 not to have heroes too? Because, just like what i said, this map is similar to DotA. There are two player slots that doesn't control heroes.
 

velnias

New Member
Reaction score
13
use this
players - player group
Code:
Set players = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))

and change like this

Code:
Player Group - Pick every player in [I][B]players[/B][/I] and do (Actions)
 

nardretor

New Member
Reaction score
6
I solved that problem. The last problem is... the doubled heroes. One type of hero should be only one in the whole game.
 

velnias

New Member
Reaction score
13
herogroup - unit group

Code:
Random
    Events
        Map initialization
    Conditions
    Actions
        Set unitarray[1] = hero1
        Set unitarray[2] = hero2
        Set unitarray[3] = hero3
        Set unitarray[4] = hero4
        For each (Integer A) from 1 to 4, do (Actions)
            Loop - Actions
                Unit Group - Add unitarray[(Integer A)] to herogroup

Code:
Random Pick
    Events
        Player - Player 1 (Red) types a chat message containing -ar as An exact match
    Conditions
    Actions
        Set players = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
        Player Group - Pick every player in players and do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in (Random 1 units from herogroup) and do (Actions)
                    Loop - Actions
                        Unit - Create 1 (Unit-type of (Picked unit)) for (Picked player) at ((Picked player) start location) facing Default building facing degrees
                        Unit Group - Remove (Picked unit) from herogroup
                        Game - Display to (All players) the text: (((Name of (Picked player)) + |r has randomed ) + (Name of (Last created unit)))
                        Selection - Select (Last created unit) for (Picked player)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top