• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

How to create an item from x stacks?

Status
Not open for further replies.
Level 11
Joined
Jan 2, 2016
Messages
472
oNVIt7.jpg


When i drop 5 stacks of Shadow Orb and then pick them up again it will create the item i want.But how can i do it without dropping them?
 
Try to copy this trigger, but replace the event with "A unit sells an item (from shop)", if you are buying these orbs instead of collecting them.
Also change "Triggering unit" to "Buying unit".
You should keep this trigger too, don't delete it :P
 
Well, I suppose your trigger should work if you are collecting them from the ground, but if you are using "Create item for unit" to get them at 1-st, I'd suggest you to run your Loop in the same trigger that creates the item, right after creating it. like:
  • Trigger
    • Events
    • Conditions
    • Actions
      • Hero - Create Orb of Darkness and give it to (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Charges remaining in (Last created item)) Equal to 5
        • Then - Actions
          • Item - Remove (Last created item)
          • Hero - Create Orb of Power and give it to (Triggering unit)
        • Else - Actions
Not 100% sure it will work like that, you can still just use the Loop you've made if you think my way wouldn't work:P
 
The original trigger is fine, it just only loops to slot 1 and 2 (since you defined the integer A 1 to 2), and won't run for checking the rest of the inventory. Do 1-6 and it should work fine.

Also, "Do nothing" action is completely unnecessary.
 
The original trigger is fine, it just only loops to slot 1 and 2 (since you defined the integer A 1 to 2), and won't run for checking the rest of the inventory. Do 1-6 and it should work fine.

Also, "Do nothing" action is completely unnecessary.

Actually i only have 2 slots.The trigger works when i drop all 5 stacks(not one by one) and then pick them up again it will give me my item.But i don't want to drop the stack in order to get the item.
 
How does the number of charges change? You have to do the check when that happens.

You could cheat a bit by giving the unit a powerup item after modifying the charges on the shadow orb. This will cause the other trigger to run. If this doesn't happen too often, it should be fine, but it should be noted that powerups stay on the map unless manually removed.

Create a powerup item based off manual of health ability that adds 0 health and has no animation. Make the item model nothing (I usually use Special Effects -> bugger). Name it "dummy powerup" or something. Give it to the unit any time the shadow orb gains a charge. Then you can use a separate trigger to remove the dummy powerup when a unit gets one.
 
Status
Not open for further replies.
Back
Top