edited April 2020 in ORK Scripting
1) I see a Call Function node on Event graph. How is that used? I can't see any examples on how to call one of custom c# functions. Could you provide one?

2) I've followed the tutorials all the way to the end. I've now recruited my 2nd character. When I enter the equipment menu I can't choose who's equipment I wish to change. Have I missed a step?

Thanks for all your help so far. Such a fantastic system you've created.
Post edited by Talairina on
Legends of Thamia - Coming soon to Android.
  • 1) It's pretty straight forward, depending on the class/function you want to call. E.g. a function of a component on a game object, you'd use:
    - class origin: Component
    - class name: the name of your class (e.g. YourClass)
    - target object: select the object with the component attached
    - function name: the name of your function (e.g. YourFunction).

    If your function has parameters, you need to add them and set up their correct types (and set values that are used). The types are somewhat limited, if you need something more advanced I'd recommend using Makinom instead.

    2) Probably, make sure to enable Select Combatant in the overview menu's menu item that opens the equipment key. Alternatively, you can also set up input keys to change the menu user via the menu screen's combatant 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!
  • edited May 2020
    Hi Gil,

    I just can't get my head around how to call a Function from a Game Event.

    I've set it up with the following settings (Cropped image to get everything in one image). I could not see any way to add the class which would be scr_coreFunctions.

    Untitled

    I'm clearly doing this wrong. Could you point out where it's wrong please.
    Post edited by Talairina on
    Legends of Thamia - Coming soon to Android.
  • Function names without the () - just the name :)
    Also, if the class name is scr_coreFunctions, that's what you need to put in the Component Name field.
    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!
  • Brilliant. Thank you. This allow's for so much more integration than what I hoped. You wonderful help easily deserves the fee on Pateron let alone the product itself.
    Legends of Thamia - Coming soon to Android.
  • edited May 2020
    On to the next issue I'm afraid.

    I have a Scale Node on a Battle Event. This scales up my "Boss" enemy quite nicely to a Scale of 3 across the board. There is however a side effect. The player and Boss now clip through the ground when they attack. They correctly approach the target but clip down once the attack begins.

    scale-node-player-ground

    scale-node-boss-ground

    Not quite sure where I can look to solve this issue. The Battle happens in another scene from the component that calls it. Removing the Scale node solves the issue but naturally I'm after the larger enemy and doing this through Events would suit me.

    Another question I have is, where can I find the methods for accessing the Battle Gains upon a battle end? I want to pull that information in to my own UI but after searching through the API I can see anything that gives me access to the data I require such as coin, xp gains etc
    Post edited by Talairina on
    Legends of Thamia - Coming soon to Android.
  • The clipping might just be due to the combatant's prefab not really set up for that large scale, so placement might get wrong (or animations placing it wrong). You could try a different setup, e.g. having an empty game object (with a character controller) as the root and placing the original prefab on that.

    You can access the battle loot via ORK.Battle.Loot, which offers various functions and properties to add/get the loot.
    Alternatively, you can also implement your own, custom battle end system/dialogues by extending from the BaseLootDialogueSettings class - check out the classes for the simple and layout battle end dialogues (found in Gameplay/GUI/Battle in the source code). The system is made extensible and allows you to even have your own settings available (and saved) with ORK's 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!
  • Another question I'm afraid. I've noticed mention of 'Draggable' in the ORK api. After searching through the forums, I see that you can drag and drop items for the inventory. I can't figure out how to enable this. I've grabbed the completed Tutorial files and attempted to get that to work like I assume it does. Is there any tutorial or help/tips that I've missed on how to do Draggable 'equip' equipment?
    Legends of Thamia - Coming soon to Android.
  • There are usually settings for that, e.g. in an Inventory menu part, there are Drag and Drop settings to enable that functionality.

    How dragging something looks like is handled by the Drag/Drop Settings in Menus > Menu 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!
  • I've added an item to the player's inventory via
    ORK.Game.ActiveGroup.Leader.Inventory.Add(new ItemShortcut(10, 1), false, false, false);
    Now I would like to check if item exists in a players inventory in another script. I can't quite figure out how to use ORK.Game.ActiveGroup.Leader.Inventory.Get()

    The item is set to hidden, I just need to know if it exists.
    Legends of Thamia - Coming soon to Android.
  • You can do that either via:
    ORK.Game.ActiveGroup.Leader.Inventory.Has(item);
    item is a shortcut (e.g. ItemShortcut) you want to check for, will also check for matching stuff, not just same item reference.

    Or, via the specific sub-inventories:
    ORK.Game.ActiveGroup.Leader.Inventory.Items.Contains(id)
    Here you can check directly for the ID/index of the item.

    Both use cases also have different variants, e.g. checking for a quantity.
    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.