dop2000's Forum Posts

  • Yeah, pirates are scary. But you posted a link to C3 editor, and I'm sure pirates know about this link already..

    You need to save you project as a C3P file. Upload this file to Dropbox, Google Drive or similar service, create a share link and post this link here.

  • And another addition, I've done a fair amount already using C3 arrays but I really don't like the way they work. If the stuff gets too complex, it starts to feel like I'm wrestling with C3 rather than coding.

    I agree, that's why I prefer using object instances instead of arrays. A bunch of instances with instance variables basically represent a multi-dimensional array, and it's much easier to work with it.

    For example, if you need an array of football players, create 11 sprite instances for each team (they may be invisible or off-screen). You can define many variables (name, score, salary etc), and then easily do whatever you want with events - pick any player or a group of players, filter them by many parameters, make bulk changes, find min/max values, sort, remove etc.

    If you still prefer to work with Javascript array, you can return its data back to C3 events as a JSON string, but I believe it will not be compatible with C3 Array object. You can load it into JSON object though. Another option is to return a comma-separated string, which you can then parse with tokenat/tokencount expressions, or use CSV addon to convert to array. Or create a function in the script which will update C3 array with the data from your JS array:

    construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/plugin-interfaces/array

  • If it still doesn't work, please post your project file. It's tiresome when you reveal only a small bit of information at a time..

  • If you do exactly like on my screenshot, it should work. Run the game in Debug Mode and check the array contents.

    If it still doesn't work, please post your project file. It's tiresome when you reveal only a small bit of information at a time..

  • No, it doesn't work this way.

    You need to request the JSON file with AJAX first, then load it into the array from AJAX.LastData

  • Search the tutorials section for words like "mysql" or "php", there are quite a few good examples there:

    construct.net/en/tutorials

  • Can you post a screenshot of your event sheet? Or share your project file?

  • I know you are talking about the array, but you need to post a screenshot of your problem because it's unclear what you mean. Array is not a visible object, it's a data structure, it can not be on-screen or off-screen.

  • Is the dust created on landing? If if is, then your event is working correctly. The "PLAYER_LAND" animation is most probably starts playing, but then immediately replaced with another animation, idle or run. There are a few ways to fix it, for example you can set a boolean variable isLanded=true, and then after a small delay isLanded=false. And add a condition "isLanded is NOT set" to other events.

  • Here is a tutorial on reading the data back from Google Spreadsheet:

    construct.net/en/tutorials/create-online-database-with-google-spreadsheet-1373

  • I don't understand what you mean by "a value or string is off screen in an array". Are you talking about the array editor? Can you post a screenshot?

  • If you want to preserve some values after the "Reset global variables", there are a few ways to do this -

    • you can make a static local variable in an event group. Static local variables are not reset.
    • you can create an instance variable on a global object (array for example), or create a dummy object (empty sprite) and set it as global
    • store it in an array or dictionary
    • save in Local Storage
  • Again, I don't see any problem with ReponseJoueur variable.

    Have you tried running the project in Debug Mode and checking instance variables there?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The code you posted should work correctly. If ReponseJoueur is changed for all instances, there is probably some other event that causes it.

  • Do you change the "health" variable in "VerificationResponse" function? The function doesn't know which instance was clicked. You need to pass Element.UID to the function in a parameter, and pick Element instance by UID inside the function.

    Also, it's difficult to read your screenshots as they are in French. Please next time switch C3 language to English, or post your project file.