I like ORK and primarily love it for the easy way to handle all the backend data of a RPG (stats etc) but I really dislike the current included GUI system that is bloated and cumbersome, incredibly difficult to layout and for me just awful to use. I just want to use my own external UI to display all the ORK data I need but the problem is, how would I access it? Unfortunately ORK doesn't ship with any examples for anything but the sample project. How would I e. g. retrieve data of a combatant to display in a simple Unity text component on a Canvas?
  • edited September 11
    I went with that approach. There is a bit of a learning curve with that. You'll need to dig into the source files and find what you want. Sometimes you need to add your own delegates to capture some information in source.
    I was able to make custom Inventory, Stat Screen, Hotbar, Turn-based combat controls etc.

    You might want to look at these tutorials:
    http://orkframework.com/tutorial/howto/scripting-where-is-what/
    http://orkframework.com/tutorial/howto/accessing-a-game-objects-combatant/
    http://orkframework.com/tutorial/howto/setting-up-project-references/

    Otherwise it's kind of too large a topic to get into in general terms. If you have some questions about specific functionality that would be easier to tackle.

    @gamingislove had plans for ORK 3 to move ORK into Unity UI component based approach.
    Post edited by hellwalker on
  • edited September 11
    Is "Combatant Component" the same as "Add Combatant" because I can't find anything else by that name. Well I guess it doesn't help that a lot of the documentation/tutorials are about 6 years old by now. I suppose it might be better to just wait for ORK 3...

    Edit: There's a "Update UI Text" component that looks like it could be used? But I'm really confused about it. You‘re supposed to reference a "Content Origin" and can choose "Player" or "Member" but I have no idea what this refers to in ORK terminology. Does "Player" mean the player combatant? What does "Member" mean, a word that literally isn't used anywhere else in the asset as far as I can see? Is it all combatants in the active player group but the first?
    Post edited by ncho on
  • Can you tell me what you are trying to make and it's be easier to reference the code for you.

    In ORK terms combatant is basically the "character" entity of the system. Player, companion, enemy, Wolf, man whatever. If you want them to have stats, inventory and be able to participate in combat you use combatants.

    Each combatant must have a "Combatant Group", Think of it like a "Character Party".

    There is a special combatant group called Active Group, which easily links to current player group. Group.Leader also points to group leader. in Active Player group leader should be the main player you control.

    Member is any combatant that is the member of "Combatant Group".

    You'll basically have to reference the class instances and show information yourself. For example if you want to access player you can use:
    ORK.Game.ActiveGroup.Leader
    if you want to access some stat you can use:
    ORK.Game.ActiveGroup.Leader.Status[0].GetValue()
    Where '0' index is index of status values.
  • Thanks. Yes I already got it to work with the "Update UI" component which was surprisingly easy. I was just a bit confused about all the different terminology. Because it seems according to both the docs there is both an "Active Player Group" but then there are also the individual "Combatant Groups". Logically it would then make most sense to me then that any Combatant Group could be designated the "Active Player Group" but it rather seems that they exist concurrently and are "linked" as you describe? Is that right?

    Anyway thanks for the help so far I'll post more about specific issues as they come up.
  • edited September 11
    New terminology can always be a bit confusing at first, you'll get there once you've worked with it for some time :)

    As @hellwalker said, a Combatant is an entity, or rather, individual instance in the system - when you're using a combatant in-game, e.g. spawning via spawners, adding to objects or have the battle spawn them, will be an individual instance of the Combatant class.
    It bundles all functionality of the combatant, i.e. the status values, applied effects, abilities, inventory, etc. - the functionality is usually access via sub-instances, e.g. abilities via combatant.Abilities.
    A combatant is linked to it's game object (doesn't matter if spawned or added via Add Combatant components) using the CombatantComponent, which is done automatically by ORK. This lets you access the combatant of a game object.

    Each combatant instance is part of a Group, i.e. the player, enemies or NPCs with combatants attached are all members of groups (or combatant groups). The player's group is the Active Player Group and accessed via ORK.Game.ActiveGroup. There can be multiple player groups, but only one is active at a time - think of it like switching between team A and team B.

    So, in short, if you want to access some information to display in a custom UI, you just need to know where to look - probably best to ask here in the forum, though :)
    Accessing the player's information is simple possible through ORK.Game.ActiveGroup.Leader. I've tried to make the names and structures as logical as possible, so it shouldn't be too hard to find what you're looking for.

    Edit: Also, the tutorials might be old, but they're all kept up to date :)
    Post edited by gamingislove on
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks for the explanation. My next issue concerns the ORK console output - I would like to output it to an Unity text element but to start with I can't even find a way to show the console with ORK's internal UI (is this supposed to be done through a HUD element? I can't find anything there).

    Moreover, when simply logging the console output to the Unity console, for some reason the "Join Active Group" from the Game start event as described in the tutorial is not logged to the console despite "Show Console" in the event settings and "Join Group text" in the Console Settings being enabled. However if I manually add a console logging node after that node I get a line in the Unitiy console just fine.

    I also can't find any documentation whatsoever pertaining use of the ORK console so any pointers there would be great.
  • edited September 11
    ORK's console can be displayed using a Console type HUD.

    You can access the console by code via ORK.Game.Console, e.g.:
    string text = ORK.Game.Console.GetLines(false);
    This will get you all added console lines, the order will be inverted if you pass true.
    There are also other GetLines functions to only get console lines of passed on console types.

    I'll look into why the join group text isn't shown, might be a bug.

    Edit: Yep, that's a bug - the join group text isn't added to the console, will be fixed in the next update.
    Post edited by gamingislove on
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.