- Joined
- Feb 17, 2017
- Messages
- 26
Hi,
So I was planning to create a system which allows heroes to carry around traveling bags, giving them extra inventory space, and this is how far I got:
1) Create 2 custom items ("Open Bag" and "Close Bag")
2.1) Create a trigger that would activate when a hero acquires an "Open Bag", creating 2 invisible dummy units with 6 inventory slots, with one of them acquiring a "Close Bag" item.
2.2) Create a trigger that prevents a Hero from carrying more than one Bag (Optional)
3) Create yet another trigger that will activate whenever a Hero uses an "Open Bag" and another when a hero uses a "Close Bag". With these triggers, and with help of arrays of type "Item" of size 6, I can switch the items between the triggering Hero and the 2 created dummy units.
One would carry the Hero's basic inventory items, when the Hero uses the "Open Bag", and the other the items supposedly carried by the bag when the Hero uses the "Close Bag" item, successfully switching the items between the 3 units.
But here is the problem I now face and don't know how to solve:
Whenever a Hero activates his bag's power to switch the inventory between the dummy units, he technically "loses" his items, as well as all their powers. And I want a system that saves all the item's powers.
When a Hero carries an item giving an aura, I can easily imagine a dummy hero unit at the exact position of the Hero carrying the bag, effectively simulating the aura coming from the Hero.
For items with hero stats I can also imagine doing something like save the Hero's stats and give them to him as basic stats to simulate the maintaining (same for bonus damage items)
But what about items that increase the Hero's HP, mana, attack speed, armor etc...?
I was imagining to achieve this maybe with a trigger that would temporarily copy the abilities of the Hero's items, and give them to the Hero himself (also sparing me the work of saving all the Hero's stats to give him), but I have no idea how to do this. More specifically I have no idea how to do this without giving them abilities that will appear on the hero's abilities.
Maybe there is another way around?
Sorry if my text is a bit too long, I love to get into details
Thanks in advance
So I was planning to create a system which allows heroes to carry around traveling bags, giving them extra inventory space, and this is how far I got:
1) Create 2 custom items ("Open Bag" and "Close Bag")
2.1) Create a trigger that would activate when a hero acquires an "Open Bag", creating 2 invisible dummy units with 6 inventory slots, with one of them acquiring a "Close Bag" item.
2.2) Create a trigger that prevents a Hero from carrying more than one Bag (Optional)
3) Create yet another trigger that will activate whenever a Hero uses an "Open Bag" and another when a hero uses a "Close Bag". With these triggers, and with help of arrays of type "Item" of size 6, I can switch the items between the triggering Hero and the 2 created dummy units.
One would carry the Hero's basic inventory items, when the Hero uses the "Open Bag", and the other the items supposedly carried by the bag when the Hero uses the "Close Bag" item, successfully switching the items between the 3 units.
But here is the problem I now face and don't know how to solve:
Whenever a Hero activates his bag's power to switch the inventory between the dummy units, he technically "loses" his items, as well as all their powers. And I want a system that saves all the item's powers.
When a Hero carries an item giving an aura, I can easily imagine a dummy hero unit at the exact position of the Hero carrying the bag, effectively simulating the aura coming from the Hero.
For items with hero stats I can also imagine doing something like save the Hero's stats and give them to him as basic stats to simulate the maintaining (same for bonus damage items)
But what about items that increase the Hero's HP, mana, attack speed, armor etc...?
I was imagining to achieve this maybe with a trigger that would temporarily copy the abilities of the Hero's items, and give them to the Hero himself (also sparing me the work of saving all the Hero's stats to give him), but I have no idea how to do this. More specifically I have no idea how to do this without giving them abilities that will appear on the hero's abilities.
Maybe there is another way around?
Sorry if my text is a bit too long, I love to get into details
Thanks in advance
Last edited: