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

[Trigger] Custom Race Pick - problem with functioning

Status
Not open for further replies.
I am trying to make a unit to train 5 workers, create a unqiue mine(if race requires) and replace it with the respective town hall. However I stumbled upon two issues.

1.I cant find what is wrong with the trigger, but when I buy a unit it creates 4 more, and then - it creates 5 town halls.
2. The wisps cannot enter the entangled gold mine, and the acolytes cannot enter the haunted gold mine. They are a copy, but I haven't removed any abilities and classifications.

  • Manage Picked Race
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Selling unit)) Equal to |cff0000ffRace Pick|r (Alliance)
          • (Unit-type of (Selling unit)) Equal to |cffff0000Race Pick|r (Horde)
    • Actions
      • Set SellingPicker = (Selling unit)
      • Set SoldFromPicker = (Unit-type of (Sold unit))
      • Unit - Order SellingPicker to train/upgrade to a SoldFromPicker
      • Unit - Order SellingPicker to train/upgrade to a SoldFromPicker
      • Unit - Order SellingPicker to train/upgrade to a SoldFromPicker
      • Unit - Order SellingPicker to train/upgrade to a SoldFromPicker
      • -------- For the Ones with Unique Gold Mine ---> --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SoldFromPicker Equal to AssosiatedWorker[4]
        • Then - Actions
          • Set StarterTempLoc = (Position of SellingPicker)
          • Set PickNearbyMineStarter = (Units within 1000.00 of StarterTempLoc matching ((Unit-type of (Matching unit)) Equal to Gold Mine))
          • Unit - Change ownership of (Random unit from PickNearbyMineStarter) to (Owner of SellingPicker) and Change color
          • Unit - Replace (Random unit from PickNearbyMineStarter) with a Entangled Gold Mine using The new unit's max life and mana
          • Custom script: call RemoveLocation(udg_StarterTempLoc)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SoldFromPicker Equal to AssosiatedWorker[3]
        • Then - Actions
          • Set StarterTempLoc = (Position of SellingPicker)
          • Set PickNearbyMineStarter = (Units within 1000.00 of StarterTempLoc matching ((Unit-type of (Matching unit)) Equal to Gold Mine))
          • Unit - Change ownership of (Random unit from PickNearbyMineStarter) to (Owner of SellingPicker) and Change color
          • Unit - Replace (Random unit from PickNearbyMineStarter) with a Haunted Gold Mine using The new unit's max life and mana
          • Custom script: call RemoveLocation(udg_StarterTempLoc)
        • Else - Actions
      • -------- Now the Town Hall -----> --------
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SoldFromPicker Equal to AssosiatedWorker[(Integer A)]
            • Then - Actions
              • Unit - Replace SellingPicker with a AssosiatedTownHall[(Integer A)] using The new unit's max life and mana
              • Skip remaining actions
            • Else - Actions
 

Attachments

  • HVA.w3x
    19.4 KB · Views: 51
Status
Not open for further replies.
Top