[solved] How do I load a specific json with function()

0 favourites
  • 10 posts
From the Asset Store
Progress\Loading Bar. Now Load you game like a Professional.
  • Hi,

    Has somebody experience with json and function ?

    I'm able to send variables through the call function.

    e.g.

    function(2)

    set text to Database.Value(0,Function.Param(0),"ID")

    But what I want to change the database name ???

    e.g.

    function(Database1)

    set text to Function.Param(0).Value(0,1,"ID") -> (this is not accepted)

    set text Database1.Value(0,1,"ID") -> (this should be the result)

    This should save me a lot of programing...

  • You should use this with JSON :

  • yes, I'm using it already, but it doesn't solve the Problem with opening a specific database by calling the Name with a function

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • What kind of object are your databases ?

  • I made a sample

    with the slider you can choose the Detail Information

    with the list you can choose which database should be load. (but this is not working)

  • You can always use a family for this kind of thing. Add a family instance variable to identify each database and use it to do the picking. Here :

  • pick by comparison .. THX!!!

  • Hi

    Magistross: I have on more question: (sorry)

    is it also possible to pick a specific globalvariable? So without slider and given variables. (Families is not working with Globalvariables and function.param(0) is not recognized as a globalvariable)

    e.g.

    when Database 1 is chosen, take globalvariable 1

    when Database 2 is chosen, take globalvariable 2

  • You ought to migrate from global variables to a plugin like Dictionnary. It allows for the flexibility you seek, although you can't manipulate the data at edit time.

  • ... not good..

    I have to rethink this problem, maybe I can solve it otherway...

    if interested: I need this for a research function.

    e.g. I have several databases (ship, plane, truck, ..) with detail information and different level and I just want to show the players level (one globalvariable for each database) of the truck and all this information what it can do. e.g. Player: Level 10 for Truck, 3 for submarine, 5 for plane,...

    I thought with families and compare, I can reduce it to one function. (Except the players level it worked)

    If I find a solution I will post it

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)