[Request] List/Array/Table Behavior

Post your work in progress addons and get feedback

Post » Fri Jun 19, 2015 12:36 pm

Hello fellas,

  • should be possible to store data in a multi dimensional array (or list, hashtable etc) within an instance of an object.
  • similar to a local variable of the object instance, but with array/list functionalities like push, pop, sort, iterate etc.
  • actually it could work if the official array object could be used as a behavior.

I would use it a lot.
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Post » Fri Jun 19, 2015 4:23 pm

You can do this with a container. Add an Array object, select your parent object, Create a container in the GUI, add the Array. That array will automatically be created and picked with the parent.
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Sat Jun 20, 2015 5:19 pm

gonna try that approach. I think a separate behavor would be more intuitive to use.
Last edited by xoros on Sat Jun 20, 2015 5:29 pm, edited 1 time in total.
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Post » Sat Jun 20, 2015 5:27 pm

ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Sat Jun 20, 2015 5:51 pm

Ok, it works, but with many limitations.

1st issue - you can't add container to a family, what means if I have multiple sprite objects in the family which should share the same functionality (e.g. an array) i have to create a separate array object for each individual sprite object, because it's not possible with the family.

2nd issue one and the same object type can't be shared by different containers, which is very limiting

Actually it would be nice, if more modularity features would be added to C2, like proper working container with hierarchies and object blue-prints (groups of behaviors and object types).
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Post » Mon Jun 22, 2015 8:42 am

I am trying to make taffydb plugin recently. Hope it would be useful.
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Mon Jun 22, 2015 1:49 pm

@rexrainbow sounds great. So it will be possible to store list data inside objects and do all sort of queries with that? Or it will be a mini-database inside an object?
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Post » Mon Jun 22, 2015 4:05 pm

Why not instance variables with JSON in?

You can try my prototype: Plugin
Looks more complicated than it is. :D
I manage complicated dictionaries with it.

You can do:
Add instance variable to instance, for example myobj set it default "{}"
instance.myobj = DirectData.SetToObject(object.myobj,"firstpath,secondpath","hello")
or something like
instance.myobj = DirectData.SetToObject(object.myobj,"firstpath","{""secondpath"":""hello""}")

------------------------------------

But yes, I will anyway adopt it to a behavior.
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Mon Jun 22, 2015 5:23 pm

So, I added a behavior.
Works like the plugin...
I add infos later.

Now for this its easier:

instance.DirectData.Set("firstpath,secondpath","hello")
or
instance.DirectData.Set("firstpath","{""secondpath"":""hello""}")

------------------------------------

Sort I have never needed, will look for it.
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Tue Jun 23, 2015 8:19 am

@deathangel1479 Thanks, that's a solution.
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Next

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 0 guests