1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Open Gates Created INGAME

Discussion in 'Requests' started by Shaki, Sep 5, 2010.

  1. Shaki

    Shaki

    Joined:
    Jan 20, 2009
    Messages:
    19
    Resources:
    0
    Resources:
    0
    Hello, i would like to ask something. How do i create a trigger where it opens a gate that was created in game, with a certain item.
    I know you can set variables to the specific gate and item and all that blah blah blah.
    The real issue that i am having is that i need this to work.
    • fhfd
      • Events
        • Unit - A unit comes within 256.00 of Blue Door
      • Conditions
        • ((Triggering unit) has an item of type Blue Key) Equal to True
        • (Unit-type of (Triggering unit)) Equal to Mazer
      • Actions
        • Destructible - Open Blue Door
        • Wait 5.00 seconds
        • Destructible - Remove Blue Door
    The main issue is, i want a destructible OF type, to be the event. help.
    So, my request is to make a trigger like that. You can use Custom Script even. Thanks for helping :)
     
  2. Tr!KzZ

    Tr!KzZ

    Joined:
    Mar 7, 2005
    Messages:
    800
    Resources:
    29
    Models:
    18
    Icons:
    2
    Maps:
    9
    Resources:
    29
    It's pretty simple.. you could have made it yourself, but you didn't know the fact that destructables can't be used as events like you want to use them.

    So what we're going to do is using a normal unit instead. Just create a new custom Unit based of a normal building, let's say the human barracks. Remove all unneeded things, like can produce units, build-requirements, etc. After that change the Model of the Building to your Gate you want to use and also add the shadow path from the Gate to it, or it could look a bit strange. Now scroll down to the Path options, you have to set the Gate as a path, so no units can pass it easily and it will fit with the model you choosed, some adjustments here and there, maybe about selection scaling and you're done with the Gate.

    Now here's the Trigger that will only open the Gate if the trespassing Unit has the needed item(s).

    • Open Gate
      • Events
        • Unit - A unit comes within 150.00 of Gate (closed) 0004 <gen>
      • Conditions
        • (Triggering unit) Equal Mazer 0002 <gen>
        • ((Triggering unit) has an item of type Gate-Key XY) Equal True
      • Actions
        • Unit - Replace Gate (closed) 0004 <gen> with a Gate (open) using new Unit's: Standard - life and mana
        • Animation - Play (Last replaced unit)'s death alternate animation
    Info
    Event: Just choose the Gate you want to open for this trigger and change it with "Gate (closed) 0004 <gen>" in the trigger

    Actions: You just need to copy the "Gate Closed" Unit and paste it to the object editor. after that just edit the path from normal Gate to "Gate <dead>" path, so the units can pass it after it was opened.


    Hope you get it, good luck trying this ;) Already tested it, and it definitly works!

    Greetings,
    Tr!KzZ
     
  3. Shaki

    Shaki

    Joined:
    Jan 20, 2009
    Messages:
    19
    Resources:
    0
    Resources:
    0
    Thanks for the attempt of helping but thats not what i stated needed help with. I dont need a SPECIFIC GATE that is NOT a variable. It is a gate that the player can create multiple of in game. So i cant select a certain unit. sorry for your time but it helped me none at all :p.
     
  4. Tr!KzZ

    Tr!KzZ

    Joined:
    Mar 7, 2005
    Messages:
    800
    Resources:
    29
    Models:
    18
    Icons:
    2
    Maps:
    9
    Resources:
    29
    Uhm it will help you :p

    1.
    You can do this with this trigger easily.. just use variables.. set Blue Gate[x] (variable with array, x = number that raises, like x= x+1 after each use) = Last created Unit (Your Gate)

    Later on set the Key into variables. BlueKey[y] = Blue Key Item XYZ.
    If Unit comes within Range of Gate[x] he needs BlueKey[y], which for example could be key1 or 5 or whatever.. You just need to control that x=y in that moment, so Key5 only works for Gate5, not for Gate4.

    2.
    You could create a invisible Unit near the Gate, store it into a variable and then just use this unit to open the gate, like Mazer comes close to Unit XY, open gate, if he has the Key..

    That's all I can help you for now, if this don't helps you at all, I just tried it ;) Good Luck with it!
     
  5. Pharaoh_

    Pharaoh_

    Joined:
    Nov 6, 2008
    Messages:
    8,127
    Resources:
    11
    Icons:
    3
    Skins:
    1
    Spells:
    6
    Tutorials:
    1
    Resources:
    11
    Ok, I made a small system, here:
    • One
      • Events
        • Unit - A unit Acquires an item
        • Unit - A unit Loses an item
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Blood Key
      • Actions
        • Custom script: local group g
        • Custom script: if GetTriggerEventId() == EVENT_PLAYER_UNIT_PICKUP_ITEM then
        • Custom script: set g = CreateGroup()
        • Custom script: call SaveGroupHandle (udg_Hash, GetHandleId (GetTriggerUnit()), StringHash("group"), g)
        • Unit Group - Add (Triggering unit) to KeyGroup
        • Trigger - Turn on Two <gen>
        • Custom script: else
        • Unit Group - Pick every unit in (Load (Key group) of (Key (Triggering unit)) in Hash) and do (Actions)
          • Loop - Actions
            • Unit - Kill (Load (Key ghostgate) of (Key (Picked unit)) in Hash)
            • Unit - Remove (Load (Key ghostgate) of (Key (Picked unit)) in Hash) from the game
            • Unit - Unhide (Picked unit)
            • Unit Group - Remove (Picked unit) from (Load (Key group) of (Key (Triggering unit)) in Hash)
            • Unit Group - Remove (Picked unit) from OpenedGates
            • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hash
            • Custom script: call RemoveLocation (udg_Points[3])
        • Unit Group - Remove (Triggering unit) from KeyGroup
        • Custom script: call DestroyGroup (LoadGroupHandle (udg_Hash, GetHandleId (GetTriggerUnit()), StringHash("group")))
        • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Hash
        • Custom script: endif
        • Custom script: set g = null

    • Two
      • Events
        • Time - Every 1.00 seconds of game time
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (KeyGroup is empty) Equal to False
          • Then - Actions
            • Unit Group - Pick every unit in KeyGroup and do (Actions)
              • Loop - Actions
                • Set Points[1] = (Position of (Picked unit))
                • Set Bearer = (Picked unit)
                • Custom script: set bj_wantDestroyGroup = true
                • Unit Group - Pick every unit in (Units within 300.00 of Points[1] matching (((((Matching unit) is in OpenedGates) Equal to False) and (((Matching unit) is in UnderConstruction) Equal to False)) and (((Unit-type of (Matching unit)) Equal to Gate) and (((Matching unit) is in (Load (Key group) and do (Actions)
                  • Loop - Actions
                    • Set Points[2] = (Position of (Picked unit))
                    • Unit Group - Add (Picked unit) to (Load (Key group) of (Key Bearer) in Hash)
                    • Unit - Hide (Picked unit)
                    • Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of (Picked unit)) at Points[2] facing Default building facing degrees
                    • Custom script: call UnitAddAbility (GetLastCreatedUnit(), 'Aloc')
                    • Animation - Play (Last created unit)'s death alternate animation
                    • Unit Group - Add (Picked unit) to OpenedGates
                    • Hashtable - Save Handle Of(Last created unit) as (Key ghostgate) of (Key (Picked unit)) in Hash
                    • Custom script: call RemoveLocation (udg_Points[2])
                • Unit Group - Pick every unit in (Load (Key group) of (Key (Picked unit)) in Hash) and do (Actions)
                  • Loop - Actions
                    • Set Points[3] = (Position of (Picked unit))
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Distance between Points[1] and Points[3]) Greater than 305.00
                      • Then - Actions
                        • Unit - Kill (Load (Key ghostgate) of (Key (Picked unit)) in Hash)
                        • Unit - Remove (Load (Key ghostgate) of (Key (Picked unit)) in Hash) from the game
                        • Unit - Unhide (Picked unit)
                        • Unit Group - Remove (Picked unit) from (Load (Key group) of (Key Bearer) in Hash)
                        • Unit Group - Remove (Picked unit) from OpenedGates
                        • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hash
                      • Else - Actions
                    • Custom script: call RemoveLocation (udg_Points[3])
                • Custom script: call RemoveLocation (udg_Points[1])
          • Else - Actions
            • Trigger - Turn off (This trigger)

    • Three
      • Events
        • Unit - A unit Begins construction
        • Unit - A unit Finishes construction
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Gate
      • Actions
        • Custom script: if GetTriggerEventId() == EVENT_PLAYER_UNIT_CONSTRUCT_START then
        • Unit Group - Add (Triggering unit) to UnderConstruction
        • Custom script: else
        • Unit Group - Remove (Triggering unit) from UnderConstruction
        • Custom script: endif
     

    Attached Files: