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.
  • Best use the access handler functions: ORK.Access.Combatant.CreateInstance

    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.
    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!
  • Hello
    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"


  • You can get the settings of a combatant similar to ORK 2:
    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;
    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!
  • Perfect, I was able to get this going!

    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?
  • The faction is defined by the combatant's group - so you need to create a group of that faction and use that for the combatant:
    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;
    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!
  • Worked like a charm, thank you!
  • Is there a way to create combatant(s) and spawn them using Combatant Groups GUIDs?
  • No, because the combatant groups are not directly referenced by the project asset. The project only references stuff that's needed for restoring save games (e.g. combatants, items or abilities). Combatant groups are only needed where they are directly referenced.

    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).
    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.