• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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