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

Item Ownership Trigger {preventing an item from being picked by another player}

Status
Not open for further replies.
Level 2
Joined
Feb 19, 2009
Messages
15
Who can teach me a Item ownership trigger that when i drop the item no one can picked it or when i drop my item it will transfer in a selected region

Thnx for advance
 
Level 7
Joined
Nov 13, 2006
Messages
243
Well you can make a variable and every time a unit drops an item check the owner of the ability and set it to the variable.

Player1ItemDrop[x] = your last droped item


and when a item is picked up check if its assigned to a variable and make it obsolete or make the unit drop it
 
Level 4
Joined
Apr 18, 2009
Messages
127
  • Drop
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Last dropped item) Equal to YOURITEM
    • Actions
      • Item - Move (Last dropped item) to (Center of YOUR_REGION)
OR

  • Drop
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Last dropped item) Equal to YOURITEM
    • Actions
      • Item - Change ownership of (Last dropped item) to (Owner of (Triggering unit)) and Retain color
      • Item - Make (Last dropped item) Invulnerable
 
When life gets you down.. don't listen to yoda because that does nothing..

  • Events
    • Unit - A unit drops an item
  • Conditions
    • (last dropped item) equal to (youritem)
  • Actions
    • Set (unit variable for your hero with array 1) to (player number of (triggering unit))
  • Events
    • A unit acquires an item
  • Conditions
    • Player number of (triggering unit) not equal to (your variable)
  • Actions
    • Drop (item) owned by (owner of triggering unit)
Not sure if that's right because i'm not in editor at the moment i'm in school but that's the general idea..
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Item Ownership
Surprise, surprise... it has already been answered.


  • Item Ownership
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Custom value of (Item being manipulated)) Equal to (Player number of (Owner of (Triggering unit)))
              • (Custom value of (Item being manipulated)) Equal to 0
        • Then - Actions
          • Set TempLoc = (Position of (Item being manipulated))
          • Item - Move (Item being manipulated) to TempLoc
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Skip remaining actions
        • Else - Actions
          • Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
Right, you can also use "Drop (Item being manipulated) from (Hero manipulating item)", but then you can move the item (and I think that's less effective than this).


TempLoc: Point variable, no array.
 
Level 2
Joined
Feb 19, 2009
Messages
15
Item Ownership
Surprise, surprise... it has already been answered.


  • Item Ownership
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Custom value of (Item being manipulated)) Equal to (Player number of (Owner of (Triggering unit)))
              • (Custom value of (Item being manipulated)) Equal to 0
        • Then - Actions
          • Set TempLoc = (Position of (Item being manipulated))
          • Item - Move (Item being manipulated) to TempLoc
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Skip remaining actions
        • Else - Actions
          • Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
Right, you can also use "Drop (Item being manipulated) from (Hero manipulating item)", but then you can move the item (and I think that's less effective than this).


TempLoc: Point variable, no array.

Does'nt work when i buy an item it drops
 
Level 8
Joined
Aug 3, 2008
Messages
391
  • Item ownership
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Owner of (Item being manipulated)) Not equal to Player 1 (Red)
              • (Owner of (Item being manipulated)) Not equal to Player 2 (Blue)
              • (Owner of (Item being manipulated)) Not equal to Player 3 (Teal)
              • (Owner of (Item being manipulated)) Not equal to Player 4 (Purple)
              • (Owner of (Item being manipulated)) Not equal to Player 5 (Yellow)
              • (Owner of (Item being manipulated)) Not equal to Player 6 (Orange)
              • (Owner of (Item being manipulated)) Not equal to Player 7 (Green)
              • (Owner of (Item being manipulated)) Not equal to Player 8 (Pink)
              • (Owner of (Item being manipulated)) Not equal to Player 9 (Gray)
              • (Owner of (Item being manipulated)) Not equal to Player 10 (Light Blue)
              • (Owner of (Item being manipulated)) Not equal to Player 11 (Dark Green)
              • (Owner of (Item being manipulated)) Not equal to Player 12 (Brown)
        • Then - Actions
          • Item - Change ownership of (Item being manipulated) to (Owner of (Hero manipulating item)) and Change color
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Item being manipulated)) Not equal to (Owner of (Hero manipulating item))
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
            • Else - Actions
 
Last edited:
Level 2
Joined
Feb 19, 2009
Messages
15
  • Item ownership
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Owner of (Item being manipulated)) Not equal to Player 1 (Red)
              • (Owner of (Item being manipulated)) Not equal to Player 2 (Blue)
              • (Owner of (Item being manipulated)) Not equal to Player 3 (Teal)
              • (Owner of (Item being manipulated)) Not equal to Player 4 (Purple)
              • (Owner of (Item being manipulated)) Not equal to Player 5 (Yellow)
              • (Owner of (Item being manipulated)) Not equal to Player 6 (Orange)
              • (Owner of (Item being manipulated)) Not equal to Player 7 (Green)
              • (Owner of (Item being manipulated)) Not equal to Player 8 (Pink)
              • (Owner of (Item being manipulated)) Not equal to Player 9 (Gray)
              • (Owner of (Item being manipulated)) Not equal to Player 10 (Light Blue)
              • (Owner of (Item being manipulated)) Not equal to Player 11 (Dark Green)
              • (Owner of (Item being manipulated)) Not equal to Player 12 (Brown)
        • Then - Actions
          • Item - Change ownership of (Item being manipulated) to (Owner of (Hero manipulating item)) and Change color
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Item being manipulated)) Not equal to (Owner of (Hero manipulating item))
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
            • Else - Actions
This Work [Solved]
 
Status
Not open for further replies.
Top