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

Hiding dropped items from enemy

Status
Not open for further replies.
Level 2
Joined
Apr 9, 2020
Messages
13
Is there a way to make items which have been dropped on the ground invisible to the enemy, but visible to allies? Thus an enemy could not steal the item. I tried using the Hide item trigger, but I think it only applies to hiding which items are in an inventory.
 
Level 15
Joined
Feb 7, 2020
Messages
398
There's a different way you can do this with the Change Owner of Item GUI function.

Then, create a trigger that checks if the owner of the item matches the owner of the unit trying to pick it up. If not, the trick to keep it in the exact same place is something like "Move Item Being Manipulated" to "Location of Item Being Manipulated".

I have a similar trigger in my current project:


  • Item Collect Check
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Owner of (Triggering unit)) Not equal to (Owner of (Item being manipulated))
      • (Unit-type of (Triggering unit)) Equal to Soul of a Hero (hero selector)
    • Actions
      • Set VariableSet temppoint = (Position of (Triggering unit))
      • Set VariableSet temppoint2 = (Position of playerShop[(Player number of (Owner of (Triggering unit)))])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Not equal to Soul of a Hero (hero selector)
          • (Distance between temppoint and temppoint2) Greater than 60.00
        • Then - Actions
          • Set VariableSet temppoint3 = (Position of (Item being manipulated))
          • Item - Move (Item being manipulated) to temppoint3
          • Custom script: RemoveLocation( udg_temppoint3 )
          • Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)).) for 1.33 seconds the text: |cffffc800You do no...
        • Else - Actions
      • Custom script: RemoveLocation( udg_temppoint )
      • Custom script: RemoveLocation( udg_temppoint2 )
 
Last edited:
Status
Not open for further replies.
Top