| 02-22-2009, 12:47 AM | #1 |
ok I need help on a system I'm making for my map, here's the idea: An item for example a sword will have a durability of 100 which will be determined by its remaining item charges. When a unit picks it up and attacks a unit, each attack will decrease the items remaining charges thereby decreasing its durability. And finally when the remaining charges will be equal to zero the item will break. And well I've been finding a way to this in GUI for some time now and cant get it done. Can someone help me?, it is much appreciated if you help me. I'll post the one I made later just so you now I've done something. EDIT: I finally figured out how to decrease the items remaining charge and for every weapon that a hero will use. My last problem (I think) is at the end of this post. Please I really need help on the trigger and like I said help is very much appreciated and ofcourse I'll give credit. Code:
Item Set EVENT- A unit acquires an item CONDITIONS- (item-class of(item being manipulated)) Equal to Artifact ACTIONS- Set weapon = (item being manipulated) Code:
Item Durability EVENT- A unit is attacked CONDITIONS- ((Attacking unit) has weapon) Equal to True ACTIONS- Set charges remaining in weapon to ((Charges remaining in weapon) - 1) Now the problem: How to determine if the item being manipulated has one remaining charge and trigerring it to remove the item. |
| 02-22-2009, 03:57 PM | #2 |
Integer comparison - item charges remaining. |
| 02-23-2009, 12:22 AM | #3 | |
Quote:
of course that's the condition but what do I use as the event... will it work if I use a variable on the one who picks the Item up...hmmm I'll try thanks eh |
| 02-23-2009, 02:48 AM | #4 |
Well, you're going to be lowering the durability of the item on a damage or attack event, so when you reduce the item's remaining charges you can check to see if the remaining charges are 0. |
