Tutorial General - Making Gates Close

Exide

I am amazingly focused right now!
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
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

┻━┻ ︵ ¯\(ツ)/¯ ︵ ┻━┻
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!
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.
  • Ghan Ghan:
    Seeing J4L is definitely a blast from the past.
  • Jesus4Lyf Jesus4Lyf:
    Oh hey Ghan! Long time. :)
    +1
  • jonas jonas:
    J4L! What has happened in your life
  • Jesus4Lyf Jesus4Lyf:
    Hmm, how to summarize... Moved to the USA and got married. Became a professional software engineer and solution lead. Learning Godot for game dev. :)
  • jonas jonas:
    So you are pursuing game dev as a hobby? What industry is your dayjob in?
  • jonas jonas:
    FAANG?
  • Jesus4Lyf Jesus4Lyf:
    Not quite FAANG, less pay for a less hours/stress. Yeah, game dev as a hobby.
  • jonas jonas:
    makes sense. Do we have a hobby game dev subforum to showcase some work?
  • Blackveiled Blackveiled:
    Happy Thursday
    +1
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    TGIF!
  • The Helper The Helper:
    hey tom_mai please do not archive anymore news
  • Ghan Ghan:
    AMD Ryzen 7000 next week :D
    +1
  • The Helper The Helper:
    noice!
  • tom_mai78101 tom_mai78101:
    "hey tom_mai please do not archive anymore news" ----> Got it. What should we do with the "News Archive" subforum?
  • The Helper The Helper:
    I think leave it for real old news that cannot be sorted the reason we had it in the first place was a server issue that we do not have anymore. I don't want to get rid of the archive just not put anything in it for now until we figure it out more
  • The Helper The Helper:
    The side chat has nothing on the discord. it is not possible but the biggest thing on my wish list right now is a sidechat channel on the disord that hooks up to this...
  • Ghan Ghan:
    I've been selected for the Diablo IV beta.
    +1
  • Ghan Ghan:
    Woo!
    +1
  • The Helper The Helper:
    that is so cool
  • V-SNES V-SNES:
    Eh just noticed the new discord section on the side. Looks great!
    +1
  • Blackveiled Blackveiled:
    :( feels bad I can't ever get selected for any beta I sign up for. It's annoying as heck.
    +1
  • The Helper The Helper:
    Hello mgarcia! Happy Monday everyone!

    The Helper Discord

    Members online

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top