edited August 2014 in ORK Support
Is there a way around the standard Ork Main Menu?

I would like to have my New Game, Continue (or Load) and Option buttons across the bottom of the screen about an inch or a little less from the bottom of the screen.

If there's no way to do it with Ork, does anyone know a way that can be used and still connect to Ork perfectly? I'm not much of a scripter, and this would really save my title screen!

Thanks
  • Sure, you can create a custom main menu and just hook up to ORK's functions if you like.

    If you only want to display the buttons somewhere else (or horizontally instead of vertically), that's easily done by changing the GUI Box you're using for the main menu.
    The position can be changed in the Content Box Settings of the GUI box (bounds and anchor), and you can display the buttons horizontally if you increase the Choice Columns and set Column Fill to Horizontal in the Choice 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!
  • "Sure, you can create a custom main menu and just hook up to ORK's functions if you like." How exactly would that go? What are the scripting names of those functions?
  • edited August 2014
  • Thanks

    I'm having a small issue with having 4 buttons horizontal. The last button is cut in half and it seems like no matter what I change it won't fix it unless I switch to a lower resolution with shirnks the buttons and make them a but awkward looking. Any idea what could be going wrong or is this really only designed for 3 buttons to work horizonally?

    I have the box bound to:

    x - 550

    y - 850

    W - 1000 (I was messing around thinking I needed to make it appear wider to fix the last button)

    h - 150

    Anchor is set to Lower Center and padding is all 0.

    I'm using my own graphic so the show box tab is not selected.

    Thanks
  • Also, Is there a way to change the icon graphic when the that button is selected?
  • Do you have Define Width enabled in the Choice Settings of the used GUI box?
    No, you can't change the icon graphic when it's selected, but you can display a different portrait for each button.
    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 somehow Fixed it, but I believe there is a fixed limit on how big each button can be. At least I see clipping in the graphic. I was hoping to make the select icon cover a portion of the button (If not the entire button) to make it appear to have changed.

  • I have another question, but it isn't related it to this issue, so I will ask it in another thread.
  • edited August 2014
    Well, Kirb, the API is probably the worst place to find anything.

    For example: I create a new choice in the ORK editor main menu tab. Named it "Continue" and added a new script to the "ORK Game Starter" object. Created a function called "ContinueGame" in there and now I need to know how to load the game saved in the first slot.

    Let's look up: Gamehandler -> LoadGame and we find:

    void ORKFramework.GameHandler.LoadGame ( DataObject data )

    Used to load the data - you need to get the data from the ORKFramework.DataObject.

    Parameters
    data A ORKFramework.DataObject containing the data.

    Implements ORKFramework.ISaveData.


    So look up ORKFramework.DataObject:

    DataObject ORKFramework.DataObject.GetFile ( string key )

    Gets the ORKFramework.DataObject assigned to a key.

    Returns
    The ORKFramework.DataObject if the key is found. Returns null if the key isn't found.

    Parameters
    key The key to look for.


    What is the value of the key?? "File 1"??

    So let's try that: Let's add "ORK.Game.LoadGame(ORKFramework.DataObject. "
    at that point the autocomplete should show "GetFile" but it doesn't?! Can I just ignore that and contine until I have: "ORK.Game.LoadGame(ORKFramework.DataObject.GetFile("File 1")); "

    Well, that gives an error. Not really surprising but now I am stuck because the API is a horrible place to find something.

    Another example: CombatantEquipment.Equip:

    bool Equip (int partID, EquipShortcut equip, Inventory inventory, bool reset)

    How do I get the partID? Did you know that setting partID to "-1" automatically puts the item at the first location it can be equipped at? GIL told me that because it is NOT written down anywhere in the API or the tutorials!

    "EquipShortcut equip" is no problem but "Inventory" has to do with the way the Equipment System works in ORK and what does "reset" do? Again there is no information given in the API! Even looking it up in the sourcecode didn't help me understand what "reset" is supposed to do.


    It is really tiresome to constantly get stuck because there is no documentation about what a function or its arguments does.
    Post edited by Kashrlyyk on
  • edited August 2014
    @Kashrlyyk
    Well, if you'd have taken a look at the scripting how-tos, you'd know the basics of where to find what in the framework - e.g. save games (and loading them) is handled by the SaveGameHandler class, accessible through ORK.SaveGame - to load a save game, you call:

    ORK.SaveGame.Load(int index);

    I know, the API is still somewhat missing details and descriptions, but don't forget that this is a massive framework with over 2 years development time that you got for pretty much nothing in costs. Managing all of this alone is quite time consuming, so some tasks stay behind, e.g. the API which isn't used by many people, because most don't do scripting.
    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!
  • edited August 2014
    In the "ORK Framework Editor -> Menus -> Main Menu" under the "Custom Choice Settings -> Call Settings" I have set "Search Type" to "Name" and the "Search Name" to "ORK Game Starter", the component is set to "Continue (Script)" and the method is set to "ContinueGame()".

    public void ContinueGame() {
    ORK.SaveGame.Load(2);
    }


    Clicking on the "Continue" button does nothing. No error or warning. File 1 and File 3 are used and File 2 is empty but the index starts at 0. So what is wrong? I've added a "Debug.Log" to "ContinueGame()" and it is not printed ergo the function is never called.

    BTW: I incorrectly remembered that "ORK.GameHandler" governs "Saving" and "Loading", that is why I didn't check the "How To" website again.

    "the API which isn't used by many people, because most don't do scripting. " Can't wait for the day when I am finished with scripting. With the speed I programm that will not be any time soon. :)
    Post edited by Kashrlyyk on
  • If it's not loading anything, than the file doesn't exist - you can also check if a file exists by calling ORK.SaveGame.FileExists(int index) (returns true if the file exists).
    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 August 2014
    You have missed this information: "I've added a "Debug.Log" to "ContinueGame()" and it is not printed ergo the function is never called."


    public void ContinueGame() {
    Debug.Log ("Function ContinueGame Entered");
    ORK.SaveGame.Load(indexLastSave);

    }


    "indexLastSave" is calculated with "File.Exists" from "System.IO" I think, so I know that the file does exist.
    Post edited by Kashrlyyk on
  • If the function isn't called, either the object or the component isn't found. Make sure that the name of the object/component match the ones in the scene.
    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!
  • Solved! I had to use "Continue" as component and "ContinueGame" as function.

    The only way I got a warning was when the component name was correct but the function call name was not. Wrong component name doesn't throw a warning which seems weird.
Sign In or Register to comment.