edited January 12 in ORK Support
Hello.

I have two questions.
1. is it possible to align the position of the enemies at the beginning of the battle according to the number of enemies?
I thought I could do it with Enemy Spot, but it does not work.
I want the placement position to be like Horizontal layout Group Component.

2.I want to be able to randomly acquire items and weapons when certain events occur.
I was able to get certain items with ORK.Game.ActiveGroup.Leader.Inventory.Add(newItemShortcut(ORK.Items.Get(0), 10), true, true, true)). But how can I randomize it, change the ORK.Items.Get(0) part to what I set in Combatant>Loot?

[Addendum to 2]
I was able to add random items and weapons using the Add To Inventory Node. But how do I get a dialog like [I got one potion!!!]? etc... How do I show the dialog?
I thought I could do this using the Show Dialogue Node, but I didn't know how to display the name and number of items obtained. How do I get the name and number of items?
Post edited by TomoTomotomotomo on
  • 1) That's usually handled by the battle spots.
    You can e.g. set up Conditional Battle Spots to use other positions based on number of group members or any other condition.

    2) If you want to use loot via scripting, you need to have access to the LootAsset that defines the loot (i.e. a regular asset in Unity). That information is not directly referenced by the ORK project.
    With the asset, you can simply add it to a combatant's inventory (using the loot's setup):
    loot.Settings.AddToInventory(combatant, true, true, true);
    loot is a LootAsset, combatant the instance of the Combatant you want to get it.

    If you want to make this with a dialogue, you'll need to first create a new item and store it into selected data using a Select Item node. You can store the name of the item into a string variable using Store Selected Data Content node and display that variable in a dialogue. The Add To Inventory node can use the item from selected data.
    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 was able to solve problem 1.
    Thank you.

    If I use LootAsset, can I get the name and number of items to acquire via script?
    If so, how can I do this?

    I have a new question.

    When I attack an enemy and inflict damage, I want to display the flying text in the center of the enemy sprite, but it is shifted to the side.
    What should I do?
    What do you think is the cause?
    The base offset in UI Settings > Default Flying Text Positions is all 0.
    The flying text is copied from 2D RPG Quickstart.
  • @TomoTomotomotomo Flying text can also be defined under each status value to override the default settings, and if I remember correctly, the tutorials have special flying text defined under the HP status value itself (and MP too I think)
  • I'm not sure about the new question, but I copied the World Space Canvas article from this tutorial and it worked.
    https://orkframework.com/guide/non-knowledgebase/gameplay-bits/fun-with-flying-text/
  • TomoTomotomotomo said: If I use LootAsset, can I get the name and number of items to acquire via script?
    If so, how can I do this?
    It's a bit complex, but the loot settings have a function to get the possible item gains:
    List<ItemGain<GameObjectSelection>> gains = new List<ItemGain<GameObjectSelection>>();
    loot.Settings.GetPossibleGains(combatant, ref gains);

    for(int i=0; i<gains.Count; i++)
    {
    string name = gains[i].item.GetName();
    }

    The individual gains can give you their content information like that (e.g. also description, etc.
    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.