| 10-01-2008, 05:01 AM | #1 |
Alright, not a very descriptive title = late at night. :P I have a conundrum. I have a unit (we'll call it X) with 4 attachment points, which (can be) labelled 1, 2, 3, and 4 (for ease of use). X only has 4 backpack slots, and while it can pick up any item, it is specifically made to collect a special item, known as a "Skull". The Skull gives a bonus to attack but can be sold at a shop for money. (Units aren't supposed to benefit from the attack bonus, of course). Anyway, I ramble. Basically, the problem is I want a Skull (Black Citadel doodad model) to appear on each of the 4 attachment points of unit X whenever he picks up a Skull. If he has 3, only 3 Skulls are shown, et al. When he drops/sells a Skull, one should disappear from his attachment points (they are on his back). Not necessarily in the order they were gotten (although that'd be cool). My issue is that I cannot seem to wrap my head around the necessary triggers... I can catch "pick up item" events, I believe, as well as "selling/dropping item", then add "attachment abilities" with those attachment points in use... Something doesn't mesh, though. I'm having a mental block. So if I could get help, that'd be greatly appreciated. If you need clarification as to the parameters of the problem, feel free to ask. Please refrain from JASSing a solution, if you will. GUI with custom script should suffice. **Of course, maybe it can't... If so, just tell me. |
| 10-01-2008, 08:29 AM | #2 |
This reminds me I was going to make an item module for the ABuff system... but I digress. Well, I'd do this with four effect attachment abilities (one for each attachment point) stored in an array. When a unit acquires a skull item, look through the array until I find an ability the unit doesn't have yet and give that ability to the unit. When the unit looses a skull item, again look through the array until you find an ability that the unit does have and remove that ability. When looking through the array, you can either go form start to finish or look at indexes at random, in the latter case you'll get a more random ditribution of skulls on attachment points on multiple skull-gatherer units. |
