• 🏆 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 runs in a vicious cycle, please help!!

Status
Not open for further replies.
Level 2
Joined
May 17, 2005
Messages
9
I've been working on this for hours now and I've yet to come up with a solution. I'm trying to make it so you can only have one type of item, namely, a ship hull. I'm only doing on at a time so it's easier; yes, there will be more triggers, but at least they won't be as long. Hopefully someone here will know how to fix it. Here's the trigger:

Untitled Trigger 015
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Stone Hull
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(((Triggering unit) has an item of type Stone Hull) Equal to False) and ((Item-type of (Item being manipulated)) Equal to Stone Hull)
(((Triggering unit) has an item of type Bronze Hull) Equal to False) and ((Item-type of (Item being manipulated)) Equal to Stone Hull)
(((Triggering unit) has an item of type Gold Hull) Equal to False) and ((Item-type of (Item being manipulated)) Equal to Stone Hull)
(((Triggering unit) has an item of type Kraken Shell (level 1)) Equal to False) and ((Item-type of (Item being manipulated)) Equal to Stone Hull)
(((Triggering unit) has an item of type Kraken Shell (level 2)) Equal to False) and ((Item-type of (Item being manipulated)) Equal to Stone Hull)
Then - Actions
Hero - Give (Item being manipulated) to (Triggering unit)
Else - Actions
Player - Add (Integer((Current life of (Item being manipulated)))) to (Owner of (Triggering unit)) Current gold
Game - Display to (Player group((Owner of (Triggering unit)))) the text: You already have a hull.
Item - Remove (Item being manipulated)

Right now, it reads the item you pick up (testing using the stone hull) as already having it as soon as you pick it up. So, if I pick up a stone hull, it adds it to my inventory and then runs the trigger, thus tricking the trigger into thinking I already have one and not letting me pick it up. It works perfectly if I pick up a different type and then pick up a stone hull. It just messes up when I try and get a stone hull and don't have any other type of hull. It would be helpful if someone knew how to do it with the GUI triggers, but if there's no way other than with JASS (I could probably copy and paste text to JASS to get the trigger), that's fine. Thanks a bunch.
 
Level 2
Joined
May 17, 2005
Messages
9
basically what i want it to do is if you already a hull, don't let you get another. but if you don't let you get one.
 
Status
Not open for further replies.
Top