igortyhon's Forum Posts

  • Hello. A long time ago, we used families to handle collisions or overlaps of identical objects.

    But in some update, Construct 3 gained these actions, and now such events can be handled even without families.

    Have you tried it?

  • The built-in plugin does not have this functionality.

    You can use a third-party plugin.

  • I think I have a huge problem. I have seven Array objects with about 30 instance variables each to save in local storage lol... It's crazy that I've only just realized this problem that breaks everything. Anyway, thanks.

    This looks pretty good for the array structure.

    The rows can be map numbers, and the columns can correspond to one of seven objects. Then it will be convenient to refer to them and store them.

    It will also be convenient to fill in the initial data via the file.

    But you will need to spend time changing this.

  • Can't I save all Array Instance Variables at once?

    No.

    These are just local variables of the object, just like on sprites or other construct objects. The fact that you have attached them to an array object does not give you any improvement.

    Perhaps you could tell me how you work with the data in the variables “map01...map16” so that I can advise you on a more convenient method of use and storage.

  • these

    It's pretty simple, you save it and load it like a regular variable.

    fex.net/s/fzatrtm

    But your data storage option is pretty tedious, I can't imagine why you added 16 local variables to the archive, but I can easily imagine your sad mood when you process or change them.

    I'm not usually that stubborn, and anything that requires more than three repetitions, I try to process using a loop and an array or dictionary.

  • Thanks, but the issue is the Array’s instance variables — they seem impossible to save using LocalStorage.

    What are these variables that you want to save but can't? Give me an example, I don't understand.

  • Hello, I hope I have understood the question correctly.

    Here is a simple example.

    fex.net/s/ll4z4ac

  • Oh, I didn't notice that this question was in the Construct2 thread.

    I think I used something like that back then. I assigned a variable to an expression where the browser returns the time and immediately converted it to seconds. It looked something like this.

    int(Browser.ExecJS("var d = new Date(); d.getTime();")/1000)
    or
    Browser.ExecJS("var d = new Date(); d.getTime();")
    

    I don't have C2 right now to check this.

    Here's what I put in C3, but it should be the same in C2.

  • - There is a ready-made event to select the nearest one. But if you had a collision before that, you must first select all.

    (need to check)

    - You can create a function yourself that will compare the distance and select.

  • Check out the system actions, where you can choose one random or senior. This helps when several identical objects collide simultaneously.

  • ...

    I always thought that the local storage is written into the games' "browser" memory, so updating the phone or system browser shouldn't affect that.

    That's how it should be.

    But I also notice that sometimes data in local storage is lost. It doesn't happen often, but it does happen. Maybe it's the browser's fault, or maybe it's the user's accidental actions.

    My advice is the same: add alternative options for saving progress.

  • ...

    Should it be text object instead of spritefont? What about the performance impact of such solution?

    Hello.

    This information is outdated. A long time ago, browsers had problems rendering fonts, so we tried to display text using images.

    This is no longer the case, so feel free to use any font you like.

  • It's a very bad method to always keep the game running in the background. I would advise such developers to be punished.

    Is it so difficult to make everything time-dependent? And each time the game starts, recalculate the progress according to the time that has passed.

    I believe that in 4 months, some service or even an update could clear the local browser storage. You can duplicate the save to a file or some cloud service.

  • You do not have permission to view this post

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads