Staredit Network > Forums > SC2 Assistance > Topic: how to order to move and prevent replacement
how to order to move and prevent replacement
Aug 18 2011, 8:06 am
By: TheKeyToKilling  

Aug 18 2011, 8:06 am TheKeyToKilling Post #1



Ok I have a bound map and am trying to make a demo ling. There is a region that moves for the respawn. I created a unit at the center of the respawn when a command is typed in by a player. I need to know first off how to prevent them from being able to place more than one demo unit on the map at a time. I also need to know how to order the ling to move from region to region after it has been created. I should be able to figure out how to remove the unit without an issue. I did find a issue order to unit to move command, but I didn't see a to region or point or anything on it... so I'm totally lost as to how to make it move to a certain area. Any help much appreciated... TY.

The maps been done for a long time and can currently be played (Double Rainbow Bound)... I've just been working on adding some extra features to it lately to make it a better map so that hopefully more people will enjoy playing it. This move ling thing has been done is broodwar, but haven't seen it done in SC2. Sorry for being so newbie about this :P.



None.

Aug 18 2011, 10:52 am Ahli Post #2

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Quote from TheKeyToKilling
There is a region that moves for the respawn. I created a unit at the center of the respawn when a command is typed in by a player. I need to know first off how to prevent them from being able to place more than one demo unit on the map at a time.
Add a condition that checks if there is at least 1 unit in the unit group that was formed by all demo ling units owned by the triggering player in the whole map.
Or you save the bounder unit for every player in a variable and check if the unit isn't alive.

Quote from TheKeyToKilling
I also need to know how to order the ling to move from region to region after it has been created. I should be able to figure out how to remove the unit without an issue. I did find a issue order to unit to move command, but I didn't see a to region or point or anything on it... so I'm totally lost as to how to make it move to a certain area.
You can click the "(" and change the order type. Then you need to select the order type that contains point in it.




Aug 19 2011, 4:19 am TheKeyToKilling Post #3



ok... I create the demo unit and add it to a unit group... I can't figure out how to check if it's alive though or if there's on in the group or blah blah blah.

oh snap... better idea... how bout I just disable the trigger after it makes one... and then enable it again when the other unit is gone :D

Post has been edited 2 time(s), last time on Aug 19 2011, 5:04 am by TheKeyToKilling.



None.

Aug 19 2011, 5:10 am Roy Post #4

An artist's depiction of an Extended Unit Death

The way I would do this is to have a global variable of type "Unit" that stores a demo ling. When you create a demo ling, put it inside this variable. When you are done with it, remove the demo ling from the map. Creating will look a little like this:

DemoLingCreate
    Events
        ------- Event to make a demo ling
    Local Variables
    Conditions
        ------- If no demo ling is on the map
        (DEMO_LING is in (Entire map)) == false
    Actions
        ------- Create a demo ling
        Unit - Create 1 Zergling for player 8 at SPAWN_LOCATION using default facing (No Options)
        Variable - Set DEMO_LING = (Last created unit)


Removing would look like:

DemoLingRemove
    Events
        ------- Event to remove a demo ling
    Local Variables
    Conditions
    Actions
        ------- Remove demo ling
        Unit - Remove DEMO_LING from the game


Finally, ordering would look a little like this:

DemoLingOrder
    Events
        ------- Event to order a demo ling (if needed)
    Local Variables
    Conditions
    Actions
        General - If (Conditions) then do multiple (Actions)
            If Then Else
                General - Else if (Conditions) then do (Actions)
                    Else If
                        ------- Level 1 orders
                    Then
                        Unit - Order DEMO_LING to ( Move targeting (Center of Location 1)) (Replace Existing Orders)
                        General - Wait 2.0 Game Time seconds
                        Unit - Order DEMO_LING to ( Move targeting (Center of Location 2)) (Replace Existing Orders)
                        General - Wait 2.0 Game Time seconds
                        Unit - Order DEMO_LING to ( Move targeting (Center of Location 3)) (Replace Existing Orders)
                General - Else if (Conditions) then do (Actions)
                    Else If
                        ------- Level 2 orders
                    Then
                        Unit - Order DEMO_LING to ( Move targeting (Center of Location 6)) (Replace Existing Orders)
                        General - Wait 2.0 Game Time seconds
                        Unit - Order DEMO_LING to ( Move targeting (Center of Location 4)) (Replace Existing Orders)
                        General - Wait 2.0 Game Time seconds
                        Unit - Order DEMO_LING to ( Move targeting (Center of Location 7)) (Replace Existing Orders)

Where "Level x condition" is some value that checks what level the game is on (for example, if it was an integer, "Level 2 condition" would be "Level_Variable == 2").

It's not exactly an amazing design, and if you're comfortable with arrays, you can make this a whole lot cleaner. The reason I put "(if needed)" on the order is because you may just want the trigger to run after the demo ling is created. If this is the case, all you'd have to do is add a "Run Trigger" action after your DemoLingCreate actions, telling it to run DemoLingOrder.

Hope this helps.




Aug 19 2011, 6:21 am TheKeyToKilling Post #5



i figured out how to create the demo ling and make it so that it can't be remade while alive... and i figured out how to move it in front of the obstacle... but I can't figure out how to make it go at the right time, since replace existing orders would just make it go at whatever time and possibly during the wrong order

any ideas? this is really frustrating LOL... I miss my sc1 editors LOL



None.

Aug 19 2011, 9:14 am Ahli Post #6

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Quote from TheKeyToKilling
i figured out how to create the demo ling and make it so that it can't be remade while alive... and i figured out how to move it in front of the obstacle... but I can't figure out how to make it go at the right time, since replace existing orders would just make it go at whatever time and possibly during the wrong order

any ideas? this is really frustrating LOL... I miss my sc1 editors LOL
How would you do it in sc1 editor?
I would do what Roy said.




Aug 19 2011, 3:13 pm Roy Post #7

An artist's depiction of an Extended Unit Death

It sounds like the current issue you're having is synchronizing the demo ling with the obstacle. You have two options to synchronize these actions:

1) Have each obstacle trigger run the "DemoLingOrder" trigger when the cycle starts. Add the conditions "(DEMO_LING is in (Entire map)) == true" and "(Count of orders on DEMO_LING) == 0" to DemoLingDemo.

2) Instead of making a DemoLingOrder action, put the order actions in the obstacle triggers themselves. If you have efficient cycled patterns in your obstacles (which you probably do), you'll have to keep track of either what stage the demo is in (harder) or grab the unit manually each time instead of using a global variable (easier). To grab the unit, you'll have to do make a unit group each time, and you may get sick of doing it repeatedly. Fortunately, SC2 lets you make functions to automate this.

Quote from Ahli
How would you do it in sc1 editor?
SC1 does this in a procedural way similar to option #2.

Attached is a custom action written to simulate SC1's Order action, in case you want to go with option #2. You can copy it over to your map or try recreating it yourself (which would be a good learning exercise). Theoretically, you can recreate all SC1 trigger conditions/actions by using SC2's custom condition/action feature.

Attachments:
SC1_Order_Action.SC2Map
Hits: 3 Size: 14.73kb




Aug 19 2011, 3:26 pm TheKeyToKilling Post #8



haha nice roy... I love it :)



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
[01:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
[01:05 am]
Vrael -- that's better
[12:39 am]
NudeRaider -- can confirm, Vrael is a total madman
[2024-5-03. : 10:18 pm]
Vrael -- who says I'm not a total madman?
[2024-5-03. : 2:26 pm]
UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
Please log in to shout.


Members Online: Roy, Oh_Man