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

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?
 
Level 13
Joined
Jan 2, 2016
Messages
973
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
 
Level 13
Joined
Jan 2, 2016
Messages
973
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
 
Level 6
Joined
May 20, 2014
Messages
228
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.
 
Level 11
Joined
Jan 2, 2016
Messages
472
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.
 
Level 12
Joined
May 22, 2015
Messages
1,051
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.
Top