Open/Close gates?

Exide

I am amazingly focused right now!
Reaction score
448
Hi.

What's the easiest way to open/close gates?
There doesn't seem to be such an action, like there were in WC3.. :thdown:

I would also like to know how I can check whenever a unit of type: 'Hero[1-16]' comes within X range of unit of type 'Gate (1)', 'Gate (2)', 'Gate (7)' or 'Gate (11)'.

I tried this:
Code:
Open, Close Doors
    Events
        Unit - Any Unit Enters a distance of 0.5 from Scientist [17.99, 12.42]
    Local Variables
    Conditions
        Or
            Conditions
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
    Actions
        Debug - Display "Success!" as debug output using Type 1, and Do display it in the game window

It didn't work.
I would like to change 'Scientist [blabla]' to 'Hero[X]'.
The different gates are (1), (2), (7) and (11).

There doesn't seem to be a "Add event to Trigger" action either.. :thdown:
 

Dave312

Censored for your safe viewing
Reaction score
269
What's the easiest way to open/close gates?
There doesn't seem to be such an action, like there were in WC3.. :thdown:

It's an ability command. So use the Issue Order action with no target and set the ability command to Open Gate (or something like that).


There doesn't seem to be a "Add event to Trigger" action either.. :thdown:
You can add one manually by following this tute. Then use this action to add ever gate to your open door trigger.
 

Exide

I am amazingly focused right now!
Reaction score
448
It's an ability command. So use the Issue Order action with no target and set the ability command to Open Gate (or something like that).

Yea, I found it after experimenting for a few hours yesterday. :p


Anyway, after experimenting I found this out:
All gates have an ability to Open, and Close.
-The Close Gate ability is bugged, somehow. (The button doesn't show properly, for example. I am not sure what impact this has on the game.)
An open gate cannot be selected, unless some options are checked in the Data Module for the gate.


Here's my triggers so far:

Code:
Gate In Range
    Events
        Unit - Any Unit Enters a distance of 5.0 from Scientist [20.78, 14.86]
    Local Variables
        i = 0 <Integer>
        g = (Empty unit group) <Unit Group>
        pg = (Empty player group) <Player Group>
    Conditions
        Or
            Conditions
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
    Actions
        General - If (Conditions) then do (Actions) else do (Actions)
            If
                (Custom value 0 of (Triggering unit)) != 1.0
            Then
                Variable - Set g = (Scientist units in (Region((Position of (Triggering unit)), 5.0)) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)
                General - If (Conditions) then do (Actions) else do (Actions)
                    If
                        (Number of Living units in g) != 0
                    Then
                        Unit Group - Pick each unit in g and do (Actions)
                            Actions
                                Variable - Set i = (Owner of (Picked unit))
                                Player Group - Add player i to pg
                                Variable - Set EKey[i] = true
                                Variable - Set ActivateUnit[i] = (Triggering unit)
                    Else
                UI - Display "<Press 'E' to open the gate>" for pg to Directive area
                General - Wait 5.0 Game Time seconds
                UI - Clear All Messages for pg
            Else


Code:
Gate Out of Range
    Events
        Unit - Any Unit Leaves a distance of 5.0 from Scientist [20.78, 14.86]
    Local Variables
        i = 0 <Integer>
        g = (Empty unit group) <Unit Group>
    Conditions
        Or
            Conditions
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
                (Unit type of (Triggering unit)) == Gate
    Actions
        Variable - Set g = (Scientist units in (Region((Position of (Triggering unit)), 15.0)) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)
        General - If (Conditions) then do (Actions) else do (Actions)
            If
                (Number of Living units in g) != 0
            Then
                Unit Group - Pick each unit in g and do (Actions)
                    Actions
                        Variable - Set i = (Owner of (Picked unit))
                        General - If (Conditions) then do (Actions) else do (Actions)
                            If
                                (Distance between (Position of (Triggering unit)) and (Position of (Picked unit))) > 5.0
                            Then
                                Unit - Set ActivateUnit[i] custom value 0 to 0.0
                                Unit - Order ActivateUnit[i] to (Smart Command) (Replace Existing Orders)
                                Variable - Set EKey[i] = false
                                Variable - Set ActivateUnit[i] = No Unit
                            Else
            Else


Code:
Activate
    Events
        UI - Player Any Player presses E key Down with shift Allow, control Allow, alt Allow
    Local Variables
        P = (Triggering player) <Integer>
    Conditions
    Actions
        General - If (Conditions) then do (Actions) else do (Actions)
            If
                EKey[P] == true
            Then
                Unit - Order ActivateUnit[P] to ( Open Gate) (Replace Existing Orders)
                Unit - Set ActivateUnit[P] custom value 0 to 1.0
            Else
                UI - Display "There's nothing within range to act..." for (Player group(P)) to Error area


Gate In Range checks if 'Scientist' (pre-placed) comes within range of "Any Unit". -It uses conditions to see if "Any Unit" is any of the gate types.
It then enables the player's EKey. (If the player presses 'E'; he activates the object, in this case opens the door.)

Gate Out of Range works as 'Gate In Range'; but the other way around.
It works, except I can't find a way to close the damned door..

Activate simply activates the object, ie opens a door.


Does anyone know how I can make my god damn gates close? :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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