| 02-10-2003, 09:35 PM | #1 |
I was wondering is there anyway to lock an item in an inventory without using a shitload of triggers. I could make the inventory lock with triggers, but that would require a lot of triggers and i dont want to overload my map if there is a much easier way. When i say locked item, i mean u cant move it from slot to slot, drop, or use. the latter 2 are easy to do, but stopping from moving slot to slot is a bit harder. It would require me to have a conditional checking for each slot and depending what item was misplaced, would where the misplaced item would go back too. IS THERE AN EASIER WAY???? |
| 02-10-2003, 09:58 PM | #2 |
Instead of 'locking' the inventory of a hero why not create an array for each player that stores what items he/she has. Then because they can't drop them, when you remove and give that hero a different item just edit the array to match. InventoryP1[0] = Armor you now know what items they have and it doesn't matter where they happen to move them, so when you remove(InventoryP1[0]) and CreateItemForHero(...), set InventoryP1[0] = NewArmor, the slot where they had the old armor will now be replaced with the new armor and the array will be updated. |
| 02-10-2003, 10:20 PM | #3 |
if i wanted to oraganize them however (I have items determining a units stats, armor, dam, speed,....), then i would need them to stay in each slot. The array idea is a very good idea, but i also have other triggers that work depending on slot status. So i need another way to keep them in the same place, thx for the idea though, i may use that in another map. |
