• 🏆 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] GUI trigger drops me to desktop

Status
Not open for further replies.
Level 12
Joined
Feb 13, 2009
Messages
386
Hello, I was trying to make a simple "stacking" system without different "items for inventory" and "items for ground" (rune system) so I've written this.
However when I try to pick up "fruit" I am dropped to desktop without ANY error.

  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to Fruit
  • Actions
    • Set pickedItemGround[(Player number of (Owner of (Triggering unit)))] = (Item being manipulated)
    • Hero - Drop pickedItemGround[(Player number of (Owner of (Triggering unit)))] from (Triggering unit)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Triggering unit) has an item of type Fruit) Equal to True
      • Then - Actions
        • Set pickedItemcarried[(Player number of (Owner of (Triggering unit)))] = (Item carried by (Triggering unit) of type Fruit)
        • Item - Set charges remaining in pickedItemcarried[(Player number of (Owner of (Triggering unit)))] to ((Charges remaining in pickedItemcarried[(Player number of (Owner of (Triggering unit)))]) + (Charges remaining in pickedItemGround[(Player number of (Owner of (Triggering unit)))]))
        • Item - Remove pickedItemGround[(Player number of (Owner of (Triggering unit)))]
      • Else - Actions
        • Hero - Create Fruit and give it to (Triggering unit)
        • Item - Remove pickedItemGround[(Player number of (Owner of (Triggering unit)))]
Any help please? :)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
What you are doing makes no sense.

Your hero picks up fruit.
Your hero drops the fruit.
Your hero does not have fruit.
You create a fruit and give it to the hero.
Your hero picks up fruit.
Your hero drops the fruit.
Your hero does not have fruit.
You create a fruit and give it to the hero.
Your hero picks um fruit.
....

The aquires item event triggers with all item additions to a hero, even items added via triggers (atleast for GUI).
 
Level 12
Joined
Feb 13, 2009
Messages
386
I've already fixed it, so there's a small wait there (before check).
I don't like the only thing: I have to instantly switch the trigger off while I give the item and then back on, but it works ok for now.
 
Status
Not open for further replies.
Top