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
    Hello Guysss,

    I make 2 regions of 12x1 size (12 vertical, 1 horizontal)
    I placed this regions next to each other with about 10 distance between

    I create baneling at a random point in the first region
    How do I trigger them to move STRAIGHT to the other region? (not center of)

    MissKerrigan
     
  2. MissKerrigan

    MissKerrigan Active Member

    Ratings:
    +23 / 0 / -0
    I changed it a little bit, but to be more clear I have a screenshot here

    http://i.imgur.com/2Iw90.jpg

    Now when you see the yellow tiles, this are the places where banelings must spawn
    Once they are spawned, they must automatically walk to their opposite destination

    1. How do I make the banelings are randomly spawned in one of the yellow areas?
    2. Once they are spawned, how do I move them to their opposite direction across?

    Does anybody understand what I mean?

    MissKerrigan
     
  3. Phubar

    Phubar Well-Known Member

    Ratings:
    +30 / 0 / -0
    In regions at the top order banelings to "move in point" and change "point" in "point with polar offset" setting distance (the vertical size of the map) and angle -90°

    In regions at the bottom order banelings to "move in point" and change "point" in "point with polar offset" setting distance (the vertical size of the map) and angle 90°

    In regions at the right order banelings to "move in point" and change "point" in "point with polar offset" setting distance (the orizzontal size of the map) and angle 180°

    In regions at the left order banelings to "move in point" and change "point" in "point with polar offset" setting distance (the orizzontal size of the map) and angle 0°
     
    • Like Like x 1
  4. Phubar

    Phubar Well-Known Member

    Ratings:
    +30 / 0 / -0
    For the spawn crate an array with one dimension as big as the number of the yellow regions (ie "Spawning region[28]" and set its type to "region" an then manually set each region to each cell of the array.

    Then create a trigger like that (assuming region 1-7 the top, 8-14 the right, 15-21 the bottom and 22-28 the left ones)

    Code:
        Events
            Your event
        Local variables
            selector = 0 <Intero>
        Conditions
        Actions
            Variable -Set selector = (Integer random between 1 and 28)
            Unit -Create 1 Baneling for player 1 1 in (Random point in Spawning region[selector]) with random facing (Nessuna opzione)
            General -If (Condizioni) then do  (Azioni) else do (Azioni)
                If
                    selector <= 7
                Then
                    Unit -Order (last crated unit) di ( Move ha come bersaglio (Offset di (Position of (last created unit)) di 64.0 verso -90.0 degrees))
                Else
            Generale -Se (Condizioni) allora esegui (Azioni) altrimenti esegui (Azioni)
                If
                    selector >= 8
                    selector <= 14
                Then
                    Unit -Order (last crated unit) di ( Move ha come bersaglio (Offset di (Position of (last created unit)) di 64.0 verso 180.0 degrees))
                Else
            Generale -Se (Condizioni) allora esegui (Azioni) altrimenti esegui (Azioni)
                Se
                    selector >= 15
                    selector <= 21
                Then
                    Unit -Order (last crated unit) di ( Move ha come bersaglio (Offset di (Position of (last created unit)) di 64.0 verso 90.0 degrees))
                Else
            Generale -Se (Condizioni) allora esegui (Azioni) altrimenti esegui (Azioni)
                If
                    selector >= 22
                Then
                    Unit -Order (last crated unit) di ( Move ha come bersaglio (Offset di (Position of (last created unit)) di 64.0 verso 0.0 degrees))
                Else
                Altrimenti
    
     
    • Like Like x 1
  5. Phubar

    Phubar Well-Known Member

    Ratings:
    +30 / 0 / -0
    Sry for the bad translation...
     
  6. MissKerrigan

    MissKerrigan Active Member

    Ratings:
    +23 / 0 / -0
    never mind... thought it might something simple
     
  7. MissKerrigan

    MissKerrigan Active Member

    Ratings:
    +23 / 0 / -0
    btw, the banelings must disappear when they reached the opposite holes, so this is impossible since I triggered them to move to the other direction when they entering the location.

    How I suppost to do this?
     
  8. Phubar

    Phubar Well-Known Member

    Ratings:
    +30 / 0 / -0
    You can make 2 triggers:
    - a trigger that adds something like a "flag" to a baneling when it leaves a region
    - a trigger that removes a baneling from the game when int anters a region AND it has that "flag"
     
  9. MissKerrigan

    MissKerrigan Active Member

    Ratings:
    +23 / 0 / -0
    so I understand that all banelings has the flag at last so they ALWAYS disappear it's not working
     
  10. Phubar

    Phubar Well-Known Member

    Ratings:
    +30 / 0 / -0
    No all banelings spawn without that "flag" (i'm not expert in this kind of things, i usually add them a usless behavior) and they gain that "flag" when they leave a region.
    The other trigger will remove a baneling that enters a region only if it has that "flag" (so banelings that enter a region when created wont be removed since they didnt have the "flag")
     
  11. Siretu

    Siretu Starcraft 2 Editor Moderator Staff Member

    Ratings:
    +295 / 0 / -0
    What Phubar is talking about, in case you didn't understand what he means with "flag", is a way to recognize if the baneling that enters a region just spawned there or came there from another region.l

    You don't even have to use the triggers to handle the flag.

    Create a new behavior of the buff type. Give it a 2-3 second duration. You could probably do with less.

    Add the behavior to the banelings when you spawn them.(or add them in the baneling unit's behaviors field in the data editor)

    In your trigger that removes the banelings(probably something with a lot of events for all regions, a condition to check it's the right player and a baneling and an action that removes the unit), add a condition that checks if the unit does not have the behavior. (Unit has (YourBehavior)) == False
     
  12. MissKerrigan

    MissKerrigan Active Member

    Ratings:
    +23 / 0 / -0
    Alright I did it, it works! THANK YOU

    Next think is about spawn units IN the level
    Now please look at the screenshot again if you forgotten where it was about :)

    http://i.imgur.com/2Iw90.jpg

    note: all the bushes you see does have a footprint 1x1 path blocker

    Question: when I create a unit in the 'level' will it automatically be spawned in a place where it is possible to spawn?
     
  13. MissKerrigan

    MissKerrigan Active Member

    Ratings:
    +23 / 0 / -0
    Actually I found an easier way to do it with 4 unit groups:

    Units Bottom
    Units Top
    Units Left
    Units Right

    now the units will be placed into the unit groups when they are spawn and if they reach the opposite they will be checked if they are in the unit group of the opposites :)

    But the only thing I still can't figure out is that the units can ONLY move straight if you know what I mean. Example: a unit in left top must ONLY move to the left bottom square
     
  14. Phubar

    Phubar Well-Known Member

    Ratings:
    +30 / 0 / -0
    To "top" units order to move in a point with "-90" polar offset
    With "bottom" units use "90" polar offset.
    With "left" units use "180" polar offset.
    With "right" units use "0" polar offset.
     
  15. MissKerrigan

    MissKerrigan Active Member

    Ratings:
    +23 / 0 / -0
    nice try but this isn't working, yes it does work for 1 unit, but the units which are spawned at another place offset of the point will move all in wrong direction...

    Guess I'll have to make my 80 triggers
     
  16. Siretu

    Siretu Starcraft 2 Editor Moderator Staff Member

    Ratings:
    +295 / 0 / -0
    Okay, here's how you do it(with 2 triggers instead of 80):

    Create 4 regions. One that covers the bottom squares(call it BanelingsBottomSpawn), one that covers the left squares(call it BanelingLeftSpawn), one that covers the right squares(call it BanelingRightSpawn) and one that covers the top squares(call it BanelingTopSpawn).

    You can do it without those regions, but it makes it slightly more complex.

    You'll need one region array just to save all the squares to pick a random one. Create a global variable(called something like "BanelingSpawnRegions") of the region type and set the size to 28(the amount of squares you have). I assume you have some trigger that runs when the game starts(with the event "Map Initialization"). In this trigger add the following:
    Trigger:
    • Init
      • Events
        • Game - Map initialization
      • Local Variables
      • Conditions
      • Actions
        • Variable - Set BanelingSpawnRegions[0] = Baneling spawn 1
        • Variable - Set BanelingSpawnRegions[1] = Baneling spawn 2
        • Variable - Set BanelingSpawnRegions[2] = Baneling spawn 3
        • Variable - Set BanelingSpawnRegions[3] = Baneling spawn 4
        • ... And so on ...

    Remember the behavior I told you to create in an earlier post? Let's assume you created it and called it BanelingSpawn.
    Next, you need to measure the distance the baneling has to go. Specifically this distance:

    So how do you measure that? The editor keeps track of the coordinates that your mouse is at. Look in the bottom left corner where it says "Point(X.x, Y.y, Z.z)". Here's a picture that shows what it looks like:
    [​IMG]
    Hold the mouse over the square at the left side of the red line in my first picture. Remember the X value. Hold the mouse value over the square at the right side. Take the new X value and subtract the old one. This is the distance. When you see "*YourDistance*" in the trigger below, put in the distance instead.

    Here's the first trigger you need(the earlier one was just stuff you put at init. You probably already have an init trigger, so it's not a new trigger)
    Trigger:
    • Baneling Order/Kill
      • Events
        • Unit - Any Unit Enters BanelingsBottomSpawn
        • Unit - Any Unit Enters BanelingsTopSpawn
        • Unit - Any Unit Enters BanelingsLeftSpawn
        • Unit - Any Unit Enters BanelingsRightSpawn
      • Local Variables
        • Direction = 0.0 <Real>
      • Conditions
      • Actions
        • General - If (Conditions) then do (Actions) else do (Actions)
          • If
            • ((Triggering unit) has BanelingSpawn) == False
          • Then
            • Unit - Kill (Triggering unit)
          • Else
            • General - If (Conditions) then do (Actions) else do (Actions)
              • If
                • ((Triggering unit) is in BanelingsRightSpawn) == True
              • Then
                • Variable - Set Direction = 0.0
              • Else
            • General - If (Conditions) then do (Actions) else do (Actions)
              • If
                • ((Triggering unit) is in BanelingsBottomSpawn) == True
              • Then
                • Variable - Set Direction = 90.0
              • Else
            • General - If (Conditions) then do (Actions) else do (Actions)
              • If
                • ((Triggering unit) is in BanelingsLeftSpawn) == True
              • Then
                • Variable - Set Direction = 180.0
              • Else
            • General - If (Conditions) then do (Actions) else do (Actions)
              • If
                • ((Triggering unit) is in BanelingsTopSpawn) == True
              • Then
                • Variable - Set Direction = 270.0
              • Else
            • Unit - Order (Triggering unit) to ( Move targeting ((Position of (Triggering unit)) offset by *YourDistance* towards Direction degrees)) (Replace Existing Orders)


    That's all.

    Now to create a baneling in a random square and have it go straight over to the square on the other side, use the following actions:
    Trigger:
    • Unit - Create 1 Baneling for player 15 at (Center of BanelingSpawnRegions[(Random integer between 0 and 27)]) using default facing (No Options)
      • Unit - Add 1 BanelingSpawn to (Last created unit) from (Last created unit)
     
    • Like Like x 2
  17. MissKerrigan

    MissKerrigan Active Member

    Ratings:
    +23 / 0 / -0
    so it seems phubar meddles into things he shouldn't meddled into


    I still not get the part of the regions
    Do I have to make an extra region of each tile?
    Or can I do it with only the 4 spawn regions?

    Because you said I must make my map initialization trigger

    set variable 28 times


    there are 28 regions, not 27

    Omg this looks scary to me, but I'll try to get it
     
  18. X-maul

    X-maul AKA: Demtrod

    Ratings:
    +200 / 0 / -0
    1st of all - What is this? Phubar is trying to help you, and you respond like that?...o_O

    2nd - When it goes from 0 to 27 it has 28 arays - 0,1,2,3,4, ... 25,26,27.
    You do have to set it 28 times for it to work.
     
  19. MissKerrigan

    MissKerrigan Active Member

    Ratings:
    +23 / 0 / -0
    I tried to use the trigger-action 'targeting point with polar offset' but when I turn it 90 degrees the units are NOT moving in upper direction but for some reason they move to a start location a placed in bottom of the map

    I told Phubar already this is not working but I really APRECIATE he trying to help me! sorry pubhar if I insulted you with that! x

    All this sounds to complicated so I just leave it by a random move to the region, I can live with this

    It just suprised me there isn't a trigger-action 'move unit in upper direction for x seconds'

    I am already glad that I found out the way of making regions into more fields by adding rectangles
     
  20. Siretu

    Siretu Starcraft 2 Editor Moderator Staff Member

    Ratings:
    +295 / 0 / -0

    His solution also works, and it is better than making 80 triggers.

    How did you use the "targeting point with polar offset". Which point did you use?

    It would be redundant, it's easily doable with the "targeting point with polar offset".
     

Share This Page