Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Randomized Order
Randomized Order
Jan 20 2022, 11:40 pm
By: Prankenstein
Pages: 1 2 34 >
 

Jan 20 2022, 11:40 pm Prankenstein Post #1



I'm creating a defense map with multiple enemy waves and 6 zones, 1 zone per player. At the start of each wave, I want to randomize the zone that each player will occupy.

Example of different player zone orders:

1 2 3 4 5 6
1 4 3 2 5 6
2 1 4 6 5 3
...

It's my understanding that there's 720 possible combinations of these, so I can't simply randomize 10 different switches in one go and check the 1024 outcomes.

I'm thinking of just using 3 switches (8 outcomes) and start with Player 1 to randomize his position between 1 and 6. Then randomize Player 2's position, and if it lands on the same position as Player 1, rerun the randomization until it lands on a number not already assigned to a player. And so on until Player 6. This might be tricky but I think I can pull it off.

My question: Is there an easier, more elegant way of doing this that I'm not thinking of? Thanks!



None.

Jan 21 2022, 3:46 am NudeRaider Post #2

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

How about randomized player starting locations?

IIRC that doesn't change the positions of start locations of what sc / triggers consider player 1, player 2, etc., but the players from the lobby are assigned a player number at random rather than it being defined by position in the lobby.




Jan 21 2022, 4:16 am Prankenstein Post #3



Quote from NudeRaider
How about randomized player starting locations?

IIRC that doesn't change the positions of start locations of what sc / triggers consider player 1, player 2, etc., but the players from the lobby are assigned a player number at random rather than it being defined by position in the lobby.

Thanks for the reply. I need the locations to be shuffled randomly after each round, not just the start of the game. So basically, I'd like to efficiently emulate the behavior of random start locations, via triggers.



None.

Jan 21 2022, 9:20 am UndeadStar Post #4



In programming, such an algorithm could be used:
Code
integer possibleLocations[6]; //for a zero-indexed array

for(integer i = 5; i >= 0; i--) {
    int randomIndex = Random(0,i); //Random(min,max) being a placeholder for a way to get a number between min and max
    playerLocation[i] = possibleLocations[randomIndex];
    possibleLocations[randomIndex] = possibleLocations[i-1];
}

The idea is that after you pick a value from the array, you put the last value of the array in its place, then on the next loop, you work with a smaller array because i is effectively what's considered the last index of the array.
It lacks a bit of user-friendliness because of assigning locations to the last player first, then the other in decreasing orders, but aside from that, it should work.
Not sure how much it's possible to adapt this algorithm to EUD or whatever you're using, but I'm proposing it.

Just make sure you don't end up like Blizzard SC2 Coop map Temple of the Past, messing something, and ending up with a location never used and in the worst case the same always used :lol:
Hopefully, I haven't reproduced their mistake here :blush:




Jan 21 2022, 7:05 pm Prankenstein Post #5



Quote from UndeadStar
In programming, such an algorithm could be used:
Code
integer possibleLocations[6]; //for a zero-indexed array

for(integer i = 5; i >= 0; i--) {
    int randomIndex = Random(0,i); //Random(min,max) being a placeholder for a way to get a number between min and max
    playerLocation[i] = possibleLocations[randomIndex];
    possibleLocations[randomIndex] = possibleLocations[i-1];
}

The idea is that after you pick a value from the array, you put the last value of the array in its place, then on the next loop, you work with a smaller array because i is effectively what's considered the last index of the array.
It lacks a bit of user-friendliness because of assigning locations to the last player first, then the other in decreasing orders, but aside from that, it should work.
Not sure how much it's possible to adapt this algorithm to EUD or whatever you're using, but I'm proposing it.

Just make sure you don't end up like Blizzard SC2 Coop map Temple of the Past, messing something, and ending up with a location never used and in the worst case the same always used :lol:
Hopefully, I haven't reproduced their mistake here :blush:

I'm using vanilla triggers, switches, and death counts, so not sure how much of this can be applied. However, I'm interested in your logic as it could potentially help me find an answer. I tried porting your code into javascript and running in my browser, but I'm receiving duplicate values in the final string, e.g. 332416, and the number 6 rarely shows up (as there's most likely just a 1 in 6 chance)

Code
<script>
var possibleLocations = [1,2,3,4,5,6];
var playerLocations = [];
var randomIndex;

for(var i = 5; i >= 0; i--)
{
    randomIndex = randomInteger(0, i);
    playerLocations[i] = possibleLocations[randomIndex];
    possibleLocations[randomIndex] = possibleLocations[i-1];
}

var result = '';
playerLocations.forEach(playerLocation => result += playerLocation);
document.write(result);

function randomInteger(min, max)
{
   return Math.floor(Math.random() * (max - min + 1)) + min;
}
</script>




None.

Jan 21 2022, 7:30 pm Prankenstein Post #6



I've thought up one solution that I'm considering to try.

- Create a location in the corner of the map called "Randomize Locations", and at the start of each round I place one invincible zergling for each player there.
- Run AI Script: Junkyard Dog at that location to cause the zerglings to run around aimlessly.
- Remove one zergling from the location at a time, the first player to lose a zergling will be assigned to Zone 1, the second player to lose a zergling assigned to Zone 2, and so on.

I believe the trigger will always remove the leftmost zergling first, so it should be fairly random. If anyone can weigh in on the viability of this before I take time to implement, or if there's a better way, I'd very much appreciate it.



None.

Jan 21 2022, 11:38 pm DarkenedFantasies Post #7

Roy's Secret Service

If you don't mind the process taking longer than 1 game frame, you can do something simple like this:

Collapse Box


You could probably speed it up by doing stuff like using burrowed zerglings on every slot and centering the location on the nearest free spot if randomizing on an occupied one. Or at least do that for the 6th player (which is not necessarily player 6 btw) as that's the most time-expensive one.




Jan 22 2022, 12:19 am Prankenstein Post #8



If you don't mind the process taking longer than 1 game frame, you can do something simple like this:

Collapse Box


You could probably speed it up by doing stuff like using burrowed zerglings on every slot and centering the location on the nearest free spot if randomizing on an occupied one. Or at least do that for the 6th player (which is not necessarily player 6 btw) as that's the most time-expensive one.


Wow. I really admire the work you put into this, but I must admit, your solution is going straight over my head. I've never altered the memory addresses before. I assume this is some kind of EUD modification? I'd definitely like to understand what's going on here, before I try to implement it into my map. I'll have to dive into some EUD guides and throw this into a sandbox map to see if I can get my head around this stuff. I'm sure it will open up a lot of doors for me. Thanks so much.



None.

Jan 22 2022, 1:04 am DarkenedFantasies Post #9

Roy's Secret Service

Aside from the single-frame hypers at the bottom, the MemoryAddr triggers are only modifying a location's edges. I thought my comments were clear enough but I suppose I can provide a demo map and more elaborate comments.




Jan 22 2022, 1:13 am Prankenstein Post #10



Aside from the single-frame hypers at the bottom, the MemoryAddr triggers are only modifying a location's edges. I thought my comments were clear enough but I suppose I can provide a demo map and more elaborate comments.

Much appreciated and it is already starting to make more sense now with that clarification. No need for a demo map just yet. I'll give it my due diligence first and see what I come up with. Thanks again.



None.

Jan 22 2022, 1:47 am DarkenedFantasies Post #11

Roy's Secret Service

Too late. Here u go.

Attachments:
!randomization.scx
Hits: 2 Size: 23.39kb




Jan 22 2022, 9:20 am TheHappy115 Post #12



While I don't know if it works, my solution to the problem without EUD triggers would involve something like:

1) Create a Setup Zone (this means the map need to set up)
2) Have a switch for Players 1 - 6 and Lane 1 - 6 (1 each, set to Off since its defaulted)
3) If Lane 1 is Off, means needs to be filled, randomize switches 1,2,3. If the result is invalid, just do it again. The condition may look something like this:
If: Switch 1: Off, Switch 2: Off, Switch 3: Off, Player 1: Off, Lane 1: Off ->
Then: Center Location "Player 1 Spawns" at "Section 1", Player 1: On, Lane 1: On, Lane 2: Off

Now the question is, what if it randomizes and lands on switch 1, 2, 3 again? Well, since Player 1 is now On, it won't set it onto the new location. Furthermore, the condition sets lane 1 to On (so it won't be used) and sets Lane 2 to off (meaning the next lane used is lane 2). You would do the same, with increment.

Now this set of triggers is at least 6 triggers per lane (meaning 36 triggers in total which is still a decent amount but much better than the 720)

For Leavers: Ideally, you could just assign the lanes to non-existing players still. Aka, if Player 4 left and he is assigned Lane 3, you can still just have all the triggers go off and it should still work.

Issues with this method:
1) This will have issues if you want the player to always be in the left most lane (I.E. 6 players = first 6 lanes, while 4 players is the 4 lanes. This method instead have 4 players spread randomly between those 6 lanes with the other 2 being assigned to non-existing players)
2) Technically, this solution could cause the times between lane sections be indefinite. This is because with 3 switches, the chances of the a player being picked is 75% per trigger check on lane 1, then 62.5%, 50%, 37.5%, and 25% on lane 5. (Lane 6, you can just remove the randomized switches since there is only 1 option left). In this instance, even if the trigger is being checked about 8 times per second with hyper triggers, there is still a chance that the 25% effect misses 8 times in a row (Delaying game by 1 second). This increases each time it misses (although very unlikely). In terms of chances of it to happen (8 times in a row is about 10%, and 24 times in a row would be about 0.1% chance of happening. It will happen, its just rare and if you can work around a couple of seconds of missing time, it should still be fine then)
3) This is just my assumption, so correct me if I'm wrong. A good way to check is by simply doing it with 3 players at first with 2 lanes and expanding from there (as that would only be 6 triggers)

Summary of Advanages:
- Avoids using EUDs which are a bit complex (and hard to read if not using an editor or unfamiliar with)
- 720 -> 36 triggers, Much easier to work with.
- Should work each round. Just remember to set all players switches to "Off".
- Still works when a player leaves (look at disadvantages for details too)

Summary of Disadvantages:
- Unknown if truly works (not tested)
- Chance of delay between rounds assigning players the lane (with minimum of 6 trigger instances)
- Does not remove the "final" lanes when a player leaves (still assign randomly). (Can get instances of: 3 4 - 1 - 6 (Where Players: 2 & 5 left)
- Possibly other things (takes 15 switches to work)

Post has been edited 2 time(s), last time on Jan 22 2022, 9:28 am by TheHappy115.



None.

Jan 22 2022, 10:52 am UndeadStar Post #13



Quote from Prankenstein
Code
<script>
var possibleLocations = [1,2,3,4,5,6];
var playerLocations = [];
var randomIndex;

for(var i = 5; i >= 0; i--)
{
    randomIndex = randomInteger(0, i);
    playerLocations[i] = possibleLocations[randomIndex];
    possibleLocations[randomIndex] = possibleLocations[i-1];
}

var result = '';
playerLocations.forEach(playerLocation => result += playerLocation);
document.write(result);

function randomInteger(min, max)
{
   return Math.floor(Math.random() * (max - min + 1)) + min;
}
</script>
My bad, I hesitated between 2 things, and ended up making a mistake, your js code can be fixed into:
Code
<script>
var possibleLocations = [1,2,3,4,5,6];
var playerLocations = [];
var randomIndex;

for(var i = 5; i >= 0; i--)
{
    randomIndex = randomInteger(0, i);
    playerLocations[i] = possibleLocations[randomIndex];
    possibleLocations[randomIndex] = possibleLocations[i];
}

var result = '';
playerLocations.forEach(playerLocation => result += playerLocation);
document.write(result);

function randomInteger(min, max)
{
   return Math.floor(Math.random() * (max - min + 1)) + min;
}
</script>





Jan 22 2022, 3:35 pm NudeRaider Post #14

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

The presented solutions seem pretty complicated, so here's how I'd do it. It's essentially only 4 unique triggers, some repeated.

The gist:
When it's time to pick locations take 1 trigger loop for the players to generate a random number and transfer it to Custom Score. Whoever has the highest score gets spot 1 and his score reset. The next player with highest score gets spot 2 and so on.

Issues:
  • In case of 2 players rolling the same number it favors the lower player number. To counter that you can add more switches. I'll use only 3 in my example (8 possible values)
  • It relies on Custom Score which may be in use. Other options are Most Resources, or Commands most units at.
  • Worst case, it takes 7 trigger loops. (6 players, 1 initial randomization)

Note: I use DC "location number" both to store where the player's stuff will be placed and to divide between phase 1 where the random number is generated and stored and phase 2 where the stuff is placed. That's why you see it as a condition everywhere.

Triggers:
Generate random number ...
Players

  • Player Force
  • Conditions

  • DC "location number" = 0 for Player Force
  • Time to pick locations
  • Actions

  • Randomize Switch 1
  • Randomize Switch 2
  • Randomize Switch 3
  • Set Custom Score to 0 for Current Player


  • ... and store in Custom Score 1/3
    Players

  • Player Force
  • Conditions

  • DC "location number" = 0 for Player Force
  • Time to pick locations
  • Switch 1 is set
  • Actions

  • Add 1 to Custom Score for Current Player


  • ... and store in Custom Score 2/3
    Players

  • Player Force
  • Conditions

  • DC "location number" = 0 for Player Force
  • Time to pick locations
  • Switch 2 is set
  • Actions

  • Add 2 to Custom Score for Current Player


  • ... and store in Custom Score 3/3
    Players

  • Player Force
  • Conditions

  • DC "location number" = 0 for Player Force
  • Time to pick locations
  • Switch 3 is set
  • Actions

  • Add 4 to Custom Score for Current Player


  • Initialize actual unit placement
    Players

  • Comp Player
  • Conditions

  • Custom Score at least 1 for Player Force //only run this trigger if players already randomized their stuff. Can be skipped if the comp player has a higher player number than the players.
  • DC "location number" = 0 for Player Force
  • Time to pick locations
  • Actions

  • Set DC "location number" to 1 for Player Force
  • Add 1 to Custom Score for Player Force




  • Placing stuff at location 1/6
    Players

  • Player Force
  • Conditions

  • DC "location number" exactly 1 for Current Player
  • Time to pick locations
  • Current Player has the most Custom Score
  • Actions

  • Set Custom Score to 0 for Current Player
  • Create units at location "Spot 1" for Current Player
  • Add 1 to DC "location number" for Player Force


  • Placing stuff at location 2/6
    Players

  • Player Force
  • Conditions

  • DC "location number" exactly 2 for Current Player
  • Time to pick locations
  • Current Player has the most Custom Score
  • Actions

  • Set Custom Score to 0 for Current Player
  • Create units at location "Spot 2" for Current Player
  • Add 1 to DC "location number" for Player Force


  • ... Repeat the triggers for locations 3-6. (change blue parts)

    Post has been edited 3 time(s), last time on Jan 22 2022, 8:21 pm by NudeRaider.




    Jan 22 2022, 6:22 pm DarkenedFantasies Post #15

    Roy's Secret Service

    Quote from NudeRaider
    Triggers:
    Generate random number ...
    Players

  • Player Force
  • Conditions

  • DC "location number" = 0 for Player Force
  • Time to pick locations
  • Actions

  • Randomize Switch 1
  • Randomize Switch 2
  • Randomize Switch 3
  • Set Custom Score to 0 for Current Player
  • You should set this to 1 to avoid rolling a 0 and conflicting with the other players who have already randomized and have their score set to 0, running the chance of giving all remaining free slots to one player.

    I liked my first solution for only requiring those 8 triggers for any amount of zones, but yours has the shortest run time.

    Post has been edited 1 time(s), last time on Jan 22 2022, 6:36 pm by DarkenedFantasies.




    Jan 22 2022, 8:24 pm NudeRaider Post #16

    We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

    Quote from NudeRaider
    Triggers:
    Generate random number ...
    Players

  • Player Force
  • Conditions

  • DC "location number" = 0 for Player Force
  • Time to pick locations
  • Actions

  • Randomize Switch 1
  • Randomize Switch 2
  • Randomize Switch 3
  • Set Custom Score to 0 for Current Player
  • You should set this to 1 to avoid rolling a 0 and conflicting with the other players who have already randomized and have their score set to 0, running the chance of giving all remaining free slots to one player.


    Good catch! Edited the above triggers accordingly. Ended up editing this trigger though:

    Initialize actual unit placement
    Players

  • Comp Player
  • Conditions

  • Custom Score at least 1 for Player Force //only run this trigger if players already randomized their stuff. Can be skipped if the comp player has a higher player number than the players.
  • DC "location number" = 0 for Player Force
  • Time to pick locations
  • Actions

  • Set DC "location number" to 1 for Player Force
  • Add 1 to Custom Score for Player Force


  • Added the green line which results in the same. With your suggestion the blue condition would also need altering.



    EDIT:
    I liked my first solution for only requiring those 8 triggers for any amount of zones, but yours has the shortest run time.
    That is quite neat indeed! I didn't understand you were manipulating the position of the location, though now I know, it inspired me to improve upon that aspect of my solution.

    The distribution of locations depends on a DC that is counted from 1 to 6, each number linked to 1 of 6 locations. However we could also cycle 1 location between 1 of 6 units. For example center on an invisible observer owned by the computer player which is given to another player (P11, for example). It's a physical solution, but should otherwise work the same.

    This replaces the previous 6 "Placing stuff at ..." triggers:
    Placing stuff at the base spots
    Players

  • Player Force
  • Conditions

  • Time to pick locations
  • Current Player has the most Custom Score
  • Actions

  • Set Custom Score to 0 for Current Player
  • Center location "base spot" on Observer owned by Comp Player
  • Create units at location "base spot" for Current Player
  • Give 1 Observer owned by Comp Player at "base spot" to Player 11


  • Also add this action to the trigger "Initialize actual unit placement":
    [*]Give All Observers owned by Player 11 at Anywhere to Comp Player

    Post has been edited 2 time(s), last time on Jan 22 2022, 8:51 pm by NudeRaider.




    Jan 23 2022, 12:16 am Prankenstein Post #17



    Quote from UndeadStar
    Quote from Prankenstein
    Code
    <script>
    var possibleLocations = [1,2,3,4,5,6];
    var playerLocations = [];
    var randomIndex;

    for(var i = 5; i >= 0; i--)
    {
        randomIndex = randomInteger(0, i);
        playerLocations[i] = possibleLocations[randomIndex];
        possibleLocations[randomIndex] = possibleLocations[i-1];
    }

    var result = '';
    playerLocations.forEach(playerLocation => result += playerLocation);
    document.write(result);

    function randomInteger(min, max)
    {
       return Math.floor(Math.random() * (max - min + 1)) + min;
    }
    </script>
    My bad, I hesitated between 2 things, and ended up making a mistake, your js code can be fixed into:
    Code
    <script>
    var possibleLocations = [1,2,3,4,5,6];
    var playerLocations = [];
    var randomIndex;

    for(var i = 5; i >= 0; i--)
    {
        randomIndex = randomInteger(0, i);
        playerLocations[i] = possibleLocations[randomIndex];
        possibleLocations[randomIndex] = possibleLocations[i];
    }

    var result = '';
    playerLocations.forEach(playerLocation => result += playerLocation);
    document.write(result);

    function randomInteger(min, max)
    {
       return Math.floor(Math.random() * (max - min + 1)) + min;
    }
    </script>

    Cool it works now! PHP has a built in shuffle() function. I'd be curious if it follows the same pattern, because this is really concise code.



    None.

    Jan 23 2022, 12:27 am Prankenstein Post #18



    Quote from TheHappy115
    While I don't know if it works, my solution to the problem without EUD triggers would involve something like:

    1) Create a Setup Zone (this means the map need to set up)
    2) Have a switch for Players 1 - 6 and Lane 1 - 6 (1 each, set to Off since its defaulted)
    3) If Lane 1 is Off, means needs to be filled, randomize switches 1,2,3. If the result is invalid, just do it again. The condition may look something like this:
    If: Switch 1: Off, Switch 2: Off, Switch 3: Off, Player 1: Off, Lane 1: Off ->
    Then: Center Location "Player 1 Spawns" at "Section 1", Player 1: On, Lane 1: On, Lane 2: Off

    Now the question is, what if it randomizes and lands on switch 1, 2, 3 again? Well, since Player 1 is now On, it won't set it onto the new location. Furthermore, the condition sets lane 1 to On (so it won't be used) and sets Lane 2 to off (meaning the next lane used is lane 2). You would do the same, with increment.

    Now this set of triggers is at least 6 triggers per lane (meaning 36 triggers in total which is still a decent amount but much better than the 720)

    For Leavers: Ideally, you could just assign the lanes to non-existing players still. Aka, if Player 4 left and he is assigned Lane 3, you can still just have all the triggers go off and it should still work.

    Issues with this method:
    1) This will have issues if you want the player to always be in the left most lane (I.E. 6 players = first 6 lanes, while 4 players is the 4 lanes. This method instead have 4 players spread randomly between those 6 lanes with the other 2 being assigned to non-existing players)
    2) Technically, this solution could cause the times between lane sections be indefinite. This is because with 3 switches, the chances of the a player being picked is 75% per trigger check on lane 1, then 62.5%, 50%, 37.5%, and 25% on lane 5. (Lane 6, you can just remove the randomized switches since there is only 1 option left). In this instance, even if the trigger is being checked about 8 times per second with hyper triggers, there is still a chance that the 25% effect misses 8 times in a row (Delaying game by 1 second). This increases each time it misses (although very unlikely). In terms of chances of it to happen (8 times in a row is about 10%, and 24 times in a row would be about 0.1% chance of happening. It will happen, its just rare and if you can work around a couple of seconds of missing time, it should still be fine then)
    3) This is just my assumption, so correct me if I'm wrong. A good way to check is by simply doing it with 3 players at first with 2 lanes and expanding from there (as that would only be 6 triggers)

    Summary of Advanages:
    - Avoids using EUDs which are a bit complex (and hard to read if not using an editor or unfamiliar with)
    - 720 -> 36 triggers, Much easier to work with.
    - Should work each round. Just remember to set all players switches to "Off".
    - Still works when a player leaves (look at disadvantages for details too)

    Summary of Disadvantages:
    - Unknown if truly works (not tested)
    - Chance of delay between rounds assigning players the lane (with minimum of 6 trigger instances)
    - Does not remove the "final" lanes when a player leaves (still assign randomly). (Can get instances of: 3 4 - 1 - 6 (Where Players: 2 & 5 left)
    - Possibly other things (takes 15 switches to work)

    Thank you for this very interesting write-up. This was pretty much along the lines of my initial thought process, though not as in depth as yours and I never considered the probabilities and such. After trying and then failing to do it this way, I decided to just go with NudeRaider's solution, because not only did it seem intuitive to me, but also he provided exact triggers :P. I'm not sure what you mean by "Setup Zone" but I created a location called "Spawn Helper", where all units are first created and then subsequently moved to the proper locations.



    None.

    Jan 23 2022, 12:37 am Prankenstein Post #19



    Too late. Here u go.

    You're a genius, but after some deliberation, I decided not to use this solution. I failed to mention in my original post (because I never imagined it being a factor), that the zones are actually in two rows:

    E.g.

    3 1 4
    5 6 2

    So I would have to manage shifting the location around both the X and Y axes if I took this route.

    However, I did steal your hyper trigger line. So clean and much simpler than the other two methods I've used in the past. TY



    None.

    Jan 23 2022, 12:57 am Prankenstein Post #20



    Quote from NudeRaider
    Quote from NudeRaider
    Triggers:
    Generate random number ...
    Players

  • Player Force
  • Conditions

  • DC "location number" = 0 for Player Force
  • Time to pick locations
  • Actions

  • Randomize Switch 1
  • Randomize Switch 2
  • Randomize Switch 3
  • Set Custom Score to 0 for Current Player
  • You should set this to 1 to avoid rolling a 0 and conflicting with the other players who have already randomized and have their score set to 0, running the chance of giving all remaining free slots to one player.


    Good catch! Edited the above triggers accordingly. Ended up editing this trigger though:

    Initialize actual unit placement
    Players

  • Comp Player
  • Conditions

  • Custom Score at least 1 for Player Force //only run this trigger if players already randomized their stuff. Can be skipped if the comp player has a higher player number than the players.
  • DC "location number" = 0 for Player Force
  • Time to pick locations
  • Actions

  • Set DC "location number" to 1 for Player Force
  • Add 1 to Custom Score for Player Force


  • Added the green line which results in the same. With your suggestion the blue condition would also need altering.



    EDIT:
    I liked my first solution for only requiring those 8 triggers for any amount of zones, but yours has the shortest run time.
    That is quite neat indeed! I didn't understand you were manipulating the position of the location, though now I know, it inspired me to improve upon that aspect of my solution.

    The distribution of locations depends on a DC that is counted from 1 to 6, each number linked to 1 of 6 locations. However we could also cycle 1 location between 1 of 6 units. For example center on an invisible observer owned by the computer player which is given to another player (P11, for example). It's a physical solution, but should otherwise work the same.

    This replaces the previous 6 "Placing stuff at ..." triggers:
    Placing stuff at the base spots
    Players

  • Player Force
  • Conditions

  • Time to pick locations
  • Current Player has the most Custom Score
  • Actions

  • Set Custom Score to 0 for Current Player
  • Center location "base spot" on Observer owned by Comp Player
  • Create units at location "base spot" for Current Player
  • Give 1 Observer owned by Comp Player at "base spot" to Player 11


  • Also add this action to the trigger "Initialize actual unit placement":
    [*]Give All Observers owned by Player 11 at Anywhere to Comp Player


    This is awesome! After working your triggers into my map, it worked perfectly right away! I did also apply DarkenedFantasies's fix to it as well.

    Some notes:

    After a player is assigned to each location, instead of just spawning units there right away, I create a single flag for each player at their assigned location. Then I center each player's spawn location (Player 1 Spawn, Player 2 Spawn, etc..) on top of their flag, then finally I remove the flag. This allows me to create all units at a single location on the corner of the map (currently called "Spawn Helper"), and any unit that is moved or created there, is instantly teleported to the proper location. This allows me to easily implement boundaries (any time a player tries to leave their zone, I just move their units to the "Spawn Helper" location) and also allows me to give the player more units at a later time during the round by simply creating them in a single location.

    It's really odd though. For some reason, each player's location isn't being moved before their units are spawned. So sometimes when I start the map, everything works fine, and other times, you'll see the units are created at the bottom of the map where their location is initially. I attached my map if you're interested to see.

    Post has been edited 1 time(s), last time on Mar 15 2022, 3:00 am by Prankenstein.



    None.

    Options
    Pages: 1 2 34 >
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [05:24 pm]
    Vrael -- CUT IT OUT
    [05:24 pm]
    Vrael -- HEY STOP BEING NICE
    [05:01 pm]
    NudeRaider -- Ultraviolet
    Ultraviolet shouted: actually I am mad after all, looks like you're gonna have to follow through
    didn't I by posting the note?
    [04:59 pm]
    Ultraviolet -- actually I am mad after all, looks like you're gonna have to follow through
    [04:59 pm]
    Ultraviolet -- :lol:
    [04:46 pm]
    NudeRaider -- damn, and here I was prepared and got chatgpt to rephrase it a bunch of times for more people to join the bandwagon. :D https://anotepad.com/notes/7fk84xef
    [04:33 pm]
    Ultraviolet -- lol it's fine, I was just being sassy :P
    [03:19 pm]
    Vrael -- maybe my browser window didnt update or something funky
    [03:19 pm]
    Vrael -- lol sry UV, I must not have read that? I couldve sworn I was the next person to say something after CAFG but clearly based on timestamps I was 4 hours later
    [03:18 pm]
    Vrael -- :teach:
    Please log in to shout.


    Members Online: Zincoshine