Is it possible to use the
Inventory Exchange menu part to collect the battle gains in Battle End?
currently, if the player's inventory is almost full, we can't choose which loot items to collect(put into inventory). also, we may want to remove some items from the inventory bag to free some space so that we can collect some better items in battle gains.
If this feature is not going to come out in the future, maybe I can try to implement
it in custom script. how to handle the battle outcome in script? I found this
BattleOutcome in API document but I have no idea how to use it.
here is my code start the battle:
battleComponent = GameObject.Find("BattleComponents/Battle_One").GetComponent<BattleComponent>();
BattleEndEvent endEvent = new BattleEndEvent();
battleComponent.StartEvent(endEvent);
where I can get the battle outcome(the loot, exp gains, level up informations)? in BattleEndEvent there is EventEnded() method, is this the battle end event?
Any suggestions will be greatly appreciated, thanks.
To do this, use an Collect Battle Gains node in your battle end event that uses the Use Item Box settings. If you want to access it immediately afterwards, you'll need the item box in the scene, so either spawn a prefab of the item box or just have it attached to the player or something like that.
To open an exchange menu with the item box, use a Call Menu Screen node using the Inventory Exchange settings.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
It will be perfect if the inventory exchange has sub menu which we can show the details of the item and do the transfer and drop the items to the world :)