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

Respawn Item

Status
Not open for further replies.
Level 10
Joined
May 20, 2008
Messages
433
For my map I require 1 of a certain item to be on the map at all times (so if the item dies, a new one spawns). I'm looking for any triggers that either checks for item related events (item dies...) or items on the map (including inventory). Is there any way to create such an event/action constantly without lag? Or, a much simpler way, a way to make the specified item invulnerable?
 
Level 3
Joined
Nov 19, 2010
Messages
51
I am pretty sure you just have to make sure it does not die or decay and it drops when a hero dies. All that should be something you can do from the Object Editor.
 
Level 15
Joined
Oct 16, 2010
Messages
942
  • Item - Make (Last created item) Invulnerable
or:

  • Item Respawn
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set IsOnField = False
      • 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
              • (Picked item) Equal to ITEM_X
            • Then - Actions
              • Set IsOnField = True
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsOnField Equal to False
        • Then - Actions
          • Item - Create Claws of Attack +15 at (Random point in (Playable map area))
          • Set ITEM_X = (Last created item)
        • Else - Actions
 
Level 10
Joined
May 20, 2008
Messages
433
I am pretty sure you just have to make sure it does not die or decay and it drops when a hero dies. All that should be something you can do from the Object Editor.
Items don't have anything under the 'combat' subsection (except for armor type, which excludes any form of invulnerable armor).

  • Item - Make (Last created item) Invulnerable
or:

  • Item Respawn
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set IsOnField = False
      • 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
              • (Picked item) Equal to ITEM_X
            • Then - Actions
              • Set IsOnField = True
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsOnField Equal to False
        • Then - Actions
          • Item - Create Claws of Attack +15 at (Random point in (Playable map area))
          • Set ITEM_X = (Last created item)
        • Else - Actions

The full trigger skips over hero/unit inventory. So, unfortunately, that doesn't work.
As for the first line of code, it will work. +Rep
 
Status
Not open for further replies.
Top