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

Keep Item in same slot after moving/death

Status
Not open for further replies.
Level 4
Joined
Dec 5, 2011
Messages
75
Keep Item in same slot after moving item

Hi guys im having trouble making a trigger that move an item in slot x on a hero(A) to hero(B) in same slot(x) (with trigger)
I can move them but not in same slots

Do variables(item) store the item data on a hero in order?
Do i need to use variables(for items) with/without arrays?

im a GUI user!

Thanks!!

sorry wrong section!
 
Last edited:
Level 5
Joined
Aug 24, 2010
Messages
133
the only thing i can think of is adding some dummy items into the other slots so when you add the item it goes into the correct slot then remove those dummy items

i know theres a condition that checks what slot an item is in so you can check if a slots filled or not
 
Level 4
Joined
Dec 5, 2011
Messages
75
does dota revive uses trigger like create unit from variable or just a simple revive?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Untitled Trigger 016
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set u = Far Seer 0022 <gen> // u is unit variable
      • Set ityp = Crown of Kings +5 // ityp is item type variable
      • Custom script: call UnitAddItemToSlotById(udg_u, udg_ityp, 3)
However if the item slot is not empty, the item will be created on ground at the position of the unit. You need to loop through the slots to find an empty one.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I made this system long time ago, hope it suits your demand.

Instructions:
1. Pick any item in any order
2. Once you have satisfied, press ESC to kill the unit
3. Go to the Circle of Power to the North
4. Ta-da! Your item is back on you at the same slot, same item

It works MUI as you can test it with 3 units in that test map, enjoy :)

This system meant for revival system, but it can be applied to your situation as well.
 

Attachments

  • Simple Dummy Hold Item System.w3x
    16 KB · Views: 34
Status
Not open for further replies.
Top