Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Random starting PC?
Random starting PC?
Feb 9 2020, 2:22 am
By: Nekrocow  

Feb 9 2020, 2:22 am Nekrocow Post #1



Hi, I'm trying to randomize the starting position of a PC player on a UMS training map. These are my triggers (see image).



Basically, I randomize TOP and BOT triggers in order to create one out of four possible outcomes. Then, if conditions are met, a Nexus and four probes are created on the northeast starting point (or one of the other three, the SS is just and example.

The third (actually, four) trigger is to prevent the base/probes from being created in the same position as the player base, which position is randomized with the Force's "Randomize Start Locations".

Sometimes the triggers create two bases, sometimes just one, sometimes the AI derps itself, and sometimes it seems to work (gets 2 Gateways, then 12 zealots and it attacks).

Any advise is welcomed. I'm pretty new at this :D.

Post has been edited 1 time(s), last time on Feb 12 2020, 12:40 am by Nekrocow.




Feb 9 2020, 7:50 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

First make all the triggers owned by the computer player.
Then the logic is simple. While the cpu player has no buildings randomize the position.
Then have 4 triggers to create buildings for each position. Only run it when there's no buildings at the position and the cpu (still) doesn't have buildings.
Make sure the defeat trigger is ABOVE these to prevent the computer from getting new buildings when he lost them all. ;) Since the building creation triggers are owned by the cpu they won't run anymore once it's defeated.

This way you only need 5 triggers total:
Randomize
Players

  • CPU Player
  • Conditions

  • Current Player brings at most 0 [any unit] to Anywhere
  • Actions

  • Randomize Switch Top
  • Randomize Switch Left
  • Preserve trigger

  • I renamed to switch just because I find it more logical that way. If Top is set the base will be created in the northern half of the map, if not southern half. If left is set it'll be west, otherwise east.

    Place NE
    Players

  • CPU Player
  • Conditions

  • Switch Top is set
  • Switch Left is cleared
  • All Players brings at most 0 [any unit] to Pos_NE
  • Current Player brings at most 0 [any unit] to Anywhere
  • Actions

  • [Create buildings]
  • [Run AI script]
  • Preserve trigger


  • repeat 3 times:
    NW: Top is set; Left is set
    SE: Top is cleared; Left is cleared
    SW: Top is cleared; Left is set

    Post has been edited 2 time(s), last time on Feb 9 2020, 7:56 am by NudeRaider.




    Feb 9 2020, 4:40 pm Nekrocow Post #3



    WOW that was really simple :w00t: thanks a lot!



    None.

    Feb 9 2020, 6:52 pm NudeRaider Post #4

    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

    np. :)
    Actually, I just realized, don't preserve the place buildings triggers. It doesn't really matter, but it's more efficient.




    Feb 11 2020, 11:43 pm Nekrocow Post #5



    It worked wonderfully :D

    Now I'm trying to randomize race, this is my take (ignore FORCE 1 triggers, they came with the original MacroAlone training map). Basically, I tried using switches an a Death Counter to randomize it, but I couldn't manage to make it work every time:

    Attachments:
    Nekro's PRUEBA.scx
    Hits: 0 Size: 197.85kb



    None.

    Feb 12 2020, 12:37 am Nekrocow Post #6



    Actually, I found this trigger that messes up my death counter randomization, hehe





    None.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [12:06 am]
    lifebot -- join RPG @ US WEST
    [2020-9-23. : 7:10 am]
    sraw531 -- ungh, looks like im going to have to do a binary count off for death messages, they aren't properly being displayed to everybody :(
    [2020-9-23. : 4:22 am]
    sraw531 -- maybe I should just test what happens if you teleport(move) the command centers to a location off the map every cycle while they are flying.
    [2020-9-23. : 4:22 am]
    sraw531 -- if you do a for each loop, then youd likely have deselection issues, if you dont youd likely have issues with non-prebuilt command centers
    [2020-9-23. : 4:21 am]
    sraw531 -- UndeadStar
    UndeadStar shouted: @sraw531: what happen if you continuously (through trigger) order it to move to its own location?Close to what you need?Or just bug/bad?
    That might work for one command center, but it wouldn't work for multiple. If you were to do it for multiple youd need 1-2 locations for each, and thats not easy.
    [2020-9-23. : 3:30 am]
    UndeadStar -- @sraw531: what happen if you continuously (through trigger) order it to move to its own location?Close to what you need?Or just bug/bad?
    [2020-9-22. : 12:08 pm]
    IlyaSnopchenko -- sraw531
    sraw531 shouted: is there an "easy" (without modding/EUD) way to make flying command centers have a movement speed of ~0 when trying to fly, but can still land/lift?
    Funny that it was just what I did when trying to prevent flying buildings from flying... though that was still through iscript/AICE - set the flingy speed to 0 after each liftoff (as it's reset to a hardcoded value each time the building lifts off)
    [2020-9-22. : 5:01 am]
    Oh_Man -- https://youtu.be/eG9lTgu0R-M This guy must have got sued by like 5 different companies. 🤣
    [2020-9-22. : 1:00 am]
    sraw531 -- is there an "easy" (without modding/EUD) way to make flying command centers have a movement speed of ~0 when trying to fly, but can still land/lift?
    [2020-9-22. : 12:50 am]
    sraw531 -- surprisingly easy to change all the hero marines into normal marines, and vice versa, across the map though.
    Please log in to shout.


    Members Online: Roy, jun3hong, Rawflesh0615