• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Hard Trigger Plz Help - Combine Tower. {combine if the correct units are selected}

Status
Not open for further replies.
Level 2
Joined
Oct 24, 2008
Messages
9
I'm trying to make triggers work so that when you select 3 towers a combine button shows up; it disappears if you deselect them. On a new trigger, when you click combine, it checks if you have selected the right towers to combine with, if you have it'll combine them into a new tower. (like in Gem / Poker TD )

I'm stuck so +rep to anyone who can solve this! Thanks.
 
Well,

Events
Selection - Player 1 (Red) selects a unit
Conditions
(Unit-type of (Triggering unit)) Equal to X OR (Unit-type of (Triggering unit)) Equal to Y OR (Unit-type of (Triggering unit)) Equal to Z
Actions
Set Int = (Int + 1)
Unit - Add (Triggering unit) to (CombinationGroup)

Events
Time - Every 0.1 seconds of game time
Conditions
Int Greater than or Equal to 3 AND (Number of units in CombinationGroup) Greater than or Equal to 3
Actions
Unit Group - Pick up every unit in (CombinationGroup) and do (Actions)
Loop - Actions
Unit - Kill (Picked unit)
Set Point1 = Your point to create the new unit
Unit - Create 1 New Tower at Point1 facingd efault building degrees
Custom script: call RemoveLocation (udg_Point1)
 
Level 2
Joined
May 23, 2009
Messages
19
  • SelectedTowerComparer
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Combine
    • Actions
      • Set SelectedUnits = (Units currently selected by (Owner of (Triggering unit)))
      • Unit Group - Remove (Triggering unit) from SelectedUnits
      • For each (Integer A) from 1 to NumberOfCombinableTowers, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CominableList[(Integer A)] Equal to (Unit-type of (Triggering unit))
            • Then - Actions
              • Set UnitAIndex = (Integer A)
            • Else - Actions
              • Do nothing
      • Unit Group - Pick every unit in SelectedUnits and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to RequiredUnitB[UnitAIndex]
            • Then - Actions
              • Unit Group - Remove (Picked unit) from SelectedUnits
              • Unit Group - Pick every unit in SelectedUnits and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Equal to RequiredUnitC[UnitAIndex]
                    • Then - Actions
                      • -------- SUCCESS! --------
                    • Else - Actions
                      • Do nothing
              • Unit Group - Add (Picked unit) to SelectedUnits
            • Else - Actions
              • Do nothing
 
Level 2
Joined
Oct 24, 2008
Messages
9
Solved! Thanks anyway..

2ztc2v6.png


Credit to Pointy@USEAST he's a genius ... thought of this solution in >5 min.

:D
 
Status
Not open for further replies.
Top