Changing to Random owner

W

warcraftguy

Guest
Ok what i want to do is change all the units owned by nuetral passive to all the players randomly. Thats easy but i dont know how to make it so that each player gets an equal share.
 
Use the regular change to random owner, but keep a count for each player to see how many units they have. If they have 3 more than anyone else, then they cannot be randomly given a unit, or something along those lines.
 
This will work

Untitled Trigger 001 1
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
P1_Neut_Units Less than 4
Then - Actions
Unit - Change ownership of (Random unit from (Last created unit group)) to Player 1 (Red) and Change color
Set P1_Neut_Units = (P1_Neut_Units + 1)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
P2_Neut_Units Less than 4
Then - Actions
Unit - Change ownership of (Random unit from (Last created unit group)) to Player 2 (Blue) and Change color
Set P2_Neut_Units = (P2_Neut_Units + 1)
Else - Actions
Do nothing

and


Untitled Trigger 002
Events
Time - Elapsed game time is 0.01 seconds
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Passive) and do (Unit Group - To Unit_Group add units in (Entire map) matching ((Picked unit) Equal to (Picked unit)))


and

Untitled Trigger 003
Events
Time - Every 0.02 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Last created unit group) and do (Set Neutral_Passives_Units = (Picked unit))


Variables:

P1_Neut_Units = interger variable
P2_Neut_Units = interger variable
Unit_Group = unit group variable
Neutral_Passives_Units = unit variable

~:D

Edit: make an iterger variable for eatch player then make an if/then/else multi function for eatcher player in the first trigger.
 
No you dont understand im making a risk map and all teh barracks in the begginning are nuetral. Sometimes they are all Player 1.

Its a 12player FFF
 
What's supposed to happen if there's only 11 players?

- some players will get more barracks than others
- some barracks will be unassigned
- you remove those and have empty spots
- some other idea I missed here
 
You can always have a neutral player, like you can have in the real Risk.
 
Well they need to be all withen 1 of each other
I had 24 barracks and this is what came up.

P1: 1 barracks
p2: 1 barracks
p3: 8 Barracks
p4: 3 barracks
and so on....

So i have no idea.
 
Why not just assign the colors instead of randomly giving units evenly to all players. I mean just make them in the same spot all the time. Instead of randomly doing it you could put them all separated so they do not bunch together or just the opposite. You dont have to make it different every time.
 
> Well they need to be all within 1 of each other

This requirement alone makes perfect random almost impossible.


Regions and Start Locations.

As in:

Put region 1, put a start location in region 1, put region 2 near.
Put region 3, put a start location in region 3, put region 4 near.
...
Continue until 24.

Then, if a player's start location is in region 1, he'll get all the barracks in region 1,
and those in region 2.
If a player starts in region 17, he gets those from regions 17 and 18.
And so on.

That's not exactly perfectly random, but it's not that bad either :)
 
Couldn't it be better to store all units into an array, then disorder it, and then give X consecutive units from the array to every player?

Something like this:
Code:
(Well, it's more like "pseudocode") :D

Pick every unit from Neutral and Add it to array
Shuffle the array (Look at Free Trigger Code, use AceHart's code or mine's)
set NumberOfUnitsPerPlayer = Number of units from Neutral / Active player slots
set NextUnit = 0
For every active player
   For A from 0 to NumberOfUnitsPerPlayer - 1 do
       Change owner of Array[NextUnit + A] unit to Picked Player
   set NextUnit = NextUnit + NumberOfUnitsPerPlayer
 
AceHart said:
More random for sure, but what you make of the "they need to be all within 1 of each other"?
I didn't read that part, but nevermind, I didn't understand what it means :confused:
It's something like every barrack has to be assigned to a player?
Try something like this:

Code:
Set Set PLAYERS = (None)
Pick every unit from Neutral and do
    If Player count in (PLAYERS) equals 0 then
        Set PLAYERS = (All Players)
    Set OWNER = Random player from (PLAYERS)
    Remove (OWNER) from (PLAYERS)
    Change (Picked unit) ownership to (OWNER)
You only need a Player Group variable called PLAYERS and a Player variable called OWNER
And I think it's much easier than my previous version.
 
As I read it, it means that all barracks of one player must be really close,
as in, right next, to each other.
Not one on this side of the map and one on the other side...
 
warcraftguy said:
No you dont understand im making a risk map and all teh barracks in the begginning are nuetral. Sometimes they are all Player 1.

Its a 12player FFF

If the units are aradely placed double click on em and you can change the owner to neutral passive, i'll up edit my trigger orciordingly.

~:D

Edit: my trigger will only let eveyone have 3 barracks but chage this
P1_Neut_Units Less than 4
to
P1_Neut_Units Less than 1
 
if you are making RISK type map, you can use trigger like this:
(what is...made with more difficult way? Well...)
[note, 2 triggers]
{This Containts FEW variables...totally}
Randomize Ownership
Code:
    Events
        Map initialization
    Conditions
    Actions
        Set COPName[1] = Gebiet 000 <gen>
        Set Barracks[1] = Amry ks 0001 <gen>
        Set Towers[1] = Tower 0002 <gen>
        Set COPName[2] = Gebiet 001 <gen>
        Set Barracks[2] = Amry ks 0085 <gen>
        Set Towers[2] = Tower 0086 <gen>
        Set COPName[3] = Gebiet 002 <gen>
        Set Barracks[3] = Harbor 0006 <gen>
        Set Towers[3] = Tower 0004 <gen>
        Set COPName[4] = Gebiet 003 <gen>
        Set Barracks[4] = Harbor 0005 <gen>
        Set Towers[4] = Tower 0003 <gen>
        Set COPName[5] = Gebiet 095 <gen>
        Set Barracks[5] = Amry ks 0183 <gen>
        Set Towers[5] = Tower 0184 <gen>
        Set COPName[6] = Gebiet 094 <gen>
        Set Barracks[6] = Amry ks 0043 <gen>
        Set Towers[6] = Tower 0044 <gen>
        Set COPName[7] = Gebiet 093 <gen>
        Set Barracks[7] = Amry ks 0045 <gen>
        Set Towers[7] = Tower 0046 <gen>
        Set COPName[8] = Gebiet 092 <gen>
        Set Barracks[8] = Amry ks 0051 <gen>
        Set Towers[8] = Tower 0052 <gen>
        Set COPName[9] = Gebiet 091 <gen>
        Set Barracks[9] = Amry ks 0049 <gen>
        Set Towers[9] = Tower 0050 <gen>
        Set COPName[10] = Gebiet 090 <gen>
        Set Barracks[10] = Amry ks 0047 <gen>
        Set Towers[10] = Tower 0048 <gen>
        Set COPName[11] = Gebiet 089 <gen>
        Set Barracks[11] = Amry ks 0059 <gen>
        Set Towers[11] = Tower 0060 <gen>
        Set COPName[12] = Gebiet 088 <gen>
        Set Barracks[12] = Amry ks 0053 <gen>
        Set Towers[12] = Tower 0054 <gen>
        Set COPName[13] = Gebiet 087 <gen>
        Set Barracks[13] = Amry ks 0055 <gen>
        Set Towers[13] = Tower 0056 <gen>
        Set COPName[14] = Gebiet 086 <gen>
        Set Barracks[14] = Harbor 0077 <gen>
        Set Towers[14] = Tower 0078 <gen>
        Set COPName[15] = Gebiet 085 <gen>
        Set Barracks[15] = Amry ks 0057 <gen>
        Set Towers[15] = Tower 0058 <gen>
        Set COPName[16] = Gebiet 084 <gen>
        Set Barracks[16] = Amry ks 0065 <gen>
        Set Towers[16] = Tower 0066 <gen>
        Set COPName[17] = Gebiet 083 <gen>
        Set Barracks[17] = Amry ks 0068 <gen>
        Set Towers[17] = Tower 0067 <gen>
        Set COPName[18] = Gebiet 082 <gen>
        Set Barracks[18] = Amry ks 0188 <gen>
        Set Towers[18] = Tower 0187 <gen>
        Set COPName[19] = Gebiet 076 <gen>
        Set Barracks[19] = Amry ks 0064 <gen>
        Set Towers[19] = Tower 0063 <gen>
        Set COPName[20] = Gebiet 077 <gen>
        Set Barracks[20] = Amry ks 0069 <gen>
        Set Towers[20] = Tower 0070 <gen>
        Set COPName[21] = Gebiet 081 <gen>
        Set Barracks[21] = Harbor 0076 <gen>
        Set Towers[21] = Tower 0075 <gen>
        Set COPName[22] = Gebiet 080 <gen>
        Set Barracks[22] = Amry ks 0073 <gen>
        Set Towers[22] = Tower 0074 <gen>
        Set COPName[23] = Gebiet 078 <gen>
        Set Barracks[23] = Amry ks 0189 <gen>
        Set Towers[23] = Tower 0190 <gen>
        Set COPName[24] = Gebiet 079 <gen>
        Set Barracks[24] = Amry ks 0072 <gen>
        Set Towers[24] = Tower 0071 <gen>
        Set COPName[25] = Gebiet 069 <gen>
        Set Barracks[25] = Amry ks 0175 <gen>
        Set Towers[25] = Tower 0176 <gen>
        Set COPName[26] = Gebiet 068 <gen>
        Set Barracks[26] = Amry ks 0179 <gen>
        Set Towers[26] = Tower 0180 <gen>
        Set COPName[27] = Gebiet 067 <gen>
        Set Barracks[27] = Amry ks 0177 <gen>
        Set Towers[27] = Tower 0178 <gen>
        Set COPName[28] = Gebiet 065 <gen>
        Set Barracks[28] = Harbor 0172 <gen>
        Set Towers[28] = Tower 0171 <gen>
        Set COPName[29] = Gebiet 066 <gen>
        Set Barracks[29] = Amry ks 0182 <gen>
        Set Towers[29] = Tower 0181 <gen>
        Set COPName[30] = Gebiet 070 <gen>
        Set Barracks[30] = Amry ks 0173 <gen>
        Set Towers[30] = Tower 0174 <gen>
        Set COPName[31] = Gebiet 023 <gen>
        Set Barracks[31] = Amry ks 0042 <gen>
        Set Towers[31] = Tower 0041 <gen>
        Set COPName[32] = Gebiet 021 <gen>
        Set Barracks[32] = Harbor 0040 <gen>
        Set Towers[32] = Tower 0039 <gen>
        Set COPName[33] = Gebiet 022 <gen>
        Set Barracks[33] = Amry ks 0088 <gen>
        Set Towers[33] = Tower 0087 <gen>
        Set COPName[34] = Gebiet 020 <gen>
        Set Barracks[34] = Amry ks 0037 <gen>
        Set Towers[34] = Tower 0038 <gen>
        Set COPName[35] = Gebiet 019 <gen>
        Set Barracks[35] = Amry ks 0031 <gen>
        Set Towers[35] = Tower 0032 <gen>
        Set COPName[36] = Gebiet 016 <gen>
        Set Barracks[36] = Amry ks 0033 <gen>
        Set Towers[36] = Tower 0034 <gen>
        Set COPName[37] = Gebiet 018 <gen>
        Set Barracks[37] = Amry ks 0025 <gen>
        Set Towers[37] = Tower 0026 <gen>
        Set COPName[38] = Gebiet 017 <gen>
        Set Barracks[38] = Harbor 0030 <gen>
        Set Towers[38] = Tower 0029 <gen>
        Set COPName[39] = Gebiet 015 <gen>
        Set Barracks[39] = Amry ks 0023 <gen>
        Set Towers[39] = Tower 0028 <gen>
        Set COPName[40] = Gebiet 014 <gen>
        Set Barracks[40] = Amry ks 0024 <gen>
        Set Towers[40] = Tower 0027 <gen>
        Set COPName[41] = Gebiet 004 <gen>
        Set Barracks[41] = Harbor 0022 <gen>
        Set Towers[41] = Tower 0021 <gen>
        Set COPName[42] = Gebiet 013 <gen>
        Set Barracks[42] = Amry ks 0019 <gen>
        Set Towers[42] = Tower 0020 <gen>
        Set COPName[43] = Gebiet 012 <gen>
        Set Barracks[43] = Amry ks 0185 <gen>
        Set Towers[43] = Tower 0186 <gen>
        Set COPName[44] = Gebiet 026 <gen>
        Set Barracks[44] = Amry ks 0093 <gen>
        Set Towers[44] = Tower 0094 <gen>
        Set COPName[45] = Gebiet 025 <gen>
        Set Barracks[45] = Amry ks 0089 <gen>
        Set Towers[45] = Tower 0090 <gen>
        Set COPName[46] = Gebiet 024 <gen>
        Set Barracks[46] = Harbor 0092 <gen>
        Set Towers[46] = Tower 0091 <gen>
        Set COPName[47] = Gebiet 008 <gen>
        Set Barracks[47] = Harbor 0013 <gen>
        Set Towers[47] = Tower 0014 <gen>
        Set COPName[48] = Gebiet 009 <gen>
        Set Barracks[48] = Amry ks 0011 <gen>
        Set Towers[48] = Tower 0012 <gen>
        Set COPName[49] = Gebiet 010 <gen>
        Set Barracks[49] = Amry ks 0016 <gen>
        Set Towers[49] = Tower 0015 <gen>
        Set COPName[50] = Gebiet 011 <gen>
        Set Barracks[50] = Amry ks 0035 <gen>
        Set Towers[50] = Tower 0036 <gen>
        Set COPName[51] = Gebiet 005 <gen>
        Set Barracks[51] = Harbor 0017 <gen>
        Set Towers[51] = Tower 0018 <gen>
        Set COPName[52] = Gebiet 006 <gen>
        Set Barracks[52] = Amry ks 0007 <gen>
        Set Towers[52] = Tower 0008 <gen>
        Set COPName[53] = Gebiet 007 <gen>
        Set Barracks[53] = Harbor 0010 <gen>
        Set Towers[53] = Tower 0009 <gen>
        Set COPName[54] = Gebiet 060 <gen>
        Set Barracks[54] = Amry ks 0169 <gen>
        Set Towers[54] = Tower 0170 <gen>
        Set COPName[55] = Gebiet 059 <gen>
        Set Barracks[55] = Amry ks 0169 <gen>
        Set Towers[55] = Tower 0168 <gen>
        Set COPName[56] = Gebiet 058 <gen>
        Set Barracks[56] = Amry ks 0165 <gen>
        Set Towers[56] = Tower 0166 <gen>
        Set COPName[57] = Gebiet 061 <gen>
        Set Barracks[57] = Amry ks 0084 <gen>
        Set Towers[57] = Tower 0083 <gen>
        Set COPName[58] = Gebiet 062 <gen>
        Set Barracks[58] = Amry ks 0289 <gen>
        Set Towers[58] = Tower 0288 <gen>
        Set COPName[59] = Gebiet 063 <gen>
        Set Barracks[59] = Amry ks 0081 <gen>
        Set Towers[59] = Tower 0082 <gen>
        Set COPName[60] = Gebiet 064 <gen>
        Set Barracks[60] = Harbor 0080 <gen>
        Set Towers[60] = Tower 0079 <gen>
        Set COPName[61] = Gebiet 030 <gen>
        Set Barracks[61] = Amry ks 0102 <gen>
        Set Towers[61] = Tower 0101 <gen>
        Set COPName[62] = Gebiet 029 <gen>
        Set Barracks[62] = Amry ks 0099 <gen>
        Set Towers[62] = Tower 0100 <gen>
        Set COPName[63] = Gebiet 028 <gen>
        Set Barracks[63] = Amry ks 0097 <gen>
        Set Towers[63] = Tower 0098 <gen>
        Set COPName[64] = Gebiet 027 <gen>
        Set Barracks[64] = Amry ks 0095 <gen>
        Set Towers[64] = Tower 0096 <gen>
        Set COPName[65] = Gebiet 039 <gen>
        Set Barracks[65] = Amry ks 0120 <gen>
        Set Towers[65] = Tower 0119 <gen>
        Set COPName[66] = Gebiet 040 <gen>
        Set Barracks[66] = Amry ks 0117 <gen>
        Set Towers[66] = Tower 0118 <gen>
        Set COPName[67] = Gebiet 031 <gen>
        Set Barracks[67] = Amry ks 0103 <gen>
        Set Towers[67] = Tower 0104 <gen>
        Set COPName[68] = Gebiet 035 <gen>
        Set Barracks[68] = Amry ks 0109 <gen>
        Set Towers[68] = Tower 0110 <gen>
        Set COPName[69] = Gebiet 032 <gen>
        Set Barracks[69] = Amry ks 0108 <gen>
        Set Towers[69] = Tower 0107 <gen>
        Set COPName[70] = Gebiet 034 <gen>
        Set Barracks[70] = Amry ks 0106 <gen>
        Set Towers[70] = Tower 0105 <gen>
        Set COPName[71] = Gebiet 033 <gen>
        Set Barracks[71] = Amry ks 0286 <gen>
        Set Towers[71] = Tower 0287 <gen>
        Set COPName[72] = Gebiet 041 <gen>
        Set Barracks[72] = Amry ks 0123 <gen>
        Set Towers[72] = Tower 0124 <gen>
        Set COPName[73] = Gebiet 042 <gen>
        Set Barracks[73] = Amry ks 0121 <gen>
        Set Towers[73] = Tower 0122 <gen>
        Set COPName[74] = Gebiet 038 <gen>
        Set Barracks[74] = Amry ks 0111 <gen>
        Set Towers[74] = Tower 0112 <gen>
        Set COPName[75] = Gebiet 037 <gen>
        Set Barracks[75] = Amry ks 0115 <gen>
        Set Towers[75] = Tower 0116 <gen>
        Set COPName[76] = Gebiet 036 <gen>
        Set Barracks[76] = Amry ks 0114 <gen>
        Set Towers[76] = Tower 0113 <gen>
        Set COPName[77] = Gebiet 054 <gen>
        Set Barracks[77] = Amry ks 0152 <gen>
        Set Towers[77] = Tower 0151 <gen>
        Set COPName[78] = Gebiet 055 <gen>
        Set Barracks[78] = Amry ks 0153 <gen>
        Set Towers[78] = Tower 0154 <gen>
        Set COPName[79] = Gebiet 056 <gen>
        Set Barracks[79] = Amry ks 0155 <gen>
        Set Towers[79] = Tower 0156 <gen>
        Set COPName[80] = Gebiet 057 <gen>
        Set Barracks[80] = Harbor 0157 <gen>
        Set Towers[80] = Tower 0158 <gen>
        Set COPName[81] = Gebiet 075 <gen>
        Set Barracks[81] = Harbor 0162 <gen>
        Set Towers[81] = Tower 0161 <gen>
        Set COPName[82] = Gebiet 074 <gen>
        Set Barracks[82] = Amry ks 0163 <gen>
        Set Towers[82] = Tower 0164 <gen>
        Set COPName[83] = Gebiet 073 <gen>
        Set Barracks[83] = Amry ks 0159 <gen>
        Set Towers[83] = Tower 0160 <gen>
        Set COPName[84] = Gebiet 072 <gen>
        Set Barracks[84] = Amry ks 0149 <gen>
        Set Towers[84] = Tower 0150 <gen>
        Set COPName[85] = Gebiet 071 <gen>
        Set Barracks[85] = Amry ks 0147 <gen>
        Set Towers[85] = Tower 0148 <gen>
        Set COPName[86] = Gebiet 053 <gen>
        Set Barracks[86] = Harbor 0146 <gen>
        Set Towers[86] = Tower 0145 <gen>
        Set COPName[87] = Gebiet 052 <gen>
        Set Barracks[87] = Amry ks 0143 <gen>
        Set Towers[87] = Tower 0144 <gen>
        Set COPName[88] = Gebiet 050 <gen>
        Set Barracks[88] = Amry ks 0139 <gen>
        Set Towers[88] = Tower 0140 <gen>
        Set COPName[89] = Gebiet 051 <gen>
        Set Barracks[89] = Harbor 0138 <gen>
        Set Towers[89] = Tower 0137 <gen>
        Set COPName[90] = Gebiet 049 <gen>
        Set Barracks[90] = Amry ks 0135 <gen>
        Set Towers[90] = Tower 0136 <gen>
        Set COPName[91] = Gebiet 048 <gen>
        Set Barracks[91] = Amry ks 0141 <gen>
        Set Towers[91] = Tower 0142 <gen>
        Set COPName[92] = Gebiet 047 <gen>
        Set Barracks[92] = Harbor 0132 <gen>
        Set Towers[92] = Tower 0131 <gen>
        Set COPName[93] = Gebiet 045 <gen>
        Set Barracks[93] = Harbor 0133 <gen>
        Set Towers[93] = Tower 0134 <gen>
        Set COPName[94] = Gebiet 044 <gen>
        Set Barracks[94] = Amry ks 0125 <gen>
        Set Towers[94] = Tower 0126 <gen>
        Set COPName[95] = Gebiet 043 <gen>
        Set Barracks[95] = Amry ks 0127 <gen>
        Set Towers[95] = Tower 0128 <gen>
        Set COPName[96] = Gebiet 046 <gen>
        Set Barracks[96] = Amry ks 0129 <gen>
        Set Towers[96] = Tower 0130 <gen>
        -------- - --------
        Set FirstPlayer = (Random integer number between 1 and 12)
        Set TempVariable = (Random integer number between 2 and 96)
        For each (Integer A) from TempVariable to 96, do (Trigger - Run Assign Ownership <gen> (ignoring conditions))
        For each (Integer A) from 1 to (TempVariable - 1), do (Trigger - Run Assign Ownership <gen> (ignoring conditions))

2nd trigger:

Assign Ownership
Code:
    Events
    Conditions
    Actions
        If (((Player(FirstPlayer)) slot status) Not equal to Is playing) then do (Set FirstPlayer = (FirstPlayer + 1)) else do (Do nothing)
        If (FirstPlayer Greater than 12) then do (Set FirstPlayer = 1) else do (Do nothing)
        If (((Player(FirstPlayer)) slot status) Not equal to Is playing) then do (Set FirstPlayer = (FirstPlayer + 1)) else do (Do nothing)
        If (FirstPlayer Greater than 12) then do (Set FirstPlayer = 1) else do (Do nothing)
        If (((Player(FirstPlayer)) slot status) Not equal to Is playing) then do (Set FirstPlayer = (FirstPlayer + 1)) else do (Do nothing)
        If (FirstPlayer Greater than 12) then do (Set FirstPlayer = 1) else do (Do nothing)
        If (((Player(FirstPlayer)) slot status) Not equal to Is playing) then do (Set FirstPlayer = (FirstPlayer + 1)) else do (Do nothing)
        If (FirstPlayer Greater than 12) then do (Set FirstPlayer = 1) else do (Do nothing)
        If (((Player(FirstPlayer)) slot status) Not equal to Is playing) then do (Set FirstPlayer = (FirstPlayer + 1)) else do (Do nothing)
        If (FirstPlayer Greater than 12) then do (Set FirstPlayer = 1) else do (Do nothing)
        If (((Player(FirstPlayer)) slot status) Not equal to Is playing) then do (Set FirstPlayer = (FirstPlayer + 1)) else do (Do nothing)
        If (FirstPlayer Greater than 12) then do (Set FirstPlayer = 1) else do (Do nothing)
        If (((Player(FirstPlayer)) slot status) Not equal to Is playing) then do (Set FirstPlayer = (FirstPlayer + 1)) else do (Do nothing)
        If (FirstPlayer Greater than 12) then do (Set FirstPlayer = 1) else do (Do nothing)
        If (((Player(FirstPlayer)) slot status) Not equal to Is playing) then do (Set FirstPlayer = (FirstPlayer + 1)) else do (Do nothing)
        If (FirstPlayer Greater than 12) then do (Set FirstPlayer = 1) else do (Do nothing)
        If (((Player(FirstPlayer)) slot status) Not equal to Is playing) then do (Set FirstPlayer = (FirstPlayer + 1)) else do (Do nothing)
        If (FirstPlayer Greater than 12) then do (Set FirstPlayer = 1) else do (Do nothing)
        If (((Player(FirstPlayer)) slot status) Not equal to Is playing) then do (Set FirstPlayer = (FirstPlayer + 1)) else do (Do nothing)
        If (FirstPlayer Greater than 12) then do (Set FirstPlayer = 1) else do (Do nothing)
        If (((Player(FirstPlayer)) slot status) Not equal to Is playing) then do (Set FirstPlayer = (FirstPlayer + 1)) else do (Do nothing)
        If (FirstPlayer Greater than 12) then do (Set FirstPlayer = 1) else do (Do nothing)
        Unit - Change ownership of Barracks[(Integer A)] to (Player(FirstPlayer)) and Change color
        Unit - Change ownership of Towers[(Integer A)] to (Player(FirstPlayer)) and Change color
        Unit - Create 1 Warrior for (Owner of Barracks[(Integer A)]) at (Center of COPName[(Integer A)]) facing Default building facing (270.0) degrees
        Set FirstPlayer = (FirstPlayer + 1)
        If (FirstPlayer Greater than 12) then do (Set FirstPlayer = 1) else do (Do nothing)

I Made Trigger What Does The Same Thing... in risk...

Start Share
Code:
    Events
        Time - Elapsed game time is 0.01 seconds
    Conditions
    Actions
        Unit Group - Pick every unit in (Units of type Warrior) and do (Unit - Make (Picked unit) Invulnerable)
        Unit Group - Pick every unit in (Units of type Circle of Power (large)) and do (Unit - Create 1 Warrior for Player 1 (Red) at (Position of (Picked unit)) facing Default building facing (270.0) degrees)
        Wait 0.05 seconds
        Unit Group - Pick every unit in (Units of type Warrior) and do (Unit - Change ownership of (Picked unit) to (Random player from (All players)) and Change color)
        Wait 1.00 seconds
        Unit Group - Pick every unit in (Units of type Warrior) and do (Unit - Make (Picked unit) Vulnerable)
        Wait 15.00 seconds

questions

Why To make invulnerable?
-Towers Shoot Them If They Aren't they wouldnt be.

Why To Wait 1sec between randoming owners and then changing them back to vulnerable?
-All Buildings doesn't change owner immediately...(probably because there is so many of them)
 
Sorry i should have been more specific. No i want the number of barracks everyone gets to be withen 1 of each other. And no i dont want the barracks to be all next to each other for 1 player.

I was searching the editor and i found a trigger that allows you to pick random (number) of units owned by player
I have been trying but no work yet. Thanks for continueing help guys.
 
Yes i did it!

this is what i did

test
Events
Map initialization
Conditions
Actions
Unit Group - Pick every unit in (Random 4 units from (Units owned by Neutral Passive of type Barracks)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Unit - Change ownership of (Picked unit) to Player 1 (Red) and Change color
Else - Actions



Thanks for all the help guys
 
In the computer world, requirements are constantly evolving :D
Even more when you're the only involved in a project
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    Today I had to scramble, I didn't work most of dinner service and no one told me shit. They had a rough few hours lol
  • Varine Varine:
    I have two salmon, Sockeye and Atlantic. Atlantic is used for the kids salmon and the salmon and beet salad, and can also be added onto any dish or just as a side. Atlantic salmon will almost exclusively ever be FARMED, as it is endangered in the wild, and we ALWAYS cut them to 4 ounces.
  • Varine Varine:
    SOCKEYE salmon, very different and this IS wild caught. We have an ENTREE version, and an add on version. The entree is 7 ounces, the add on is 4. Why? Because that is how someone that wasn't me set up the computer.
  • Varine Varine:
    I had to have this conversation like ten fucking times tonight
  • Varine Varine:
    The issue being, I came into work and had none of this whatsoever
  • Varine Varine:
    No one told me shit
  • Varine Varine:
    So, taking into consideration that what I typed out up there is kind of some fucking nonsense that under normal circumstances no one really needs to fucking be able to explain in any rational way
  • Varine Varine:
    Let alone trying to figure it out from a wildly stressed out me that is also on a phone call trying to get something to show up from Seattle tomorrow while trying to explain this salmon situation, that also is barely solved in maybe a few hours and and but I am bulking it with a few steelhead filets I have and that is a WHOLE fucking different thing to the 19 year old server that got put on day shift C crew that doesn't know who I am.
  • Varine Varine:
    I did however really want days. I like getting off at 4 half the time, and that makes it worth it!
  • Varine Varine:
    Also I hate my job right now but I think that was the hard part. Now it's just work
  • Varine Varine:
    @jonas I'm sorry? I don't know what you're referring to.
  • Varine Varine:
    Once we hit winter I feel like I get to back to having a pretty cool job. Like I bitch about it all the time, but it's work. I'm still gonna bitch
  • Varine Varine:
    All in all though I think this summer is going really well. Some complicated things, but at the end of the day it isn't THAT big of a deal. Not all of our servers have quite realized they are technically sales
  • Varine Varine:
    Like yeah it is a substitute, but FOMO. Chef isn't getting this again this year, he has to figure it out, so it's slightly off on the menu, but that is more or less the LOWEST quality and price. Right now, steelhead is a real stealhear, right?
  • Varine Varine:
    Like fuck off even I can do it
  • Varine Varine:
    I am going to get one of my servers to do that in her server voice and you'll see my point
  • Varine Varine:
    Maybe the bartender. Idk, it's one of my favorite things to hear them go from calm to customer service voice. They will translate it to like "The chef is trying to change that a bit right now so he does have a Alaskan river steelhead. Yeah like the one you might fish probably!" And then the girls can bat their eyes and do pretty girl server shit
  • Varine Varine:
    At least that's how imagine some of them. Did you know mayonnaise is dairy free? A suprisingly amount of people don't\
  • The Helper The Helper:
    mayo is eggs right?
  • The Helper The Helper:
    Seems I never watched the Witcher - looks like i have a lot of content
  • The Helper The Helper:
    Season 1 Episode 8 the marathon continues...
  • jonas jonas:
    mayo is eggs & oil
    +1
  • The Helper The Helper:
    I got halfway season 2 on The Witcher and it lost me. I am going to have to pick this one up again later.
  • jonas jonas:
    season 2 is with the new actor right? it's so far below the first one
  • The Helper The Helper:
    first season was good the 2nd season is bleh I hope I can make it through it for 3

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top