Tour Preview

Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › Loading Specific json levels?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #22708

    Ginzo Milani

    so following this method: https://felgo.com/doc/felgo-leveleditor/

     

    I have successfully made my own level editor and implemented level loading logic into my game, works beautifully. now I am just wondering how do I load in specific levels? Right now I have it set like so:

    I have a Container Object where all components are loaded into, and once it is completed I have this:

                Component.onCompleted: {
                    levelEditor.loadSingleLevel(levelEditor.applicationJSONLevels[0])
                }

    two problems with this,

    1. The level being loaded might not be the correct level depending on the order the JSON files are loaded
    2. This could fail in the scenario where the applicationJSONLevels has not finished populating.

    I tried to use this:

    onLoadLevelFinished

    So I can avoid problem 2, however it loads faster than the container, so it does not load correctly. I do not know if problem 2 is really a problem, as it could be possible that the JSON files will simply never load slower than the components, but I do not know how to measure the speed of the JSON being loaded / the components being loaded.

    #22851

    Ginzo Milani

    bump

    #22853

    Marcin

    Hi,

    I don’t use Felgo for almost 2 years now but when I was using it I developed system when my designer could see list of levels and could load selected to test and save it later.
    Will look at old codebase and will post how I achieved that.
    I guess it is possible since I was doing it back in the days, probably some API call, but I am not 100% sure now.

    #22854

    Simon

    Marcin, what do you use instead of Felgo? It seems awful quiet around here.

    #22857

    Marcin

    I don’t want to start any off-topic or convince anybody to use something else.
    So quickly, I switched to Unity(game develpoment specific product, big community and asset store) and that’s all 🙂
    Lets focus here on the main issue which is loading levels in Felgo.

    #23034

    Ginzo Milani

    Is there no way to load a specific json level without manually parsing the file yourself?

    #23067

    Alex
    Felgo Team

    Hi Ginzo,

    the load level method requires the level metadata as provided in the json. Are you referring to the applicationJSONLevelsLocation ?

    Why are you actually “parsing” the JSON and not just access them by id?

    Best,
    Alex

    #23095

    Ginzo Milani

    alex.huber said:

    Hi Ginzo,

    the load level method requires the level metadata as provided in the json. Are you referring to the applicationJSONLevelsLocation ?

    Why are you actually “parsing” the JSON and not just access them by id?

    Best,
    Alex

    So let’s say I have a file called “FirstTown.json” and another file called “Roaming.json”, and maybe 20 other JSONs for other maps.

    How do I load those two specifically? (For example one button with “Load First Town” and another button with “Load Roaming”)

    #23097

    Ginzo Milani
     levelEditor.loadSingleLevel(levelEditor.applicationJSONLevels[0])

    instead of this I want to do something like levelEditor.loadSingleLevel(levelEditor.applicationJSONLevels.firstTown)

     

    levelEditor.loadSingleLevel("../../../assets/jsonAreas/level.json")

     

    This works, documentation doesn’t specify you can set a path. Thanks for you time!

Viewing 9 posts - 1 through 9 (of 9 total)

RSS feed for this thread

You must be logged in to reply to this topic.