• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Get Last Entangled Gold Mine

Status
Not open for further replies.
I guess I should show the trigger in question to better illustrate my query. I use Last Haunted Gold Mine purely as an example to where I'd like to have something like Last Entangled Gold Mine. The trigger is also not finished, so pay no attention to the Absorb Mana order (I'm using Channel).

  • Mine Gold
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mine Gold
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Target unit of ability being cast)) Equal to Gold Mine
        • Then - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Unit - Create 1 Dummy Unit for (Owner of (Target unit of ability being cast)) at TempPoint facing Default building facing degrees
          • Unit - Add Root (Ancients) to (Last created unit)
          • Unit - Add Entangle Gold Mine to (Last created unit)
          • Unit - Order (Last created unit) to Night Elf Tree Of Life - Entangle (Instant) (Target unit of ability being cast)
          • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
          • Set ID = (Custom value of (Last Haunted Gold Mine))
          • Unit - Remove (Ability being cast) from (Triggering unit)
          • Unit - Add Mine Gold to (Triggering unit)
          • Unit - Order (Triggering unit) to Undead Destroyer - Absorb Mana (Target unit of ability being cast)
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Gold Mine (Dummy Gold Mine)
            • Then - Actions
              • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
              • Set ID = (Custom value of (Target unit of ability being cast))
              • Custom script: if udg_Minion_group[udg_ID] == null then
              • Custom script: set udg_Minion_group[udg_ID] = CreateGroup()
              • Custom script: endif
              • Unit Group - Add (Triggering unit) to Minion_group[ID]
            • Else - Actions
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
I guess I should show the trigger in question to better illustrate my query. I use Last Haunted Gold Mine purely as an example to where I'd like to have something like Last Entangled Gold Mine. The trigger is also not finished, so pay no attention to the Absorb Mana order (I'm using Channel).

  • Mine Gold
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mine Gold
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Target unit of ability being cast)) Equal to Gold Mine
        • Then - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Unit - Create 1 Dummy Unit for (Owner of (Target unit of ability being cast)) at TempPoint facing Default building facing degrees
          • Unit - Add Root (Ancients) to (Last created unit)
          • Unit - Add Entangle Gold Mine to (Last created unit)
          • Unit - Order (Last created unit) to Night Elf Tree Of Life - Entangle (Instant) (Target unit of ability being cast)
          • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
          • Set ID = (Custom value of (Last Haunted Gold Mine))
          • Unit - Remove (Ability being cast) from (Triggering unit)
          • Unit - Add Mine Gold to (Triggering unit)
          • Unit - Order (Triggering unit) to Undead Destroyer - Absorb Mana (Target unit of ability being cast)
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Gold Mine (Dummy Gold Mine)
            • Then - Actions
              • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
              • Set ID = (Custom value of (Target unit of ability being cast))
              • Custom script: if udg_Minion_group[udg_ID] == null then
              • Custom script: set udg_Minion_group[udg_ID] = CreateGroup()
              • Custom script: endif
              • Unit Group - Add (Triggering unit) to Minion_group[ID]
            • Else - Actions

Ahh okay. Maybe picking all units within last created unit with the matching condition that the unit type is an entangled gold mine will help. After you pick the unit do something like GoldMineVariable = (Picked Unit)
 
Last edited:
Level 37
Joined
Jul 22, 2015
Messages
3,485
Wouldn't that be the same thing as set udg_Unit = GetLastCreatedUnit() ?

No it wouldn't be. The Entangled Gold Mine isn't being created via create a unit trigger. It is being constructed. What's wrong with picking all units within the Tree of Life that match a unit-type condition?

Also I think what I'm trying to do is impossible as there might be a delay on the order or at least the entangling only happens once the trigger is over.

The entangling gold mine is instant. I'm not entirely sure what you're trying to do with this trigger. Mind elaborating?
 
Status
Not open for further replies.
Top