how do I issue order? (special)

Discussion in 'Starcraft 2 (SC2) Editor Help' started by MissKerrigan, Jul 25, 2012.

  1. MissKerrigan

    MissKerrigan Active Member

    Ratings:
    +23 / 0 / -0
    I only could choose between 6 start locations, I placed a start location at 1 of the squares this works fine but the other 79 units (were banelings but now it's random units) are moving in wrong direction
     
  2. Siretu

    Siretu Starcraft 2 Editor Moderator Staff Member

    Ratings:
    +295 / 0 / -0
    Switch from value to function. Use the function "position of unit" instead of the start location.
     
  3. MissKerrigan

    MissKerrigan Active Member

    Ratings:
    +23 / 0 / -0
    yes I am using the 'position of unit' but for some reason the banelings are still attracted to the start locations
     
  4. Siretu

    Siretu Starcraft 2 Editor Moderator Staff Member

    Ratings:
    +295 / 0 / -0
    Right-click the action and select copy as text. Paste it in here in a post.
     
  5. Phubar

    Phubar Well-Known Member

    Ratings:
    +30 / 0 / -0
    I tried a different approach to the problem, a more "logic" one than "mathematical" one.

    Name the region like in the picture and create a big region in the center called "Central square".
    http://www.mediafire.com/?75dpnx5806u15s5

    Create a Global variable array "Spawnin region[28]" and set:
    "Spawnin region[1]"= region 1
    "Spawnin region[2]"= region 2
    "Spawnin region[3"= region 3
    ...
    "Spawnin region[28]"= region 28

    Then for spawn and move banelings crate a trigger:

    Code:
    Events
        Your event
     
    Local variables
         selector = 0 <Integer>
          MyBaneling= no unit <unit>
     
    Conditions
    Actions
            Variable -Set selector = (Integer random between 1 and 28)
            Unit -Create 1 Baneling for player 1 1 in (center of Spawning region[selector])
            Variable -Set MyBaneling = last created unit
            If
               selector <= 14
              Then
                      Unit -Order MyBaneling to ( Move target (center of region Spawning region[(selector + 14)]
              Else
                        Unit -Order MyBaneling to ( Move target (center of region Spawning region[(selector - 14)]

    Then for remove banelings crate a trigger:

    Code:
    Events
         unit leaves region "Central square"
    Conditions
           Type of triggering unit= baneling
    Actions
           Unit - remove triggering unit from the game
    Those triggers are very simple to write and are short.
     
    • Like Like x 2
  6. Siretu

    Siretu Starcraft 2 Editor Moderator Staff Member

    Ratings:
    +295 / 0 / -0
    That's a really smart way to do it. It requires 3 regions less than my solution and it's overall a lot nicer.

    Good work! :)
     
  7. Phubar

    Phubar Well-Known Member

    Ratings:
    +30 / 0 / -0
    Tnx!
     
  8. MissKerrigan

    MissKerrigan Active Member

    Ratings:
    +23 / 0 / -0
    ye good work but I don't get it... damn!
     
  9. Phubar

    Phubar Well-Known Member

    Ratings:
    +30 / 0 / -0
    I placed the number of regions in a special order so we can have two cases:
    -If the baneling spawns in "region 1-14" its detination is "region (current region+14)"
    -If the baneling spawns in region 15-28 its detination is "region (current region-14)"

    Talking about removing banelings i noticed that when a baneling enters it's destination region it is like it leaves the center of the map. So i created a big region in the center (central square) and i made a trigger that removes the baneling when it leaves the central region instead when it enters the destination region (the case is the same).
     

Share This Page