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

Status
Not open for further replies.
Level 6
Joined
May 1, 2009
Messages
156
Request: Tweak trigger so its not only when a unit drops "Meat" but
also when its created at position of the forest animals.

This is the trigger i'm using to remove the item "Meat" from the game
after its been on the ground for 30 seconds.

If someone could tell me how to change this to not be when a unit
drops the item "Meat" but also when a neutral passive animal in
my forest is killed because that's when the meat is created. Right
now the trigger is set only when the item is dropped.

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hashtable = (Last created hashtable)
  • Way 1
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • Set Point = (Position of (Item being manipulated))
      • Unit - Create 1 Dummy for Neutral Passive at Point facing Default building facing degrees
      • Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
      • Hashtable - Save Handle Of(Item being manipulated) as (Key item) of (Key (Last created unit)) in Hashtable
      • Hashtable - Save Handle Of(Last created unit) as (Key unit) of (Key (Item being manipulated)) in Hashtable
      • Custom script: call RemoveLocation (udg_Point)
  • Way 1b
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Light
      • ((Key item) is stored as a Handle of (Key (Triggering unit)) in Hashtable) Equal to True
    • Actions
      • Hashtable - Clear all child hashtables of child (Key (Load (Key item) of (Key (Triggering unit)) in Hashtable)) in Hashtable
      • Item - Remove (Load (Key item) of (Key (Triggering unit)) in Hashtable)
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Hashtable
 
First off, you create a "Dummy" unit-type of unit in the A unit loses an item trigger and in the A unit dies trigger, you check its unit-type, but it's "Light".
  • Unit - Create 1 Dummy for Neutral Passive at Point facing Default building facing degrees
  • (Unit-type of (Triggering unit)) Equal to Light
Does this trigger function? It shouldn't function.

To implement the Neutral Passive
  • Trigger1
  • Events
    • Unit - A unit dies
  • Conditions
    • (Owner of (Triggering unit)) Equal to Neutral Passive //this is a Player Comparison
  • Actions
    • Set Point1 = (Position of (Triggering unit))
    • Item - Create a Tome of Experience at Point1
    • Unit - Create 1 Dummy for Neutral Passive at Point1 facing Default building facing degrees
    • Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
    • Hashtable - Save Handle Of(Item being manipulated) as (Key item) of (Key (Last created unit)) in Hashtable
    • Hashtable - Save Handle Of(Last created unit) as (Key unit) of (Key (Item being manipulated)) in Hashtable
    • Custom script: call RemoveLocation (udg_Point1)
And that's all, your third trigger will function for this trigger too.
 
Level 6
Joined
May 1, 2009
Messages
156
Lol wow, I don't know what it's doing... if you pick up then drop the meat it goes back to where the dying unit was... it sometimes disappears from ur inventory. Its focked :hohum: I did the changes...

This works with multiple items at a time right?
 
Status
Not open for further replies.
Top