Is it possible changing an existing combatant group using scripts?
The situation: i have already created a group of combatants using scripts (ORK2), but i want to assing this new group to an existing group in the "Combatants" tab in the ORK database.
I've though of creating an empty group in the database and adding new combatants one by one.
Is it possible to modify the group assigned to it without having to emptying and filling it manually, one by one?
What would be the best option if i have different groups of combatants created by an script and i want to use the group in the "Combatants" tab multiple times for these different groups for a battle event that has de database group assigned?
Thanks in advance!
int newIndex = ORK.CombatantGroups.Copy(copyIndex);
CombatantGroup group = ORK.CombatantGroups.Get(newIndex);
copyIndex is the ID/index of the combatant group you want to copy. The function returns the ID/index of the newly created group, which allows you to access the settings.
Though, keep in mind that this still needs to be saved via the editor in order to keep the data. Also, adding/copying stuff in-game isn't saved at all.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
How can i start a battle with that group?
Group group = combatantGroup.CreateGroup(factionID, false, Vector3.zero);
If you have a game object with a battle component, you can start a battle with a group like this:
battleComponent.StartGroup(group, null);
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!