Hi there,
I am using ORK3 and I am trying to create a new combatant through the function:
Combatant combatant = ORK.Combatants.Create(int combatantID, Group group, bool showNotification, bool showConsole);
I have an existing Combatant group in Makinom>Combatants>Combatant Group but I can't find a way to get it so I can use it as the second argument in the function...
Also, is it possible to spawn a Combatant that isn't using any Combatant Group? I couldn't find any function overload that doesn't require a group.
Combatant Groups are not needed, they're just a template for building a group with one or more combatants. However, each combatant is part of a Group - you can also pass on null as the group in the creation functions and the combatant will form it's own group.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I tried something like this
Combatant combatant = ORK.Access.Combatant.CreateInstance(setting, null, false, false);
but admittedly I got lost in the code and I'm not entirely sure how to properly set the first argument of the function "CombatantSetting setting"
CombatantSetting settings = ORK.Combatants.Get(index);
index is the index in the editor list.
You can also pass on a string containing the GUID of the combatant.
Also, since in ORK 3 combatants are individual assets, you can also get the settings from a CombatantAsset you can just get like any other asset in Unity:
CombatantSetting settings = asset.Settings;
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I noticed that all my spawned combatants have no faction assigned, how can I assign an existing faction to a combatant when creating & spawning it at runtime?
new Group(faction)
faction is the FactionSetting of the faction, similar to getting the combatant, either via a faction's asset or via ORK.Factions.Get(index), etc.
You can also set the group's faction after it's creation (again FactionSetting), e.g. for a combatant:
combatant.Group.Faction = faction;
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
So, instead, you can use a CombatantGroupAsset to access and create the group - you can just use it like any other Unity asset. The Settings property contains all settings and functionality of the combatant group, e.g. to create the group:
Group group = groupAsset.Settings.CreateGroup(faction, true, position);
faction is the FactionSetting of the faction the group will belong to, true or false to use level zones and position is the position (for level zone checks).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!