• 🏆 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] Problem with maxing items in all slots

Status
Not open for further replies.
Level 9
Joined
Jun 7, 2008
Messages
440
I have this trigger. It works out farely well. I have one problem however. I cannot set the remaining charges in any slot if all my inventory slots are full. Any ideas?

  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Item-class of (Item being manipulated)) Equal to Charged
  • Actions
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
            • (Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Item being manipulated)
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Charges remaining in (Item carried by (Triggering unit) in slot (Integer A))) Less than 10
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • ((Charges remaining in (Item being manipulated)) + (Charges remaining in (Item carried by (Triggering unit) in slot (Integer A)))) Less than or equal to 10
                  • Then - Actions
                    • Item - Set charges remaining in (Item carried by (Triggering unit) in slot (Integer A)) to ((Charges remaining in (Item carried by (Triggering unit) in slot (Integer A))) + (Charges remaining in (Item being manipulated)))
                    • Item - Remove (Item being manipulated)
                  • Else - Actions
              • Else - Actions
          • Else - Actions
 
Level 13
Joined
May 11, 2008
Messages
1,198
you can pick up items that are powerups. you have to use the powerup fake item method forsetting charges. my stackitems system works pretty well, and can be found in my TDHT map. it even automatically stacks charged items. iow, an item bought with 10 charges can be bought ten times and you can get 100 charge item.
 
Status
Not open for further replies.
Top