| 01-27-2007, 02:23 AM | #1 |
This might have been addressed by someone, I am not sure, but I did scour jassvault, other sites, here (thanks for the reply Antiarf to one of your systems) and what I am try to do is have 2 different triggers that track the events Sold Item from Shop and Unit Acquires Item (not sold item). I apologize ahead of time for using GUI tags to represent what I'm saying... I'm attempting to learn jass so it's easier for me to explain things that way. Before I start rambling, let me explain what I want to do: Code:
Unit buys an item
allied shop?
Yes, Give item
No, destroy item, give refund
Only 1 sail/hull/wood/crew check
Yes, give item
No destroy item, give refund
Powerup?
Yes,
Has required items for combo?
Yes, remove 1 or 2 items & create item and give
No, refund money, msg to player missing required item names
No, do nothing
Unit acquires an item
Unit in enemy harbor?
Yes, move item to position of unit
No:
Only 1 sail/hull/wood/crew check
Yes, give item
No, instantly move item to position of unitCode:
function passing 3 items returns nothing
if-then loop
unit has item-typeI[loop]
unit has item-typeII[loop]
unit has Powerup[loop]
then do stuff (remove items, create new one, fix leaks, skip remaining actions, etc)I was also thinking that maybe you can track picking up an item outside of purchase by doing an item boolean check Code:
if last created item <> item being manipulated then blah blah The reason why this is so tricky (at least for me) is that there's so many combos of checks to be performed (only 1 of similar item type, powerup + items = combo, can't pick up items in enemy territory, etc) that I'm finding that may glitches have occured because of GUI triggers (or at least the way I have them set up now). What I've come to understand is that local variables (which I understand are necessary for MUI) can not be used in IF-THENs, amongst other functions. If it would be helpful, I could post the triggers that I am already using to assist in fixing this crazy mess... |
