Snippet Item Gate Opening Trigger

Miz

Administrator
Reaction score
424
This is a Demo of the Trigger of a Item Gate Opening
This isn't a tutorial it is in a way but only a type of trigger

Introduction
The Item Gate Opening Trigger is a basic way in many game such as Zerg Infestation, Parasite (Never played) and many more
Which a door is opened when a unit holds a item to open this gate

Here is my horrible diagram

Note: The WayGate is the normal Iron Gate but couldn't find one so I just posted a way Gate

OpenGate.jpg



Step 1
Make sure your Gates can not be damaged
Which in your map may have more then 1 gate but my map has a gate in the middle of nowhere so I only have 1.

Code:
Gate Invulnerable
    Events
        Map initialization
    Conditions
    Actions
        Destructible - Make Iron Gate (Vertical) 0000 <gen> Invulnerable

This way it is impossible to destory the gate

Step 2
This is when the Trigger actually has the Unit in it

Code:
Untitled Trigger 001
    Events
        Unit - A unit enters Region 000 <gen>
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item-type of (Item carried by (Triggering unit) in [COLOR="Red"]slot 1[/COLOR])) [B]Equal to [/B][COLOR="Blue"]Moon Key[/COLOR]
            Then - Actions
                Destructible - Open Iron Gate (Vertical) 0000 <gen>
                Wait 10.00 seconds
                Destructible - Close Iron Gate (Vertical) 0000 <gen>
            Else - Actions
                [COLOR="green"]Do nothing[/COLOR]

Notes
Notes are done by color

1. This maybe a probelm in the future which I am going to try to rewrite but couldn't find it (maybe wasn't trying very hard)
but to avoid this from not working make sure that the Item can't be droped so it can't move slots

2. You can change the Item to w/e you want

3. You can leave it blank acording to Ace but Idk I think its better if you put the Do Nothing but you may do w/e you want

Sorry
Screenshots I took will not open but its pretty easy to understand
I may do Updates on the trigger is anyone suggest or I find a better way to do stuff

Comments Welcome
If you don't have something nice or constructive don't say anything at all

Download Guide
 
D

domg839

Guest
I used a gate but this is what I did.
Code:
Secret Door Open
    Events
        Unit - A unit enters DemonicGateRegion<gen>
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has an item of type [B]Old Key[/B]) Equal to True)) and do (Actions)
            Loop - Actions
                Destructible - Open Demonic Gate (Vertical) 4651 <gen>

Old Key
is the item
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
@Mizuio-Ken:

I don't think that the door should shut after 10 seconds. I think you should just turn off the trigger but that's just me. :)

Also, Do Nothing is a useless BJ, so it is better to leave it blank.

But this can be extremely helpful to new map makers. :D
 

Void

New Member
Reaction score
16
For each Integer A from 1-6:
If:
Unit has (item) in inventory slot (integer a)
Then:
Open gate
Else:
Do nothing
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top