This is more of a general question actually, how do I access parts of the framework from the schematic.

For example info about the battle? what is the combatant that starts the turn? other combatants in the battle? What they are doing.

Now for example:

I've figured out that I can use the Machine Object in the "Attack schematics" to get info about the combatant that is doing the Attack:

image

but then if I want to check the transform of this combatant or his target there is no Machine object to be found

image

so I've had to create actors at start of schematics for machine and starting object

image

but then to move the combatant I want, machine and starting object are back in a different node,

image

which is great but it doesn't always work, sometimes it moves the Starting Object as selected sometimes it moves the Machine Object.

But then if want to figure some of this info in the Battle Turns Start schematic, I have no idea how to find any of this information. Or even which turns is next, stuff like that
  • but then if I want to check the transform of this combatant or his target there is no Machine object to be found
    Are you using Check Value to check the transform? If so, you just need to replace that with the node Check Transform. That will solve that problem.
    which is great but it doesn't always work, sometimes it moves the Starting Object as selected sometimes it moves the Machine Object.

    But then if want to figure some of this info in the Battle Turns Start schematic, I have no idea how to find any of this information. Or even which turns is next, stuff like that
    The User of the machine will always be the Machine Object, (the Target is the Starting Object). You have to keep this in mind when designing your machines.
  • edited April 2023
    some nodes will not give you a dropdown option to use Machine Object or the Starting Object.

    My question is how to access other parts of the framework, get info about values, ecc.

    I give you an example. in the Attack schematic the Machine Object is the attacker (player unit) and the Starting Object is the target (enemy unit). I can get some info about these units BUT what if I want to get info in this schematic about the OTHER player unit. (player has two units). And what if he has 5?

    That unit is outside the scope of this schematic

    This must be a simple answer I bet
    Post edited by dorusoftware on
  • @dorusoftware For that you could use a Select Combatant or Select Combatant Objects node and provide the appropriate filter info (player, enemy, range, last target, etc.) to store it into Selected Data, which you can then use in other nodes provided that same data key gets used.
  • and how do i use that node?

    there is all these cryptic fields that are not clear at all

    do you know perhaps how to output a variable/key content to the console node? To see if messing with the settings produce any result.
  • I mean that depends on what you're trying to do with it really. If you want all friendly combatants in battle for example you'd use the Select Combatant Objects node, change Needed to All, check Add Player Group, and set In Battle to Yes. You can then apply additional conditions (like only Poisoned combatants for example) if you want.

    The Data Key is what you're storing (and later accessing) the data under, essentially the variable name while the Data Origin is the scope of it. Local only living in this schematic (and I think for Battle Animations it'll apply to all schematics that are part of that but I'm not 100% sure), Global outside of it, etc. The way I think of Selected Data is that I treat it as a Dictionary data structure where your Data Key is the Key and the "Selected Data" is the Value returned.

    If you click or hover over them, they should give you a little tooltip on the left hand side that should give more context to what the fields are used for.

    I'm not sure about printing out key content, beyond maybe looping over selected data, but for variables you can usually use something like in the Console node text box where the .int is the data type, and the =test is the name of the variable itself.
  • You can also add actors to the Settings node instead of using selected data.
    E.g. using the Allies (Battle) actor type with Allied To set to Machine Object, you'll get all combatants in battle that are allies of the user (in a schematic animating a battle action).

    There is no way to print the content of selected data (since this is stuff like a combatant, an ability, a game object or a component, etc.), but you can print regular variables via text codes.
    E.g. the Unity Console node can print to the console. Click on the More button above a text area to get more text options, allowing you to add all kinds of text codes - e.g. Variable for adding variable text codes.
    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!
  • You can also add actors to the Settings node instead of using selected data.
    E.g. using the Allies (Battle) actor type with Allied To set to Machine Object, you'll get all combatants in battle that are allies of the user (in a schematic animating a battle action).
    then how do you use this? in the schematic I mean? How do I access a particular combatant? There are any tutorial that show how this work in detail?

    Honestly this system works, but is very confusing, not clear at all. And I'm not really a beginner to all this, I've figured out how to use playmaker, bolt, and unreal blueprints.

    But this, there is nothing intuitive at all, and your answers clearly shows that you don't read the questions I'm asking, and you are skipping over it and answer something that is not helpful.

    I don't take for granted your help here, but because this forum exist, I'm trying to get some answers if is possible.

    For example I'm trying to figure out in the schematic that fires when the Battle starts, which player combatant is first in the turn order before the other combatant from the player group. There may be an enemy first in the turn order. So I need to access the combatants in the battle start, get the order queue, find the place in queue for each player combatant. Access the one that will come first. Then move it into view.
  • The ORK 3D Playground tutorial uses Actors for combatants, along with other Schematic settings like Prefabs and Audio Clips.

    https://orkframework.com/guide/tutorials/3d-rpg-playground/anim-01-battle-start-end-schematics/

    This step uses Actors for the Battle Arena and all Combatants in the Battle Start schematic.

  • I will download the complete project and will check :) Hopefully then will be clear :) Thank You
  • No it doesn't have anything like what I'm talking about, only simple setups.
  • dorusoftware said: But this, there is nothing intuitive at all, and your answers clearly shows that you don't read the questions I'm asking, and you are skipping over it and answer something that is not helpful.
    Well, Acissathar already gave an answer (Select Combatant node), so I just added another way of getting allied combatants.
    dorusoftware said: For example I'm trying to figure out in the schematic that fires when the Battle starts, which player combatant is first in the turn order before the other combatant from the player group.
    The turn order isn't determined at that time (battle start schematic).
    If you want to move the combatant into view who's turn it is, you can e.g. use the turn start schematics (set up for all combatants in Combatants > Combatants > General Settings in the Default Schematic Settings, each combatant can override them individually) - or alternatively use the Battles > Battle Camera setup to auto focus camera on the battle action (e.g. looking at selecting user).
    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!
  • I've implemented the Turn Order HUD, that one shows the order of combatants. It is clear it takes this info from somewhere but I can't seem to find how to access this value.

    Better said, something is setting the portraits in the correct order.

    I've unzipped the source code and checked the scripting options.

    My idea is to have a c# script that checks the Turn Order info and then sets a variable to be used by the schematic.

    Ideally would be to get this info directly in the schematic.

    Where is this Turn Order Info? This is common information for a turn based game.

    So far I've checked:

    ORK.Battle

    this one has a bunch of events about turn changing, stuff like this, nothing about the order of combatants

    ORK.Game.Combatants

    combatant.Battle.TurnValue, combatant.Battle.Turn, combatant.Battle.TurnState, combatant.Battle.TurnValueDummy

    all these gives 0 values, then some increment during gameplay.
    The turn order isn't determined at that time (battle start schematic).
    when is determined and how I get it?
    If you want to move the combatant into view who's turn it is, you can e.g. use the turn start schematics
    I've already did this. It works, this is not the issue.

    I have only one player unit on screen, and sometimes the enemy will be first. I need to know, in the queue, which of player combatants will be first and then move it into view at start of battle, even if an enemy unit will start the battle or the battle turn.
    Well, Acissathar already gave an answer (Select Combatant node), so I just added another way of getting allied combatants.
    no, because you are talking on accessing a combatant that does an action. I've already figured this out. How do I access other combatants and figure out what order they are in the queue
  • Schematics currently don't have access to the turn order - I'll add a new node to store it into selected data in the next update.

    For now, you can get it via scripting - the function ORK.Battle.System.settings.GetTurnOrder will get you the turn order, but you should first make a check if it's a turn based battle (ORK.Battle.IsTurnBased()).

    The turn order is determined at the start of a turn (for Multi Turns mode a turn starts after each action), i.e. right after the battle start schematic, but before the combatant's turn start schematic.
    Turn based battles can set up overall battle turn start/end schematics that are used at the start and end of a battle turn (i.e. before and after the combatants have their turn start/end).
    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!
  • edited April 2023
    ok, this kinda works but I have some issues.

    I don't know what event to hook up to so I can get the data back correctly

    Battle starts returns nothing, which may be because they are not set yet.

    Turn changed works only After all the combatants already did a turn. Also it throws an error after working once.

    It also make sense because firs turn starts then turns changes.

    What event I could use to hook me up, ideally at start of battle before any combatants start doing stuff?

    And what about those options in the function? I'm not sure which to use.

    image

    Can I call unity scripts from schematics? Maybe I can call the scripts from the (Player, Ally, Enemy) Turn Starts Schematic (those that are in the Combatants general settings)
    Post edited by dorusoftware on
  • I've managed to make this works. This was way more complicated than expected. I will post here a solution but expect headache if you are new to all this.

    To make this works we need:

    A C# sharp script attached to an object in the scene where the battle takes place. On this game object also add a Variable Changer component with a string variable that will contain the unity function result.

    Then a schematic that will fire WHEN the turn order is available. I've found out that it works In the schematics set for combatants, Player, Enemy, Ally Turn start. (Combatants general settings). It doesn't work in the Battle Start or Turn Start.

    Here is how the game object from the battle scene is set.

    Note that I set the string value to "none" to check the content later. Also click on AutoStart so the variable would get created when the scene is loaded. I guess you can set this variable in the schematic directly and not sue this component, but I need more variables and I plan I will try to group them here, to have all of them in one place.

    image

    Here is how the c sharp is set up

    We get the list of all combatants in queue. I need this only at the start of the battle so for me the "Get Turn Order" function arguments doesn't really matter at this point, but for reference, except the last option which I have no idea what it is, the first argument will also add the combatant which turn is right now, the second argument will not include combatants which turn had already passed, the third argument is how many combatants you need. I don't plan to have more than 20 so it doesn't matter as the function will not break if you have less combatants in the battle that requested.

    then I loop trough the list till I find one that is in the Player faction. Then, I set the ORK global variable to the combatant name.

    You can add here other logic depending on what you need to do with the queue results.

    image

    here is how the schematic works, this goes into the Enemy Turn Start.

    right click and open image in new tab to see it in higher resolution

    image

    hope this helps :) if anyone stumble on this thread in the future
Sign In or Register to comment.