Tutorial General - Making Gates Close

Exide

I am amazingly focused right now!
Reaction score
448
Hi.
I have had a lot of problems with SC2's gates. I have finally figured out how to fix them, so I decided to make a tutorial - in case someone else has the same problems I did.


Step 1:
The very first step is to load the Liberty Campaign Dependency.
Do this by going to 'File -> Dependencies...'
Click on the 'Add Standard...' button. Check the box on the bottom of the list, named "Liberty Story (Campaign)", then press Ok. Then press Ok again.
StarEditor will now load triggers, units and what not used in Liberty Story (Campaign) Dependency. -For example the gate units, which are what we want.)




Step 2:
The next step is easy, simply place a gate (or more) any where on your map.
Start by changing to the unit Palette (hotkey: U), and search for "gate". (Make sure you don't have any filters on.)
In this Tutorial I will be using the very first gate. (It is lowered -aka open, by default.)
The second gate is a copy of the first one, only the second gate is closed by default.




Step 3:
Here comes the tricky part.
Open the Data Module (F7).
In the top-left, change "Data Type" to 'Buttons'.
Search for "open gate". -You will find only one button in the list, called "Open Gate".
Right-click on the button and copy it. (ctrl+c)
Right-click again and paste the button. (ctrl+v)
Now right-click on your new button, "Open Gate Copy", choose 'Modify Object...' (ctrl+m) and rename it to 'Close Gate'
Change the buttons ID from "GateOpen2" to "GateClose", then press Ok.
You should now have your new button ready. The broken buttons should now have been fixed, and updated automatically!





Step 4:
Close the Data Module.
Open the Trigger Module (F6).
Create a new trigger, name it "Open Gate".

Change the Event to 'Unit - Unit Enters/Leaves Range of Unit' (it can easily be found if you filter search for "range").

Change it to: Unit - Any Unit Enters a distance of 3.0 from Gate [27.00, 32.00]
Gate [27.00, 32.00] is your pre-placed gate. (Step two of this tutorial.)
Add the following action:
'Unit - Issue Order' (can easily be found by filtering for "order")
change it to: Unit - Order Gate [27.00, 32.00] to ( Open Gate) (Replace Existing Orders)

When you search for the order "Open Gate" you will get a ton of Open Gate orders. -They are basically the same, and will all work for your gate, as long as it is the same unit -type.
The gate that I pre-placed in the second step of this tutorial is of unit type: "DestructibleGate"; meaning that all "Open Gate" (as well as "Close Gate") orders that has an ability name starting with "DestructibleGate.." will work on this unit.

Make a new Trigger, call it 'Close Gate', do the same thing as you did with the 'Open Gate' trigger, only this time, make it look like this:

Code:
Close Gate
    Events
        Unit - Any Unit Leaves a distance of 3.0 from Gate [27.00, 32.00]
    Local Variables
    Conditions
    Actions
        Unit - Order Gate [27.00, 32.00] to ( Close Gate) (Replace Existing Orders)

Step 5:
Finally, place a unit on your map (for example a Marine). Save your map. Order your marine to go near the Gate. (It is already open, so nothing should happen the first time.)
Order your marine to walk away from the gate. The gate should now close. (As long as the marine got withint 3.0 range of the gate, obviously.)
Now move your marine back and forth from the gate, notice how it opens and closes.

That's it, your gate button has been fixed and your gates should now work correctly!




Additional Info:
Lowered (open) gates are unselectable by default. Meaning if you own a gate, and click on it's Open Gate - button, then deselect the gate, you cannot select it again. (Even not by using ctrl+1 groups.)
This can be fixed by going into each gates 'Unit' -Tab in the Data Module. And unchecking the box "Unselectable" under 'Flags'.


Here are pictures of the different gate unit types:





 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,300
Is it possible to post a picture of opening/closing of the gate when any units walks through it? It will look nicely, in my opinion. :)
 

Jedimindtrixxx

┻━┻ ︵ ¯\(ツ)/¯ ︵ ┻━┻
Reaction score
170
its quite sad that they didnt use something as simple as the wc3 gates. those could be destroyed, or openedwith triggers and it always looked nice.
nice tut tho

if i memory serves me right the very first toss mission had some sort of gates that opened when you reached each prophecy. from what i recall the models looked pretty nice.
im actually gunna favourite this just incase i need to use a gate in a map
 

Exide

I am amazingly focused right now!
Reaction score
448
its quite sad that they didnt use something as simple as the wc3 gates. those could be destroyed, or openedwith triggers and it always looked nice.
nice tut tho

if i memory serves me right the very first toss mission had some sort of gates that opened when you reached each prophecy. from what i recall the models looked pretty nice.
im actually gunna favourite this just incase i need to use a gate in a map
Agreed.
It was so simple, and not bugged - too.

The first Zeratul mission, you mean?
I know that in Tosh' Outbreak there's Security Gates, but they only open (they don't close.)
The open gate button isn't broken, like the close gate button is.

Is it possible to post a picture of opening/closing of the gate when any units walks through it? It will look nicely, in my opinion. :)
Here you go:
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Happy Sunday!
    +1
  • The Helper The Helper:
    I will be out of town until Sunday evening
    +1
  • The Helper The Helper:
    I am back! Did you miss me LOL
    +1
  • jonas jonas:
    where did you go?
  • The Helper The Helper:
    Jefferson TX on a Paranormal Investigation of a haunted bed and breakfast - I got some friends that are paranormal investigators and they have an RV and do YouTubes
    +1
  • The Helper The Helper:
    It was a lot of fun. The RV was bad ass
  • jonas jonas:
    That sounds like fun!
    +1
  • The Helper The Helper:
    it was a blast!
  • The Helper The Helper:
    I am going to post the Youtube of the investigation in the forums when it is ready
    +1
  • jonas jonas:
    cool!
  • vypur85 vypur85:
    Sounds cool TH.
  • tom_mai78101 tom_mai78101:
    I was on a Legend of Zelda marathon...
  • tom_mai78101 tom_mai78101:
    Am still doing it now
    +1
  • jonas jonas:
    which one(s) are you playing?
  • jonas jonas:
    I played a little bit of the switch title two weeks ago and found it quite boring
  • The Helper The Helper:
    just got back from San Antonio this weekend had the best Buffalo Chicken Cheesesteak sandwhich in Universal City, TX - place was called Yous Guys freaking awesome! Hope everyone had a fantastic weekend!
    +1
  • The Helper The Helper:
    Happy Tuesday!
  • The Helper The Helper:
    We have been getting crazy numbers reported by the forum of people online the bots are going crazy on us I think it is AI training bots going at it at least that is what it looks like to me.
  • The Helper The Helper:
    Most legit traffic is tracked on multiple Analytics and we have Cloud Flare setup to block a ton of stuff but still there is large amount of bots that seem to escape detection and show up in the user list of the forum. I have been watching this bullshit for a year and still cannot figure it out it is drving me crazy lol.
    +1
  • Ghan Ghan:
    Beep boop
    +1
  • The Helper The Helper:
    hears robot sounds while 250 bots are on the forum lol
  • The Helper The Helper:
    Happy Saturday!
    +1

    The Helper Discord

    Staff online

    Members online

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top