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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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