Regarding the "Invalid creature index" error: it's possible that if a creature is missing in the i-th stack, the GetSavedCombatArmyCreatureInfo function issues a warning. To catch it, you can add a print statement inside the loop after retrieving the information: print(i, "-th iteration passed"), and see what prints are output. If the prints are mixed with the error, then it's just a warning; if one of the 7 prints doesn't appear, then it needs to be fixed.
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________