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

[Trigger] Owner of item problem

Status
Not open for further replies.
Level 9
Joined
Jun 22, 2012
Messages
472
Hey there!

I'm making a trigger to unlock/lock the training of a unit. The availability of the training depends on the owner of an unique item. But when I pick the item on my hero inventory, the training button doesn't appear... It seems that the condition "(Owner of Ring) Egal to (Picked player) doesn't work well...


  • Ring
    • Events
      • Units - A unit Meurt
    • Conditions
      • (Triggering unit) Egal to Gollum
    • Actions
      • Item - Create One ring at (Position of (Triggering unit))
      • Set Ring = (Last created item)
      • Game - Display to (All players) the text: Gollum has been killed!
      • Sound - Play Hint <gen>
      • Kinematic - Ping minimap for (All players) at (Position of Gollum) for 3.00 seconds
      • Trigger - Turn off Walk <gen>
  • Summon
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Player group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of Ring) Egal to(Picked player)
            • Then - Actions
              • Game - Display to (All players) the text: cas 1
              • Player - Make Sauron Disponible for training/construction by (Owner of Ring)
              • Player - Make Galadriel Disponible for training/construction by (Owner of Ring)
            • Else - Actions
              • Game - Display to (All players) the text: cas 2
              • Player - Make Galadriel Indisponible for training/construction by (Picked player)
              • Player - Make Sauron Indisponible for training/construction by (Picked player)


If someone has an idea to help me I'll give him +rep! Thanks in advance!
 
Level 13
Joined
Jul 16, 2012
Messages
679
You have wrong here
- In your first trigger... add change ownership

In your first trigger
  • Ring
    • Events
      • Units - A unit Meurt
    • Conditions
      • (Triggering unit) Egal to Gollum
    • Actions
      • Set TempLoc = (Position of (Triggering unit))
      • Set TempLoc2 = (Position of (Triggering unit))
      • Item - Create One ring at TempLoc
      • Set ring = (Last created item)
      • Item - Change ownership of Ring to (Owner of (Triggering unit)) and Retain color
      • Game - Display to (All players) the text: Gollum has been killed!
      • Sound - Play Hint <gen>
      • Kinematic - Ping minimap for (All players) at TempLoc2 for 3.00 seconds
      • Custom script: call RemoveLocation( udg_TempLoc)
      • Custom script: call RemoveLocation( udg_TempLoc2)
      • Trigger - Turn off Walk <gen>
If does not work add player variables to check
 
Status
Not open for further replies.
Top