OpenXcom Forum
OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Support => Topic started by: Alpha Centauri Bear on December 26, 2023, 11:20:29 pm
-
Does the game restrict inventory slots? Like is it possible to create two left hands?
What is the best way to iterate and find a specific slot type?
-
I don't understand the questions.
-
Let's say I add this ruleset.
invs:
- id: STR_LEFT_HAND2
type: 1
Will it be accepted by engine? If yes, will it create any problems in the engine having three hands in the inventory now? Or any other problems or concerns?
-
Will it be accepted by engine?
yes
If yes, will it create any problems in the engine having three hands in the inventory now?
no
Or any other problems or concerns?
yes, three-handed humans sounds like a concern to me
-
yes, three-handed humans sounds like a concern to me
🤣
Thank you.
-
I do wonder, though, which hand(s) will be shown in on the battlescape, because the GUI has room only for two and a special attacks icon on top right corner. So, while creating additional inventory slots has already been done a lot of times in the mods, more "active hands" could be troublesome.
-
I absolutely agree and I don't plan to create another hand.
My question was how to properly iterate slots in the code. Is using hardcoded slot ID acceptable?
_game->getMod()->getInventory("STR_LEFT_HAND");
-
My question was how to properly iterate slots in the code. Is using hardcoded slot ID acceptable?
That's up to you.
You can use: _game->getMod()->getInventoryLeftHand();
Or: _game->getMod()->getInventory("STR_LEFT_HAND", true);
Or even: _game->getMod()->getInventory("STR_LEFT_HAND");
if you want to start supporting one-handed inventories in your fork, or whatever. If so, don't forget to check for nullptr.