• 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.

Triggering help needed. Items sold and unit orders

Status
Not open for further replies.
Level 7
Joined
May 15, 2009
Messages
192
Battlehound asking for help again.

This time around I thought, that I had made a smart trigger system for upgrades in my map - but it won't work.

What I want it to do is when you buy an item (the item has no effect whatsoever) you order an invisible blacksmith style unit make an upgrade fitting for the item you got. For example; You buy Upgrade Ranged Armor, this should issue an order to your upgrader that it should make the Ranged Armor upgrade.

Now I made the trigger so that it should function no matter what player got the item, but nothing seems to happen:(

Heres the trigger:

  • Upgrading
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Upgrade Melee Armor
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Upgrader) and ((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))))) and do (Actions)
            • Loop - Actions
              • Unit - Order (Picked unit) to research Melee Armor
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Upgrade Melee Damage
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Upgrader) and ((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))))) and do (Actions)
            • Loop - Actions
              • Unit - Order (Picked unit) to research Melee Damage
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Upgrade Ranged Armor
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Upgrader) and ((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))))) and do (Actions)
            • Loop - Actions
              • Unit - Order (Picked unit) to research Ranged Armor
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Upgrade Ranged Damage
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Upgrader) and ((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))))) and do (Actions)
            • Loop - Actions
              • Unit - Order (Picked unit) to research Ranged Damage
        • Else - Actions
Help much appreciated.
(btw, I have 1 upgrader unit placed on the map for each player.)
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
AFAIK, "Item Being Manipulated " is not set in Unit - A unit sells an item but "Sold Item" is. try that

also, much easier to just Player - Set level of Research to # for Player
 
Status
Not open for further replies.
Top