edited July 2022 in ORK Scripting
Hello @gamingislove could you please describe how could I add a custom Section, and Subsection without having to modify the code base? I understood from other post it is possible right?

image

Post edited by RustedGames on
  • For adding new editor sections/sub-sections, create a class in your editor code extending the MakinomEditorExtension class. It implements the GetSections function where you can add new sections or sub-sections (also to existing sections coming from Makinom/ORK).
    E.g. check out the ORKMakinomEditorExtension class in ORK's editor source code for an example implementation.

    For adding data that should be saved with the project, you can do a similar thing for your non-editor code, extending the MakinomDataExtension class. Check the ORKMakinomDataExtension class in ORK's source code for an example.
    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!
  • Hi @gamingislove as suggested I created my own MakinomEditorExtension decendant to override the GetSetcions, however it never finds the Inventory Section, here's the code snippet:

    public override void GetSections(MakinomEditorWindow parent, List<GUIContent> sectionHeaderList,
    List<BaseEditorSection> sectionList, Dictionary<string, BaseEditorSection> sectionLookup)
    {

    BaseEditorSection tmpSection = null;

    // get inventory section
    if (sectionLookup.TryGetValue("Inventory", out tmpSection))
    {
    tmpSection.Tabs.Add(this.GetTabWithSeparator(new SchemataTab(parent)));
    }

    }

    However if I try to create my own Section, it works, but ideally I'd like to have the Schemata Tab under the Inventory Section

    public override void GetSections(MakinomEditorWindow parent, List<GUIContent> sectionHeaderList,
    List<BaseEditorSection> sectionList, Dictionary<string, BaseEditorSection> sectionLookup)
    {
    System.Reflection.Assembly[] assembly = System.AppDomain.CurrentDomain.GetAssemblies();
    BaseEditorSection tmpSection = null;

    // get inventory section
    if (!sectionLookup.TryGetValue("Schemata", out tmpSection))
    {
    sectionHeaderList.Add(new GUIContent("Schemata", EditorContent.LoadImage(assembly,
    "GamingIsLove.Makinom.Editor.Images.Icons.Sections.Templates.png", 32, 32)));
    tmpSection = new BaseEditorSection(parent);
    sectionList.Add(tmpSection);
    sectionLookup.Add("Schemata", tmpSection);
    tmpSection.Tabs.Add(new SchemataTab(parent));
    }

    }


    image

    So, I must be missing something else?
  • Hm, your extension might be found/executed before ORK, that's why the section isn't there yet.
    I'll look into adding some sorting options for this.
    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!
  • Hi @gamingislove is it possible to make my custom Schema class ORK Framework Inventory aware? if yes what are the steps I need to code?
    This is the class so far:

    using GamingIsLove.Makinom;
    using GamingIsLove.ORKFramework;


    namespace RustedGames.ORKFramework
    {
    [EditorLanguageExport("Schema")]
    public class Schema : BaseLanguageData
    {

    public Schema()
    {
    }

    public Schema(string name) : base(name) { }



    [EditorFoldout("Garb", "The start equipment will be " +
    "equipped when first adding a combatant to the game and his level is within the start " +
    "and maximum level settings of the start equipment.", "")]
    [EditorEndFoldout]
    public StartEquipmentSlot garb = new StartEquipmentSlot();



    [EditorFoldout("Weapon", "The start equipment will be " +
    "equipped when first adding a combatant to the game and his level is within the start " +
    "and maximum level settings of the start equipment.", "")]
    [EditorEndFoldout]
    public StartEquipmentSlot weapon = new StartEquipmentSlot();

    [EditorFoldout("Shield", "The start equipment will be " +
    "equipped when first adding a combatant to the game and his level is within the start " +
    "and maximum level settings of the start equipment.", "")]
    [EditorEndFoldout]
    public StartEquipmentSlot shield = new StartEquipmentSlot();

    [EditorFoldout("Head Accessory", "The start equipment will be " +
    "equipped when first adding a combatant to the game and his level is within the start " +
    "and maximum level settings of the start equipment.", "")]
    [EditorEndFoldout]
    public StartEquipmentSlot accessory1 = new StartEquipmentSlot();

    [EditorFoldout("Arm Accessory", "The start equipment will be " +
    "equipped when first adding a combatant to the game and his level is within the start " +
    "and maximum level settings of the start equipment.", "")]
    [EditorEndFoldout]
    public StartEquipmentSlot accessory2 = new StartEquipmentSlot();

    [EditorSeparator]
    [EditorFoldout("Abilities", "Define the combatant's base attack, " +
    "counter attack, auto attack and ability development.", "")]
    [EditorTitleLabel("Ability One")]
    public AssetSelection<AbilityAsset> abilityOne = new AssetSelection<AbilityAsset>();
    [EditorTitleLabel("Ability Two")]
    public AssetSelection<AbilityAsset> abilityTwo = new AssetSelection<AbilityAsset>();
    [EditorTitleLabel("Ability Three")]
    public AssetSelection<AbilityAsset> abilityThree = new AssetSelection<AbilityAsset>();
    [EditorEndFoldout(3)][EditorTitleLabel("Ability Four")]
    public AssetSelection<AbilityAsset> abilityFour = new AssetSelection<AbilityAsset>();

    }
    }


    Thanks in advance
  • What would you define as inventory aware?
    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!
  • To have the schema as part of the combatant inventory, do I need to inherit my class from BaseLanguageDataWithType?
  • No, that'd just be for giving it a type selection, e.g. like an item has an item type.
    To get your custom schema into the inventory, you'd effectively have to implement it in the inventory.

    What's the use case for it? Is a schema just another kind of item?
    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 July 2022
    The schema is an object containing:
    Own Status
    5 Equipments
    4 Abilities
    Like a template the combatant can store, switch and reuse.
    I'm trying to avoid having to change the source code.
    Post edited by RustedGames on
  • Well, that sounds like a completely custom mechanic.

    Maybe use them via custom schematic nodes - that way you could make their use as part of a regular item's battle animation schematics, having them stored in the inventory as regular items.
    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!
  • Could you please provide a sample?
  • edited July 2022
    See the Makinom documentation on creating custom nodes. Or copy one of the existing node's code and go from there.

    Btw, do you also have an asset class for your Schema? The data list stuff should be stored in individual assets.
    You can add an asset selection for it with Makinom's regular searchable popup like this (e.g. if your asset class name is SchemaAsset):
    public AssetSelection<SchemaAsset> schema = new AssetSelection<SchemaAsset>();
    And access it like this in the node's execution (after first checking if something is selected):
    if(this.schema.StoredAsset != null)
    {
    this.schema.StoredAsset.Settings.SomeFunction();
    }
    Post edited by gamingislove on
    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!
  • Thanks @gamingislove I do know how to create custom nodes, what I would like to see is a sample from your statement above "having them stored in the inventory as regular items."
    Yes the schema have their SchemaAsset
    image
  • Well - it's pretty simple, you set up an item and use the schema via the item's schematics, e.g. battle animations or custom schematics.

    So, the item is a regular item, using your custom schema stuff via schematic nodes.
    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 July 2022
    Solved with Makinom release 2.6.0, and the new MakinomEditorExtension->Sorting property thanks a lot!
    Post edited by RustedGames on
  • Hi @gamingislove you mean by setting up a "dummy" item that will represent my own Schema class? I'd like not to do that.
    Since in the Inventory.Add method I can pass an IShorcut object, would it work if I implement the interface with my Schema class?
Sign In or Register to comment.