All Random Doesnt work

danpe

New Member
Reaction score
5
I did all random trigger, this is the setup trigger:

Code:
Tavern Initialization
    Events
        Map initialization
    Conditions
    Actions
        Set TotalHeroes = 11
        Set RandomCount = 11
        Set Hero_Array[1] = Dark Paladin
        Set Hero_Array[2] = Feral Paladin
        Set Hero_Array[3] = Fire Paladin
        Set Hero_Array[4] = Frost Paladin
        Set Hero_Array[5] = Holy Paladin
        Set Hero_Array[6] = Light Paladin
        Set Hero_Array[7] = Nature Paladin
        Set Hero_Array[8] = Thunder Paladin
        Set Hero_Array[9] = Voodoo Paladin
        Set Hero_Array[10] = Water Paladin
        Set Hero_Array[11] = Wind Paladin
        For each (Integer A) from 1 to 11, do (Actions)
            Loop - Actions
                Set RandomData[(Integer A)] = (Integer A)
About the vairbels:
Code:
TotalHeroes = 11 [B](Integer)[/B]
RandomCount = 11 [B](integer)[/B]
Hero_Array[x] = x [B](Unit-Type Array, Size 11)[/B]
RandomData[x] = x [B](Integer Array, Size 11)[/B]

And this is the random trigger:

Code:
Run All Random
    Events
    Conditions
    Actions
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Player((Integer A))) slot status) Equal to Is playing
                    Then - Actions
                        Set RandomHero = (Random integer number between 1 and RandomCount)
                        Unit - Create 1 Hero_Array[RandomData[RandomHero]] for (Player((Integer A))) at ((Player((Integer A))) start location) facing Default building facing degrees
                        Camera - Pan camera for (Owner of (Last created unit)) to ((Owner of (Last created unit)) start location) over 0.00 seconds
                        Selection - Select (Last created unit) for (Owner of (Last created unit))
                        Game - Display to (All players) the text: ((Name of (Owner of (Last created unit))) + ( has randomed  + (Name of (Last created unit))))
                        Player - Set name of (Owner of (Last created unit)) to ((Name of (Owner of (Last created unit))) + (  + (( + ((Name of (Last created unit)) + )))))
                        Set RandomData[RandomHero] = RandomCount
                        Set RandomCount = (RandomCount - 1)
                    Else - Actions
                        Do nothing

But when i test the game i always get the same hero...

[I did exectly what they said Here.]
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Idk why you always get the same hero, but I believe that only player 1 can get the 11th hero... Because after the first player randoms, you set RandomCount = RandomCount - 1
which is 10, then player 2 picks a random hero betweem 1st and 10th, so he cant have the 11th hero, even if player 1 didnt pick the 11th hero...
 

danpe

New Member
Reaction score
5
It's ok this is not my problam...

my problam is when i play each player gets the same hero all the time...
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
EDIT: ups my mistake sry...

did you tried turning off random seed thingy? in map preferences > test map
 

danpe

New Member
Reaction score
5
The first one, the Dark Paladin.

Dinowc said:
it's probably cause of this:


Code:
Hero_Array[RandomData[RandomHero]]I can't see anywhere you are setting that variable

look here:
Code:
Set RandomHero = (Random integer number between 1 and RandomCount)
 

danpe

New Member
Reaction score
5
My Random Seed isnt checked...
is it a problam?

and its not heppens only when i test the map through World Editor...
When i play the map on Battle.net too..

About my vairbels:
Code:
TotalHeroes = 11 [B](Integer)[/B]
RandomCount = 11 [B](integer)[/B]
Hero_Array[x] = x [B](Unit-Type Array, Size 11)[/B]
RandomData[x] = x [B](Integer Array, Size 11)[/B]
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
You could use a different method

like, use preplaced units in a corner

Code:
For each Integer A from 1 to 8 do
   Pick random unit in Corner <gen> and do
      Change ownership of picked unit to Player(Integer A)
      Move picked unit to Player(Integer A) start location
Pick All Units in Corner <gen> and Remove Picked unit
 

danpe

New Member
Reaction score
5
Why is that?

and if player dosent want random mode theu nit will be at the corner?
i dont like that idea...
and i dont think this is the problam...
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Fine then, stay with your problems

My method would work, but w/e

I don't know why your trigger isnt working correctly, all I did was suggest an alternative way >>
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Just so you know, random doesn't work well in test game... try to host it and see what happens ;)
 

RaiJin

New Member
Reaction score
40
wtf theres random seed? where? i can't find it


O_O i have the same problem too LuL
 

danpe

New Member
Reaction score
5
You could use a different method

like, use preplaced units in a corner

Code:
For each Integer A from 1 to 8 do
   Pick random unit in Corner <gen> and do
      Change ownership of picked unit to Player(Integer A)
      Move picked unit to Player(Integer A) start location
Pick All Units in Corner <gen> and Remove Picked unit

Look at my trigger now...:

Code:
Run All Random
    Events
    Conditions
    Actions
        For each (Integer A) from 1 to 11, do (Actions)
            Loop - Actions
                Unit - Create 1 Hero_Array[(Integer A)] for Neutral Passive at (Center of Random Region <gen>) facing Default building facing degrees
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Player((Integer A))) slot status) Equal to Is playing
                    Then - Actions
                        Set RandomHero = (Random unit from (Units in Random Region <gen>))
                        Unit - Change ownership of RandomHero to (Player((Integer A))) and Change color
                        Unit - Move RandomHero instantly to ((Owner of RandomHero) start location)
                        Camera - Pan camera for (Owner of RandomHero) to ((Owner of RandomHero) start location) over 0.00 seconds
                        Selection - Select RandomHero for (Owner of RandomHero)
                        Game - Display to (All players) the text: ((Name of (Owner of RandomHero)) + ( has randomed  + (Name of RandomHero)))
                        Player - Set name of (Owner of RandomHero) to ((Name of (Owner of RandomHero)) + (  + (( + ((Name of RandomHero) + )))))
                    Else - Actions
                        Do nothing
        Unit Group - Pick every unit in (Units in Random Region <gen>) and do (Unit - Remove (Picked unit) from the game)

Thanks to you its working :D
 

danpe

New Member
Reaction score
5
All Random Problam...

This is my trigger:

Code:
Run All Random
    Events
    Conditions
    Actions
        For each (Integer A) from 1 to 11, do (Actions)
            Loop - Actions
                Set TEMP_SpawnReinforcmentPoint = (Random point in Random Region <gen>)
                Unit - Create 1 Hero_Array[(Integer A)] for Neutral Passive at TEMP_SpawnReinforcmentPoint facing Default building facing degrees
                Custom script:   call RemoveLocation(udg_TEMP_SpawnReinforcmentPoint)
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Player((Integer A))) slot status) Equal to Is playing
                    Then - Actions
                        Set RandomHero = (Random unit from (Units in Random Region <gen>))
                        Unit - Change ownership of RandomHero to (Player((Integer A))) and Change color
                        Unit - Move RandomHero instantly to ((Owner of RandomHero) start location)
                        Camera - Pan camera for (Owner of RandomHero) to ((Owner of RandomHero) start location) over 0.00 seconds
                        Selection - Select RandomHero for (Owner of RandomHero)
                        Game - Display to (All players) the text: ((Name of (Owner of RandomHero)) + ( has randomed  + (Name of RandomHero)))
                        Player - Set name of (Owner of RandomHero) to ((Name of (Owner of RandomHero)) + (  + (( + ((Name of RandomHero) + )))))
                    Else - Actions
                        Do nothing
        Set TEMP_UnitsInRainforcment = (Units in Random Region <gen>)
        Unit Group - Pick every unit in TEMP_UnitsInRainforcment and do (Unit - Remove (Picked unit) from the game)
        Custom script:   call DestroyGroup(udg_TEMP_UnitsInRainforcment)

everytime i play All Random mode same player get the same unit...

it isnt random at all -.-
 

danpe

New Member
Reaction score
5
All Random Doesnt work...

This is my trigger:

Code:
Run All Random
    Events
    Conditions
    Actions
        For each (Integer A) from 1 to 11, do (Actions)
            Loop - Actions
                Set TEMP_SpawnReinforcmentPoint = (Random point in Random Region <gen>)
                Unit - Create 1 Hero_Array[(Integer A)] for Neutral Passive at TEMP_SpawnReinforcmentPoint facing Default building facing degrees
                Custom script:   call RemoveLocation(udg_TEMP_SpawnReinforcmentPoint)
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Player((Integer A))) slot status) Equal to Is playing
                    Then - Actions
                        Set RandomHero = (Random unit from (Units in Random Region <gen>))
                        Unit - Change ownership of RandomHero to (Player((Integer A))) and Change color
                        Unit - Move RandomHero instantly to ((Owner of RandomHero) start location)
                        Camera - Pan camera for (Owner of RandomHero) to ((Owner of RandomHero) start location) over 0.00 seconds
                        Selection - Select RandomHero for (Owner of RandomHero)
                        Game - Display to (All players) the text: ((Name of (Owner of RandomHero)) + ( has randomed  + (Name of RandomHero)))
                        Player - Set name of (Owner of RandomHero) to ((Name of (Owner of RandomHero)) + (  + (( + ((Name of RandomHero) + )))))
                    Else - Actions
                        Do nothing
        Set TEMP_UnitsInRainforcment = (Units in Random Region <gen>)
        Unit Group - Pick every unit in TEMP_UnitsInRainforcment and do (Unit - Remove (Picked unit) from the game)
        Custom script:   call DestroyGroup(udg_TEMP_UnitsInRainforcment)

everytime i play All Random mode same player get the same unit...

it isnt random at all -.-
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Do you test it on B.net ? otherwise you need to uncheck Use Fixed Random Seed in Gameplay Constants (or where it is XD)
 

danpe

New Member
Reaction score
5
Thats my finel and working All Random!

Trigger:
  • Tavern Initialization
    • Events
    • Conditions
    • Actions
      • Set Hero_Array[1] = Dark Paladin
      • Set Hero_Array[2] = Feral Paladin
      • Set Hero_Array[3] = Fire Paladin
      • Set Hero_Array[4] = Frost Paladin
      • Set Hero_Array[5] = Holy Paladin
      • Set Hero_Array[6] = Light Paladin
      • Set Hero_Array[7] = Nature Paladin
      • Set Hero_Array[8] = Thunder Paladin
      • Set Hero_Array[9] = Voodoo Paladin
      • Set Hero_Array[10] = Water Paladin
      • Set Hero_Array[11] = Wind Paladin


Than after few seconds...

Trigger:
  • Run All Random
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 11, do (Actions)
        • Loop - Actions
          • Set TEMP_SpawnReinforcmentPoint = (Random point in Random Region &lt;gen&gt;)
          • Unit - Create 1 Hero_Array[(Integer A)] for Neutral Passive at TEMP_SpawnReinforcmentPoint facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TEMP_SpawnReinforcmentPoint)
      • Game - Display to (All players) for 3.00 seconds the text: Randomizing...
      • Unit Group - Pick every unit in (Units in Random Region &lt;gen&gt;) and do (Unit - Move (Picked unit) instantly to (Random point in Random Region &lt;gen&gt;))
      • Wait 3.00 seconds
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Set RandomHero = (Random unit from (Units in Random Region &lt;gen&gt;))
              • Unit - Change ownership of RandomHero to (Player((Integer A))) and Change color
              • Unit - Move RandomHero instantly to ((Owner of RandomHero) start location)
              • Camera - Pan camera for (Owner of RandomHero) to ((Owner of RandomHero) start location) over 0.00 seconds
              • Selection - Select RandomHero for (Owner of RandomHero)
              • Game - Display to (All players) the text: ((Name of (Owner of RandomHero)) + ( has randomed + (Name of RandomHero)))
              • Player - Set name of (Owner of RandomHero) to ((Name of (Owner of RandomHero)) + ( + (( + ((Name of RandomHero) + )))))
            • Else - Actions
              • Do nothing
      • Set TEMP_UnitsInRainforcment = (Units in Random Region &lt;gen&gt;)
      • Unit Group - Pick every unit in TEMP_UnitsInRainforcment and do (Unit - Remove (Picked unit) from the game)
      • Custom script: call DestroyGroup(udg_TEMP_UnitsInRainforcment)


Thank you all for helping its now working :D
 
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

      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