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

[Trigger] Detect When Losing an Item and have no more in inventory

Status
Not open for further replies.
Level 5
Joined
Jun 13, 2017
Messages
83
When I make an event of unit loses an item, and make If,then,else to check if unit has another one of the same item, even if he doesn't the game still see it as if he have one here is an example

Hero doesn't die even if I dont have another item in my inventory
  • Untitled Trigger 001
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Hunting Gloves
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Hunting Gloves) Equal to False
        • Then - Actions
          • Unit - Kill (Triggering unit)
        • Else - Actions
But when Acquiring an item, game immediately detect that the hero got the item and kill him

  • Untitled Trigger 001 Copy
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Hunting Gloves
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Hunting Gloves) Equal to True
        • Then - Actions
          • Unit - Kill (Triggering unit)
        • Else - Actions

I did fix this with indexing and make it with a count down of 0.3 sec and it worked but it is a lot of work to make for other items. Is there any fast way to detect the sec hero loses an item that he doesn't have it anymore?
 
Status
Not open for further replies.
Top