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

[Trigger] trouble with my equipment system

Status
Not open for further replies.
Level 4
Joined
Oct 19, 2010
Messages
71
Hi. Thank you very much for reading this.

I've been having trouble with the equipment system for my map. I'm using a spellbook as the equipment screen. When the player clicks on a piece of equipment it removes the item from inventory and adds an ability to "remove the item" to the spellbook. Unfortunately, for some reason the abilities are getting mixed up somehow. So far I've only made 2 separate items (gloves and helms) and after they're both equipped, clicking on the spellbook ability to remove the item does remove it. However, after you equip it again, no matter which item you try to remove, it removes the other item (the one that wasn't removed first) and it goes back and forth each time you repeat that. I'm very sure it has to do with the spellbook abilities, but I haven't been able to fix it. It may not be necessary to view this trigger to answer the question, but here is the one to remove hand items. There is another one for head items.

  • Remove Hands
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Remove Leather Gloves
          • (Ability being cast) Equal to Remove Gauntlets
    • Actions
      • Set tempPoint = (Position of (Triggering unit))
      • Item - Create hands at tempPoint
      • Custom script: call RemoveLocation(udg_tempPoint)
      • Unit - Order (Triggering unit) to Right-Click (Last created item)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Ability being cast) Equal to Remove Leather Gloves
              • hands Equal to Leather Gloves
        • Then - Actions
          • Unit - Remove Equip Leather Gloves from (Triggering unit)
          • Unit - Remove Item Armor Bonus (+1) from (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Ability being cast) Equal to Remove Gauntlets
              • hands Equal to Gauntlets
        • Then - Actions
          • Unit - Remove Equip Gauntlets from (Triggering unit)
          • Unit - Remove Item Armor Bonus (+4) from (Triggering unit)
        • Else - Actions
      • Set hands = (Item-type of No item)
Thank you very much for any assistance.
 
Level 4
Joined
Oct 19, 2010
Messages
71
test map

Sure. Here is a test map.

After more testing, I'm able to describe what's happening more clearly.

When you click on "remove leather gloves" or "remove leather helm", it's just removing the one that was added first. When you equip the item again, it's removing the other one because that one was in the "equipment" (spellbook) first.

Okay I know what the problem is. It's happening because they are both based on the same ability. I'm going to have 11 equipment slots, so I'll need to have each slot's items based on a separate ability. BTW, is there another solution where I can have them all based on the same ability?

Thank you for browsing this problem.
 

Attachments

  • equipment0.005.w3x
    128.9 KB · Views: 47
Last edited:
Status
Not open for further replies.
Top