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

An event representing an item?

Status
Not open for further replies.
Level 6
Joined
Mar 17, 2012
Messages
105
I need to make a trigger where, when an item's life goes below 200, it is removed and replaced with a new item (based on the item type of attacked item). Problem is, there isn't an item devoted event option. "Unit" events don't work for it, either. So: how can I make an Item representing event? Thank you.
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Quick reply:
You could use the function GetWidgetLife(whichWidget)

<<< EDIT >>>

Detailed reply:

  • Get Item Life
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • (Current life of Example_Item) Less than or equal to 200.00
    • Actions
      • Set Item_Position = (Position of Example_Item)
      • Set Example_Item_Type = (Item-type of Example_Item)
      • Item - Remove Example_Item
      • Item - Create Example_Item_Type at Item_Position
      • Custom script: call RemoveLocation(udg_Item_Position)
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
info
I made a second post for notification.
If you need to check every item then we pick all items in the map.

Didn't check for leaks

  • Get Item Life
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Item - Pick every item in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current life of (Picked item)) Less than or equal to 200.00
            • Then - Actions
              • Set Item_Position = (Position of (Picked item))
              • Set Example_Item_Type = (Item-type of (Picked item))
              • Item - Remove (Picked item)
              • Item - Create Example_Item_Type at Item_Position
              • Custom script: call RemoveLocation(udg_Item_Position)
            • Else - Actions
 
Status
Not open for further replies.
Top