- Joined
- Apr 3, 2012
- Messages
- 31
So I'm working on a map using BPower's Equipment System, and for the most part the system works well. However I have a couple of things I'd like to change, but I'm not super JASS-savvy.
The system works by giving a designated hero an ability, which when used selects a dummy equipment-unit that has a "button-ability" corresponding to each item the hero has "equipped". Using the ability also syncs the inventories of the dummy and the hero. The inventories are also synced when the hero or the dummy uses an item to "equip" it, or the dummy uses a button-ability to unequip that item.
I'd like to free up an ability slot on the hero, and the way I want to do this is by making the equipment dummy selectable through the hero interface buttons. However, the inventories of the hero and the dummy unit are synced when the ability is used, not when the dummy is selected. Basically, I'm just looking to call sync() when the dummy unit is selected, rather than when the ability is used (but I don't know the syntax):
It's worth noting that I don't need it to be MUI, just MPI. I have an array variable named Hero[1..8] (player number) for the hero controlled by each player, which would presumably replace eventUnit here.
Another unrelated minor issue occurs when equipping an item in a slot that already has an item equipped. This will run the unequip function for that slot, then the equip function for the used item. This obviously makes sense as you need to unequip an item before equipping a new one, however equipping an item when you have a full inventory will drop the previously equipped item on the floor, instead of putting it in your inventory in place of the used item (since the unit still has a full inventory when the unequip function is called).
This is not a huge issue and probably a bit more complex than the selection event, but if anyone feels like downloading the system and taking a look at it, I would appreciate it.
Thanks in advance!
The system works by giving a designated hero an ability, which when used selects a dummy equipment-unit that has a "button-ability" corresponding to each item the hero has "equipped". Using the ability also syncs the inventories of the dummy and the hero. The inventories are also synced when the hero or the dummy uses an item to "equip" it, or the dummy uses a button-ability to unequip that item.
I'd like to free up an ability slot on the hero, and the way I want to do this is by making the equipment dummy selectable through the hero interface buttons. However, the inventories of the hero and the dummy unit are synced when the ability is used, not when the dummy is selected. Basically, I'm just looking to call sync() when the dummy unit is selected, rather than when the ability is used (but I don't know the syntax):
It's worth noting that I don't need it to be MUI, just MPI. I have an array variable named Hero[1..8] (player number) for the hero controlled by each player, which would presumably replace eventUnit here.
Another unrelated minor issue occurs when equipping an item in a slot that already has an item equipped. This will run the unequip function for that slot, then the equip function for the used item. This obviously makes sense as you need to unequip an item before equipping a new one, however equipping an item when you have a full inventory will drop the previously equipped item on the floor, instead of putting it in your inventory in place of the used item (since the unit still has a full inventory when the unequip function is called).
This is not a huge issue and probably a bit more complex than the selection event, but if anyone feels like downloading the system and taking a look at it, I would appreciate it.
Thanks in advance!