I'd like to build a title screen independent of ORK if possible, I feel like the UI elements it's using are a little limiting. Does ORK not work right if we don't use every element of the UI through the framework menu, or can we accomplish the same thing by having our own created UI elements call a particular set of scripts and etc.?
  • That's no problem for ORK - if you don't want to use the built-in main menu, you don't have to. You'll still have to let ORK know when to e.g. start a new game.

    Via script, you can use this to start a new game:
    ORK.Game.NewGame(true);
    true will load the new game scene, false will not do that.
  • Very cool. Is there a list of script calls for this sort of thing if we want to build our own menus?
  • Depends on what you want to do - for starting a new game, the line I posted earlier is the only thing needed.
  • I think what we are looking for is a easy way to NOT use your menu system and be able to connect with and trigger everything it currently does through our own custom UI.
  • edited June 16
    I'm wondering about this too, like could I make my own menu but have the buttons call aspects of the ORK menu system? For instance, the language switch is nested into the immediate main menu but I'd like it to be nested in the options. Could I trigger it like ORK.MainMenu.Language.English(true); or maybe with a Game Event?

    EDIT: I just took a stroll through the API and am having some success. Going to read more and report back.
    Post edited by superschure on
  • @superschure Can you please provide a list of some of the API calls you used on your custom UI? It would be really helpful since it looks like I'm going to need to be able to do the same.

    Thanks
  • You can call pretty much everything in ORK from your scripts - you'll just have to look up what to call or ask specific questions here. I can't really give you a list of every functionality here :)

    E.g. when replacing the main menu, it's best to look at the main menu's code to see what you need to call to start which functionality.
  • So after some R&R I bought the full license for ORK and I'm trying to tackle this but I feel like this is going over my head when it's actually pretty simple. I used the code below and I end up with an error each time.

    ORK.Game.Language = 0; //English
    or

    ORK.Game.Language = 1; //Japanese

    This is the error that pops up:

    NullReferenceException: Object reference not set to an instance of an object
    ORKFramework.GameHandler.set_Language (Int32 value)


    I set the values to reflect the order of the list but it's a no go.

    I'm trying to have a look at the main menu code but I'm confused by your earlier statement as how to see it. Or did you mean to look at the source code?
  • @MikeyUchiha
    @gamingislove

    So I went at it all night with a magnifying glass and realized that the NullRefExc was coming up since I didn't link the ORKProjectFile in the GameStarter. All in all I used this...

    public Button languageButton;

    void Update()
    {
    if (ORK.Game.Language == 0) {
    languageButton.GetComponentInChildren<Text>().text = "Language";
    } else if (ORK.Game.Language == 1) {
    languageButton.GetComponentInChildren<Text>().text = "言語";
    }
    }


    as a reaction to selections made using this...

    ORK.Game.Language = 0; //English
    ORK.Game.Language = 1; //Japanese

    and it works so far.
  • Yes, without first initializing ORK (e.g. through a game starter with an ORK project) you'll get errors everywhere :)

    You can always check if ORK is initialized using the ORK.Initialized property, e.g.:
    if(ORK.Initialized)
Sign In or Register to comment.