Transferring data

  • Is there any way to transfer data from 1 instance of an object at a time in the form of instance variables?

    Because this is how level tiles work in Dreamer's Kingdom, they contain data in the form of instance variables, and they're supposed to transfer their data to global variables.

    Is there an add-on that can do this? Or am I missing something?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So you want to quickly copy values from instance variables into global variables, for any instance? The easiest way I guess is to create a function. You will still need to add an action for each variable, there is no way to cycle through all variables in a loop. (at least not possible with events, you can do this with scripting)

    If you have too many instance variables, like a hundred or more, consider using a linked dictionary instead.

  • Is there any way to transfer data from 1 instance of an object at a time in the form of instance variables?

    Because this is how level tiles work in Dreamer's Kingdom, they contain data in the form of instance variables, and they're supposed to transfer their data to global variables.

    Is there an add-on that can do this? Or am I missing something?

    All instances share the same copy of the class's class variables. ... Every time you instantiate a new object from a class, you get a new copy of each of the class's instance variables. These copies are associated with the new object.

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