• 🏆 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!

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