"Anything" Attribute

rob1221

  • *
  • Posts: 9474
I think being able to make an "Anything" (Dynamic in Haxe) attribute would be useful for some developers who like to mix code and blocks, myself included.  Photon had an idea about making custom data types, but that would be more difficult to implement.

Photon

  • Posts: 2693
Well, I'm not too familiar with Haxe, but from a generic programming standpoint the idea of custom classes/data types doesn't sound too hard to do. You could essentially define your class name (say Cartesian Point), and then delegate attributes to it (two number attributes for the x and y, for instance), just like in behaviors. You could then make as many instances of this class as you want in the dashboard (like you would actor types), each with its own data set. The kicker is, though, is that these data sets could be called from anywhere without having to be stored in a behavior and retrieved from an actor instance in scene (or from a massive set of GAs for a lot of data).

Along the lines of the "Anything" attribute, you could then load a data set into that attribute and then call its sub-attributes (by text, for instance) through a block, like:

Get attribute (text) from data set (anything)

Again, it sounds easy enough to conceptualize on my end, but I know it would take some time to implement to be sure. Not sure how much complexity it would entail for implementation given the current engine, but I do know that this kind of feature could be a HUGE plus.
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

rob1221

  • *
  • Posts: 9474
I guess what you'd like to do is to be able to create a new class in design mode.  Currently design mode behaviors extend from the Script class, and the only way to make your own class is with code.  You probably could, however, make your instances within those classes and then expose them to your behaviors with either custom blocks or extension blocks (these can return anything).

« Last Edit: September 01, 2013, 08:53:54 pm by rob1221 »