• 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.

Move item in inventory event

Status
Not open for further replies.
If your asking for an event, there isnt one.
but you could set a couple variables for each item slot on the hero like this.

Event - Unit aquires an item.
Event - Unit drops an item.

Actions -
Set "Item1" = (Item in item slot 1)
[do this for each item slot using seperate variables. Note: "Item1" is an item variable]

Then check the variables using an If then else function sorta like....

If "Item1" is equal to (Item in item slot 1)
Then (your item hasnt moved)
Else (your item has moved)


Since i dont know exactly what you want to do, I can't give you an actual trigger. But I hope that helps/makes sense.
 
Level 7
Joined
Mar 24, 2008
Messages
184
yeah i was hoping for an event (it happened once already that i missed an event so...) or some system that would check for such an event. Sometimes i write too much, other times almost nothing.

I made a system to merge potions when looted (each looted potion has 5 charges and can have max 50 charges), what i wanted to do is a trigger that checks if a unit moves a potion from a slot to another slot with the same kind of potions then it'll add the charges of the first item to the second, and eventually destroy the second item.
Let's say for example i have 2 potions, one with 50 charges and the other with 5, then i use one of the 50 potions, then move the 5 potions over the 49, at this point i should have 50 potions in one slot and 4 in another.
I've already made the triggers for when the potions are looted, and i'm pretty sure i've seen some maps with something like the one i've just explained (i don't remember which one though...the troll survival one maybe?)
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Yes there is such an event(almost).
Events
Unit - A unit is issued an order targeting an object
Condition
(order comparison)
Issued Order equal to Move item to slot #
 
Level 9
Joined
Jul 3, 2008
Messages
495
You need one line of jass. First create a new variable of the type integer. Name it "i".

Then create this trigger.
  • Events
  • Unit - A unit owned by Player 1 (Red) Is issued an order targeting an object
  • Actions
  • Custom script: set udg_i = GetIssuedOrderId()
When you move an item arround in the different slots you will get the value 852002 to 852007.
852002 means you move it to slot 1
852003 means you move it to slot 2
852004 means you move it to slot 3
852005 means you move it to slot 4
852006 means you move it to slot 5
852007 means you move it to slot 6

You can also look at the attached map, it may be easier to understand.
 

Attachments

  • ItemSlotMoveAround.w3x
    16.3 KB · Views: 57
Status
Not open for further replies.
Top