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

Item Delete

Status
Not open for further replies.
Level 3
Joined
Oct 15, 2010
Messages
51
Hello .
I need help with an item delete trigger . As in RPG map , when you type -d1 => delete item in first slot of the hero . And well i think i can do the rest if all can't be done with one trigger .
Thanks .
 
Level 8
Joined
Oct 31, 2010
Messages
238
Test map attached

  • Delete Item
    • Events
      • Player - Player 1 (Red) types a chat message containing -d as A substring
    • Conditions
    • Actions
      • Set TempGroup = (Units currently selected by Player 1 (Red))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Integer((Substring((Entered chat string), 3, 3)))) Greater than 6
                  • (Integer((Substring((Entered chat string), 3, 3)))) Less than or equal to 0
            • Then - Actions
              • Game - Display to (All players) the text: Please enter a valu...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item carried by (Picked unit) in slot (Integer((Substring((Entered chat string), 3, 3))))) Equal to No item
                • Then - Actions
                  • Game - Display to (All players) the text: There is no item in...
                • Else - Actions
                  • Game - Display to (All players) the text: ((Name of (Item carried by (Picked unit) in slot (Integer((Substring((Entered chat string), 3, 3)))))) + have been removed.)
                  • Item - Remove (Item carried by (Picked unit) in slot (Integer((Substring((Entered chat string), 3, 3)))))
      • Custom script: call DestroyGroup(udg_TempGroup)
 

Attachments

  • Delete Item.w3x
    12.9 KB · Views: 32
Level 3
Joined
Oct 15, 2010
Messages
51
I dont really get the trigger how it works but the trigger works great but there is a problem i can remove the items of other players as well , is there a condition that i need to add to fix the problem .
 
Level 8
Joined
Oct 31, 2010
Messages
238
Oh how stupid of me to not think of that..

Anyways here
  • Delete Item
    • Events
      • Player - Player 1 (Red) types a chat message containing -d as A substring
    • Conditions
    • Actions
      • Set TempGroup = (Units currently selected by (Triggering player))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to (Triggering player)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Integer((Substring((Entered chat string), 3, 3)))) Greater than 6
                      • (Integer((Substring((Entered chat string), 3, 3)))) Less than or equal to 0
                • Then - Actions
                  • Game - Display to (All players) the text: Please enter a valu...
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item carried by (Picked unit) in slot (Integer((Substring((Entered chat string), 3, 3))))) Equal to No item
                    • Then - Actions
                      • Game - Display to (All players) the text: There is no item in...
                    • Else - Actions
                      • Game - Display to (All players) the text: ((Name of (Item carried by (Picked unit) in slot (Integer((Substring((Entered chat string), 3, 3)))))) + have been removed.)
                      • Item - Remove (Item carried by (Picked unit) in slot (Integer((Substring((Entered chat string), 3, 3)))))
            • Else - Actions
              • Game - Display to (All players) the text: The hero must belon...
      • Custom script: call DestroyGroup(udg_TempGroup)
 

Attachments

  • Delete Item.w3x
    13.3 KB · Views: 36
Level 3
Joined
Oct 15, 2010
Messages
51
This works better :)
To make it perfect i'll add some more players in the Event ;)
Thanks for the trigger :)
 
Status
Not open for further replies.
Top