• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

GUI trigger trouble? (has to do with pawning items to shop)

Status
Not open for further replies.
Level 8
Joined
Oct 23, 2010
Messages
292
I have a stacking item, (using this: http://www.hiveworkshop.com/forums/...s-incredible-item-stacking-system-doom-20961/) and i made a trigger to sell/pawn it to a shop that looks like this:

  • Crab selling
    • Events
      • Unit - A unit Pawns an item (to shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Crab(non)
    • Actions
      • Cinematic - Send transmission to (All players) from Bunker named : Play No sound and display Test1. Modify duration: Add 0.00 seconds and Wait
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Charges remaining in (Sold Item)) Equal to 1
        • Then - Actions
          • Set Itemnumber = (Itemnumber + 1.00)
          • Cinematic - Send transmission to (All players) from Bunker named : Play No sound and display Test2 . Modify duration: Add 0.00 seconds and Wait
        • Else - Actions
          • Cinematic - Send transmission to (All players) from Bunker named : Play No sound and display Test1. Modify duration: Add 0.00 seconds and Wait
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item being manipulated)) Equal to 2
            • Then - Actions
              • Set Itemnumber = (Itemnumber + 2.00)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Charges remaining in (Item being manipulated)) Equal to 3
                • Then - Actions
                  • Set Itemnumber = (Itemnumber + 3.00)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Charges remaining in (Item being manipulated)) Equal to 4
                    • Then - Actions
                      • Set Itemnumber = (Itemnumber + 4.00)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Any idea what i am doing wrong here?
 
Level 7
Joined
May 3, 2007
Messages
210
  • Crab selling
    • Events
      • Unit - A unit Pawns an item (to shop)
    • Conditions
      • (Item-type of (Item Being Manipulated)) Equal to Crab(non)
    • Actions
      • Cinematic - Send transmission to (All players) from Bunker named : Play No sound and display Test1. Modify duration: Add 0.00 seconds and Wait
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Charges remaining in (Item Being Manipulated)) Greater Than or Equal to 1
        • Then - Actions
          • Set Itemnumber = (Itemnumber + GetItemCharges)
          • Cinematic - Send transmission to (All players) from Bunker named : Play No sound and display Test2 . Modify duration: Add 0.00 seconds and Wait
        • Else - Actions
          • Cinematic - Send transmission to (All players) from Bunker named : Play No sound and display Test1. Modify duration: Add 0.00 seconds and Wait
Why don't you just do that? I don't know the GetItemCharges GUI equivilant (meaning that's a JASS native I threw in there).

I'm not aware of how your item system works, but *assuming* you're logic in using it is correct, then the above function should work... Possibly play with different events?
 
Level 7
Joined
May 3, 2007
Messages
210
Warcraft 3 stores agents in global variables to be referenced as long as the context is maintained, like Triggering Unit, it's actually just a global variable. At least that's how I remember it working, so as long as you're referencing the item being manipulated then you should be able to obtain any needed information about the item as long as it's still stored in the manipulated item.

You have a point about what's actually happening in game though, because you can't change the charges on an item that's no longer in a heroes inventory. Well you can, but... it doesn't do anything.
 
Level 8
Joined
Oct 23, 2010
Messages
292
  • Crab selling
    • Events
      • Unit - A unit Pawns an item (to shop)
    • Conditions
      • (Item-type of (Item Being Manipulated)) Equal to Crab(non)
    • Actions
      • Cinematic - Send transmission to (All players) from Bunker named : Play No sound and display Test1. Modify duration: Add 0.00 seconds and Wait
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Charges remaining in (Item Being Manipulated)) Greater Than or Equal to 1
        • Then - Actions
          • Set Itemnumber = (Itemnumber + GetItemCharges)
          • Cinematic - Send transmission to (All players) from Bunker named : Play No sound and display Test2 . Modify duration: Add 0.00 seconds and Wait
        • Else - Actions
          • Cinematic - Send transmission to (All players) from Bunker named : Play No sound and display Test1. Modify duration: Add 0.00 seconds and Wait
Why don't you just do that? I don't know the GetItemCharges GUI equivilant (meaning that's a JASS native I threw in there).

I'm not aware of how your item system works, but *assuming* you're logic in using it is correct, then the above function should work... Possibly play with different events?


uh, i am not sure how to even use that,

But, i cant use "Greater Than or Equal to 1" because i use more triggers below that, i just left them out. heres some of them...

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Charges remaining in (Sold Item)) Equal to 1
    • Then - Actions
      • Set Itemnumber = (Itemnumber + 1.00)
      • Cinematic - Send transmission to (All players) from Bunker named <Empty String>: Play No sound and display Test2 . Modify duration: Add 0.00 seconds and Wait
    • Else - Actions
      • Cinematic - Send transmission to (All players) from Bunker named <Empty String>: Play No sound and display Test1. Modify duration: Add 0.00 seconds and Wait
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Charges remaining in (Item being manipulated)) Equal to 2
        • Then - Actions
          • Set Itemnumber = (Itemnumber + 2.00)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item being manipulated)) Equal to 3
            • Then - Actions
              • Set Itemnumber = (Itemnumber + 3.00)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Charges remaining in (Item being manipulated)) Equal to 4
                • Then - Actions
                  • Set Itemnumber = (Itemnumber + 4.00)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Charges remaining in (Item being manipulated)) Equal to 5
                    • Then - Actions
                      • Set Itemnumber = (Itemnumber + 5.00)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Charges remaining in (Item being manipulated)) Equal to 6
                        • Then - Actions
                          • Set Itemnumber = (Itemnumber + 6.00)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Charges remaining in (Item being manipulated)) Equal to 7
                            • Then - Actions
                              • Set Itemnumber = (Itemnumber + 7.00)
                            • Else - Actions

In the end, all i want to do is sell a stacked item, (you need ten crabs sold, if you gather 3, then sell it, it will say "3 out of 10 crabs collected" and then if you gather five more, and sell it, it will say "8 of 10 crabs collected" and then 10+ is all saying i have enough crabs... If anyone has any idea how to do this, let me know?
 
Status
Not open for further replies.
Top