• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Equip/Unequip trigger problem

Status
Not open for further replies.
Level 6
Joined
Apr 26, 2007
Messages
225
Here is the trigger for EQUIP:

  • Equip Chest
    • Events
      • Unit - A unit Uses an item
    • 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 Iron Set - |cffffcc00Chest Armor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Unit-type of (Hero manipulating item)) Equal to Geomancer
                  • Equip_Chest[(Player number of (Owner of (Hero manipulating item)))] Equal to False
            • Then - Actions
              • Unit Group - Pick every unit in (Units owned by (Owner of (Hero manipulating item))) and do (Actions)
                • Loop - Actions
                  • Set Equip_Chest[(Player number of (Owner of (Hero manipulating item)))] = True
                  • Set chest[(Player number of (Owner of (Hero manipulating item)))] = iron armor
                  • Hero - Modify Agility of (Hero manipulating item): Add 1
                  • Hero - Modify Intelligence of (Hero manipulating item): Add 1
                  • Hero - Modify Strength of (Hero manipulating item): Add 4
                  • Unit - Add Iron Armor 5def to (Hero manipulating item)
            • Else - Actions
              • Game - Display to (All players matching ((Owner of (Hero manipulating item)) Equal to (Matching player))) the text: |cffff0000Item can'...
              • Hero - Create Iron Set - |cffffcc00Chest Armor|r and give it to (Hero manipulating item)
        • 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 Cloth Set - |cffffcc00Chest Armor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Unit-type of (Hero manipulating item)) Equal to Mage
                  • Equip_Chest[(Player number of (Owner of (Hero manipulating item)))] Equal to False
            • Then - Actions
              • Unit Group - Pick every unit in (Units owned by (Owner of (Hero manipulating item))) and do (Actions)
                • Loop - Actions
                  • Set Equip_Chest[(Player number of (Owner of (Hero manipulating item)))] = True
                  • Set chest[(Player number of (Owner of (Hero manipulating item)))] = cloth armor
                  • Hero - Modify Agility of (Hero manipulating item): Add 1
                  • Hero - Modify Intelligence of (Hero manipulating item): Add 6
                  • Hero - Modify Strength of (Hero manipulating item): Add 1
                  • Unit - Add Iron Armor 2def to (Hero manipulating item)
            • Else - Actions
              • Game - Display to (All players matching ((Owner of (Hero manipulating item)) Equal to (Matching player))) the text: |cffff0000Item can'...
              • Hero - Create Cloth Set - |cffffcc00Chest Armor|r and give it to (Hero manipulating item)
        • Else - Actions
Here is the UNEQUIP trigger:

  • Unequip Chest
    • Events
      • Player - Player 1 (Red) types a chat message containing -unequip chest as An exact match
      • Player - Player 2 (Blue) types a chat message containing -unequip chest as An exact match
      • Player - Player 3 (Teal) types a chat message containing -unequip chest as An exact match
      • Player - Player 4 (Purple) types a chat message containing -unequip chest as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -unequip chest as An exact match
      • Player - Player 6 (Orange) types a chat message containing -unequip chest as An exact match
      • Player - Player 7 (Green) types a chat message containing -unequip chest as An exact match
      • Player - Player 8 (Pink) types a chat message containing -unequip chest as An exact match
    • Conditions
    • Actions
      • Game - Display to (All players) the text: 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Equip_Chest[(Player number of (Matching player))] Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • chest[(Player number of (Matching player))] Equal to iron armor
            • Then - Actions
              • Unit Group - Pick every unit in (Units owned by (Matching player)) and do (Actions)
                • Loop - Actions
                  • Set Equip_Chest[(Player number of (Owner of (Picked unit)))] = False
                  • Set chest[(Player number of (Owner of (Picked unit)))] = <Empty String>
                  • Hero - Modify Agility of (Picked unit): Subtract 1
                  • Hero - Modify Intelligence of (Picked unit): Subtract 1
                  • Hero - Modify Strength of (Picked unit): Subtract 4
                  • Unit - Remove Iron Armor 5def from (Picked unit)
                  • Hero - Create Iron Set - |cffffcc00Chest Armor|r and give it to (Picked unit)
                  • Game - Display to (All players matching ((Owner of (Picked unit)) Equal to (Matching player))) the text: Item Sucessfully un...
            • Else - Actions
              • Unit Group - Pick every unit in (Units owned by (Matching player)) and do (Actions)
                • Loop - Actions
                  • Game - Display to (All players matching ((Owner of (Picked unit)) Equal to (Matching player))) the text: You don't have a ch...
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • chest[(Player number of (Matching player))] Equal to cloth armor
            • Then - Actions
              • Game - Display to (All players) the text: 2
              • Unit Group - Pick every unit in (Units owned by (Matching player)) and do (Actions)
                • Loop - Actions
                  • Game - Display to (All players) the text: 3
                  • Set Equip_Chest[(Player number of (Owner of (Picked unit)))] = False
                  • Set chest[(Player number of (Owner of (Picked unit)))] = <Empty String>
                  • Hero - Modify Agility of (Picked unit): Subtract 1
                  • Hero - Modify Intelligence of (Picked unit): Subtract 6
                  • Hero - Modify Strength of (Picked unit): Subtract 1
                  • Unit - Remove Iron Armor 2def from (Picked unit)
                  • Hero - Create Cloth Set - |cffffcc00Chest Armor|r and give it to (Picked unit)
                  • Game - Display to (All players matching ((Owner of (Picked unit)) Equal to (Matching player))) the text: Item Sucessfully un...
            • Else - Actions
              • Unit Group - Pick every unit in (Units owned by (Matching player)) and do (Actions)
                • Loop - Actions
                  • Game - Display to (All players matching ((Owner of (Picked unit)) Equal to (Matching player))) the text: You don't have a ch...
        • Else - Actions
The chest item is usable like a potion and equip successfully BUT i wan the def skill to be invisible because with a weapon, an armor, shoulders, etc... it take all spaces and its just unwanted...

The unequip function doesn't work at all, i can see the game message "1" and "2" but the 3 never appear. These were ment only to see how far the trigger can go so the "cloth armor" string idea work but for some reason the trigger wont go in the loop.
 
Level 1
Joined
Jul 29, 2009
Messages
4
This is just a guess, but I think you can't have (matching player) in your "pick units owned by" action. There is no action in the trigger to define a "matching player". Try using triggering player.
 
For the unequip trigger, use (Triggering Player) instead of (Matching Player):
1) If - Conditions
Equip_Chest[(Player number of (Triggering player))] Equal to True
2) Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
3) Game - Display to (All players matching ((Owner of (Picked unit)) Equal to (Matching player))) the text: Item Sucessfully un... > This should be (Game - Display to (Player Group(Owner of (Picked unit))) the text...| When the window appears to select that player group, go to Convert Player Group to Player.
4) chest[(Player number of (Triggering player))] Equal to cloth armor
 
Level 6
Joined
Apr 26, 2007
Messages
225
All i can "convert" is Convert Player Index to Player i'm editing the trigger right now i'll edit if i can get it to work thanks for the help

EDIT: found out about the player group thing, thanks ive never seen that ad it would have solved a lot in the past XD

EDIT2: Not working... Maybe i did somehting wrong?
  • Unequip Chest
    • Events
      • Player - Player 1 (Red) types a chat message containing -unequip chest as An exact match
      • Player - Player 2 (Blue) types a chat message containing -unequip chest as An exact match
      • Player - Player 3 (Teal) types a chat message containing -unequip chest as An exact match
      • Player - Player 4 (Purple) types a chat message containing -unequip chest as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -unequip chest as An exact match
      • Player - Player 6 (Orange) types a chat message containing -unequip chest as An exact match
      • Player - Player 7 (Green) types a chat message containing -unequip chest as An exact match
      • Player - Player 8 (Pink) types a chat message containing -unequip chest as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Equip_Chest[(Player number of (Picked player))] Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • chest[(Player number of (Picked player))] Equal to iron armor
            • Then - Actions
              • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
                • Loop - Actions
                  • Set Equip_Chest[(Player number of (Triggering player))] = False
                  • Set chest[(Player number of (Triggering player))] = <Empty String>
                  • Hero - Modify Agility of (Picked unit): Subtract 1
                  • Hero - Modify Intelligence of (Picked unit): Subtract 1
                  • Hero - Modify Strength of (Picked unit): Subtract 4
                  • Unit - Remove Iron Armor 5def from (Picked unit)
                  • Hero - Create Iron Set - |cffffcc00Chest Armor|r and give it to (Picked unit)
                  • Game - Display to (Player group((Owner of (Picked unit)))) the text: Item Sucessfully un...
            • Else - Actions
              • Game - Display to (Player group((Picked player))) the text: You don't have a ch...
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • chest[(Player number of (Picked player))] Equal to cloth armor
            • Then - Actions
              • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
                • Loop - Actions
                  • Set Equip_Chest[(Player number of (Owner of (Picked unit)))] = False
                  • Set chest[(Player number of (Owner of (Picked unit)))] = <Empty String>
                  • Hero - Modify Agility of (Picked unit): Subtract 1
                  • Hero - Modify Intelligence of (Picked unit): Subtract 6
                  • Hero - Modify Strength of (Picked unit): Subtract 1
                  • Unit - Remove Iron Armor 2def from (Picked unit)
                  • Hero - Create Cloth Set - |cffffcc00Chest Armor|r and give it to (Picked unit)
                  • Game - Display to (Player group((Picked player))) the text: Item Sucessfully un...
            • Else - Actions
              • Game - Display to (Player group((Picked player))) the text: You don't have a ch...
        • Else - Actions
 
Level 6
Joined
Apr 26, 2007
Messages
225
Euh you posted same time as i edited wan to make sure u see my edit ^ sorry about the useless post tho

EDIT: that mean that my problem is not solved by the way...
 
Last edited:
Level 1
Joined
Jul 29, 2009
Messages
4
Ok, you are still having a problem with which player variable to use. When you do Pick all Units Owned By (Picked Player), you have no action to define a picked player. Stick with "Triggering Player" in all the instances where you use "Picked Player" and it should make the trigger work (I think).

EDIT: Also, I think you need to move your "You don't have a chest piece equipped" message to the last "Else" action group. As it stands, the message will only display if the player doesn't have an iron armor piece equipped.
 
Status
Not open for further replies.
Top