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.)

sc2tutorialgatescrn01.jpg



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.

sc2tutorialgatescrn02.jpg



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!


sc2tutorialgatescrn03.jpg



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:

sc2tutorialgatescrn04.jpg


sc2tutorialgatescrn05.jpg


sc2tutorialgatescrn06.jpg
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,667
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
168
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:
89452055.jpg
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top