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.

      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