1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

item sticking (saving) script help

Discussion in 'Triggers & Scripts' started by deth_lord, Jun 30, 2009.

  1. deth_lord

    deth_lord

    Joined:
    Jun 25, 2009
    Messages:
    47
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    I am currently trying to get this to run. At first it seemed quite possible to make it work. PROBLEM, for some reason it doesn't work. i was using the custom variables (not actually in variables but a per item integer). are these not working?? because when i made the individual variables it didn't work and remained the default 0. not only that but this also didn't work.

    setting custom value
    event player loses item

    set item custom value = playernumber(ownerof(triggeringunit))

    grabbing item trigger

    (not exact but close)
    event unit is issued an order targeting an object
    if (targeted item variable equal to playernumber(ownerof(triggeringunit)))

    then do nothing

    else if (targeted item custom variable not equal to 0)

    then display to all players (player name is trying to steal player names item)
    unit force order(triggering unit) == stop
     
  2. maskedpoptart

    maskedpoptart

    Joined:
    Aug 4, 2006
    Messages:
    351
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Can you please copy/paste your exact triggers so it's easier to read? Right click the name of your trigger in the trigger window (under "Trigger Functions"), click copy as text, and paste it between trigger tags in your reply.
     
  3. deth_lord

    deth_lord

    Joined:
    Jun 25, 2009
    Messages:
    47
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    THIS IS THE ONE WITH CUSTOM ITEM VALUES

    Event: player acquires an item
    • Item - Make (Item being manipulated) Vulnerable
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Player number of (Owner of (Triggering unit))) Not equal to (Custom value of (Item being manipulated))
      • Then - Actions
        • Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Triggering unit))) + ( is attempting to take an item that belongs to + (Name of (Player((Custom value of (Item being manipulated)))))))
        • Hero - Drop (Item being manipulated) from (Triggering unit)
      • Else - Actions


    Event: Player loses item
    • Item - Make (Last dropped item) Invulnerable
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Custom value of (Last dropped item)) Equal to 0
      • Then - Actions
        • Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
      • Else - Actions
     
    Last edited: Jul 2, 2009
  4. Pharaoh_

    Pharaoh_

    Joined:
    Nov 6, 2008
    Messages:
    8,128
    Resources:
    11
    Icons:
    3
    Skins:
    1
    Spells:
    6
    Tutorials:
    1
    Resources:
    11
    For the event "Unit - Unit loses an item", you refer to that item NOT with "Last dropped item", but with "Item being manipulated".
     
  5. deth_lord

    deth_lord

    Joined:
    Jun 25, 2009
    Messages:
    47
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    o'rly? i'll give it a whirl
     
  6. maskedpoptart

    maskedpoptart

    Joined:
    Aug 4, 2006
    Messages:
    351
    Resources:
    1
    Spells:
    1
    Resources:
    1
    He's right. I'd just like to point out there's a better way to do your second trigger:
    • Item - Make (Item being manipulated) Invulnerable
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Custom value of (Item being manipulated)) Equal to 0
      • Then - Actions
        • Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
      • Else - Actions

    And your condition for the first trigger would be better as:
    • (Player number of (Owner of (Triggering unit))) Not equal to (Custom value of (Item being manipulated))
     
  7. deth_lord

    deth_lord

    Joined:
    Jun 25, 2009
    Messages:
    47
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    PROBLEM: this causes wc3 to fatals when you first pickup an item.
    trigger:
    • If (((Item being manipulated) is invulnerable) Equal to True) then do (Item - Make (Item being manipulated) Vulnerable) else do (Do nothing)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Player number of (Owner of (Triggering unit))) Not equal to (Custom value of (Item being manipulated))
      • Then - Actions
        • Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Triggering unit))) + ( is attempting to take an item that belongs to + (Name of (Player((Custom value of (Item being manipulated)))))))
        • Hero - Drop (Item being manipulated) from (Hero manipulating item)
      • Else - Actions