| 09-25-2006, 06:45 AM | #1 |
With "a unit uses an item", you can get the item that was used to cast its spell. With "starts the effect of", you can get all the details of the ability. I would need both. The actual item that was used, and the target point of the ability. Any ideas? Preferably other than replacing the item on acquisition with an undroppable item in a fxed slot with its own version of the ability... Yes, there's multiple units that may have multiple such items. |
| 09-25-2006, 12:17 PM | #2 |
Create abilities so that no item has the same ability would be the easy way, unless you have a compelling reason not to, such as using a general ability and determining the effect based on which item was used. If the latter is the case you could always attach to each unit the last item used and look that up when the ability fires. |
| 09-25-2006, 01:39 PM | #3 |
One possible method, is to check when a unit is issued an order corresponding to an order for items in the inventory. Use this order to determine which slot the item being used is in, and use the slot number to get what kind of item it is from the hero. You could then store this item type attached to the hero, and when it casts the ability (with starts effect) you get the target point from that, and the item type from the attached info. |
| 09-25-2006, 04:12 PM | #4 |
Well, right now, I have 7 versions of the item. The one you get, which is then replaced with the slot-specific version. Each of those has its own version of the spell. So, if spell version 3 is cast, it must have come from the item in slot 3. It works. But nothing more. Quite frankly, it's ugly beyond description. That said, "starts the effect of" happens before "uses an item". Actually, "uses an item" happens even after "finishes casting". Some other method would be to wait for the effect, and create a local trigger. Or use some other means of remembering the casting. Then use it once the "uses an item" comes. That would already be "better" from an item / ability point of view. Less items, and less abilities. Still... |
| 09-25-2006, 04:24 PM | #5 |
old code by works |
| 09-25-2006, 04:44 PM | #6 |
It has an interesting comment: JASS:// I thought this was going to be an easy spell, but now I am sure it wasn't, // check this thing, it is horrible! I'll have a more detailed read later on. |
