1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  4. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Trigger Tweak

Discussion in 'Requests' started by Lee_Go, Mar 30, 2010.

  1. Lee_Go

    Lee_Go

    Joined:
    May 1, 2009
    Messages:
    156
    Resources:
    0
    Resources:
    0
    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.

    My Trigger
    • 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
     
  2. Pharaoh_

    Pharaoh_

    Joined:
    Nov 6, 2008
    Messages:
    8,128
    Resources:
    11
    Icons:
    3
    Skins:
    1
    Spells:
    6
    Tutorials:
    1
    Resources:
    11
    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.
     
  3. Lee_Go

    Lee_Go

    Joined:
    May 1, 2009
    Messages:
    156
    Resources:
    0
    Resources:
    0
    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?
     
  4. Pharaoh_

    Pharaoh_

    Joined:
    Nov 6, 2008
    Messages:
    8,128
    Resources:
    11
    Icons:
    3
    Skins:
    1
    Spells:
    6
    Tutorials:
    1
    Resources:
    11
    Yes, it does.