edwardr's Forum Posts

  • hahaha.... easier than thought..

    there is a command database.size(0)

  • ok, I don't see which command could help me? I think there is also a little misunderstanding.

    I'll explain what I need:

    I have a text box which shows the actual e.g. research level. When you click the spirit, it goes to the next "level". Of course somewhen there is no next level and then "undefined" appears. This is not nice

    I want to add a compare value in it, which says you can go to the next level until there is no one, which stops adding a additional level.

    so something like that. compare level <= json maximum of this database. I don't want to add manually a global variable, which says this database has 4 Levels. C2 should do this automatically for me

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    Is it possible to find out the size of a JSON database?

    Database

    • 1: Price:50, Time:10
    • 2: Price: 100, Time: 20
    • 3: Price: 150, Time: 30
    • 4: Price: 200, Time: 40

    so I need the variable 4, but how? Anyone an idea, tip, hint?

    Thx

  • [quote:2gmapz3m]I have seen more christmas then you had hot dinners ..

    My opinion is done and I want change my opinion that easy. I have seen and experience with both kind of "characters", but to 99% it's: "Do it, this is a forum. I command it, community, make me the new Zuckerberg"

    But I prefer to close this thread or start a new one somewhere else about "ethic".

  • I use also blank sub-event, so I can close it

    e.g.

    [attachment=0:2poli0io][/attachment:2poli0io]

  • thx, this is the final solution for my Problem.

  • ok, I found a way, which works but it is not nice....

    Maybe somebody has a better idea:

    tokenat(JSON.Value(0,1,"Test"),choose(0,1,2),",")

    tokenat(source, position, separator)

    source: is JSON database

    position: the random effect is in the position choose(0,1,2)

    The disadvantage is: that I have always to put the same quantity of numbers in the json value, otherwhise there will be an error (no number or it won't be choosen).

  • danju92: you can't expect that somebody will code it for you. You have to read the forum, download and try the samples and ask specific questions. (Like what is not working or there is an error) Also a sample what you have would be nice, so it's easier to find the mistake. In this forum you get tips and hints what you have to do, but programming you have to do it yourself. Beside that if you are more polite, maybe you will get more help.

    What you are looking is not help, but rather a programmer. I recommend you should check this:

  • I use animation, because if I want to change an image later to an animation, I don't need to reprogram it. You also can have a animation with just 1 frame, so there is no big different (I didn't see one).

    Also within an animation you can have several frames.

  • or is there another possibility to have a weighted average and get the info from a database (json))

    e.g.

    Product 1: 0,0,1,2,0,1,0,2,0,

    Product 2: 0,2,1,0,2,2,0,1,2,0

    with choose(), I can weight it by saying e.g. choose(0,0,1,2). That means there are 50%: 0, 25%: 1, 25%: 1

    but I want to get the information (0,0,1,2) from the database, because I don't need to program extra variables and compares. Right now I get all the information from the database: cost, price, production time, name,... but not how many products could be sold within a day

  • I use more Event Sheets:

    e.g. one for functions, one for global variables, one for Level 1, one for Level 2, ...., one for database (because I use several databases, comments within are not necessary)

  • choose(0,90,180,270) ??

  • Hi

    I would like to combine choose() with Json. The variables should be in the json database and send to choose().

    instead:

    choose(1,2,3,4)

    it should use something like that (but it's not possible) :

    choose(json.value(0,0,"Test"))

    has somebody experience or tried something like this before??

    thx in advance

  • volkiller730: you are right, i had once a similar problem, since that time I put them in a separate sheet.

    : I checked and tried. My way doesn't change anything. I add also an separate variable (constant one) or change the text field. Nothing happened. It seems that all variable are lost. I'm sorry, but I didn't find a mistake.

    The funny part: I add a new layout, just a blank one and changed if plane is destroyed go to the new layout and show variable. There it works. So the error is somewhere in the event restarts.