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!
  • Best way is probably to use the Copy function to create a copy of a group and edit the copy to your liking, e.g.:

    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.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ok, I'll try it. Thanks!
  • If i have a group created in a script...
    How can i start a battle with that group?
  • You can create an actual group with the combatants using the combatant group's CreateGroup function (takes the ID of the faction and infos on using level zones for the levels), e.g.:
    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);
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.