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

[Trigger] Move item to slot x

Status
Not open for further replies.
Level 17
Joined
Jun 9, 2007
Messages
2,493
This is an exact copy from the trigger:
  • Equip Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Item carried by (Triggering unit) in slot 2) Not equal to (Item being manipulated)
                  • (Item carried by (Triggering unit) in slot 2) Not equal to No item
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
              • Unit - Order (Triggering unit) to move (Item being manipulated) to inventory slot 2
        • Else - Actions
 
Level 30
Joined
Sep 30, 2008
Messages
1,460
mmm... more bugs im afraid :)

The system itself works perfectly now. Items of certain types are put into the correct box. However! I do have a small problem.

Once items have been picked up, players can change the positions of them in the inventory xD Is there a trigger that detects when a player moves an item within the inventory?

for example

Event: Player moves item to slot 1
 
Level 30
Joined
Sep 30, 2008
Messages
1,460
1. You can make item undroppable by triggers or in objects editor, so it'll be possible to move it only by triggers.

2. You can detect orders recieved when you move item from one slot to another.

The first option would make it awkward to drop items, and as for the second, what is the event trigger for that? I cant find one lol :)

Right now, ive got it set as a periodic event to check what item types are in each slot, but this will most likely cause some epic lag in-game with the system checking every hero for items each second :S

With an event that detects item movement within the inventory, I can make the trigger run just the once making it slightly more efficient :D
 
Status
Not open for further replies.
Top