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

Help me get a variable, please!

Status
Not open for further replies.
Level 6
Joined
Dec 9, 2014
Messages
176
I'm sorry to always be asking for so much help. I just want to make this map work and I don't have all the experience many people here do.

The variable I'm looking for is in a trigger that I got from a different site on stacking and unstacking items. I needed a stacking system for quest items and what not. I need the variable it's using for how many is in a stack so that I can use it in quests and what not.

On a second question, I'm wondering if I'm going to be able to use this system for a bag system I will be putting in in the future? Thanks!

  • Stacking
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Charges remaining in (Item being manipulated)) Not equal to 0
    • 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 (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
              • (Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) Less than (Item level of (Item carried by (Hero manipulating item) in slot (Integer A)))
              • (Item carried by (Hero manipulating item) 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 (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated))) Greater than (Item level of (Item being manipulated))
                • Then - Actions
                  • Item - Set charges remaining in (Item being manipulated) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + ((Charges remaining in (Item being manipulated)) - (Item level of (Item being manipulated))))
                  • Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to (Item level of (Item being manipulated))
                • Else - Actions
                  • Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated)))
                  • Item - Remove (Item being manipulated)
            • Else - Actions
  • Unstacking
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • Custom script: set udg_order = GetIssuedOrderId()
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • order Greater than or equal to 852002
          • order Less than or equal to 852007
          • (Target item of issued order) Equal to (Item carried by (Ordered unit) in slot (order - 852001))
          • (Charges remaining in (Target item of issued order)) Greater than 1
        • Then - Actions
          • Item - Set charges remaining in (Target item of issued order) to ((Charges remaining in (Target item of issued order)) - 1)
          • Set L = (Position of (Ordered unit))
          • Item - Create (Item-type of (Target item of issued order)) at L
          • Custom script: call RemoveLocation(udg_L)
          • Item - Set charges remaining in (Last created item) to 1
        • Else - Actions
 
Last edited:
Level 25
Joined
May 11, 2007
Messages
4,651
You have it already in the trigger.

Item - Set charges remaining in (Target item of issued order) to ((Charges remaining in (Target item of issued order)) - 1)

So just copy that and we can have:
set item1 = item carried by HeroDz of type "Wool Item"
if (item1 not equal to no item)
{
set HowAwesomeIsDz = Charges remaining in item1;
}
 
Status
Not open for further replies.
Top