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

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