PlayMaker Feedback > Feature Requests

Adding Array/Hashtable Natively

(1/2) > >>

tester:
Could you add array/hashtable in playmaker natively? like how we create int / string variables in playmaker

It is pretty inconvenient to use with arraymaker and  proxy components.

kiriri:
actually I think that's a bad idea (sorry :I ).
There are quite a bunch of important things which still need to be added to Playmaker. So I think it would be just a waste of time and already limited resources to spend time on something superficial. I do agree that some kind of integration would be great, but it should be done much later imo.
Additionally Jean's ArrayMaker really is splendid, it works very well for all purposes and makes it easy to see what's happening in game. I've used it a lot of times and whatever you call inconvenient, it is not :D (well at least not in my opinion). The proxy components are in and of themselves each a new "array-variable" and the reference is their name (Metaphorically speaking).
I do agree though that perhaps arrayMaker should be in the main build.

best,
kiriri

jeanfabre:
Hi,

 The next drop of playmaker will offer some critical improvement in Actions properties GUI which will give ArrayMaker a new facelift: basically, the actions will come down into a bear minimum amount of visible properties, and it will be a lot less scary and messy to understand, so expect a real progress on that front for a more comfortable and effective use of ArrayMaker actions.

 As for built in support for array, I think too that the amount of work would be colossal and would likely imply a complete rewrite of most of the variable interfaces and create so many problems down the road, just by thinking of it... my head is spinning. I think the great thing about arrayMaker is that the data is encapsulated into ArrayMaker proxies like Kiriri explained which makes it easier to manage because it's completly open to Unity Editor GUI which means raw power and dedicated interface without compromising any PlayMaker features. It also means direct access by other standard behaviors and scripts, so it's very verstalie and I think inline with how Unity intend developers to use gameobject's components.

 If arrays where implemented from scratch, then it would be a different story I suppose, but if you look at Unity default management of arrays in the inspector... it's very poor, and I actually think that ArrayMaker is very useful even outside PlayMaker environment. When you start dealing with arrays and lists in general, you open a very broad range of needs that can only be answered with a generic approach, which means a lot more work for the developer to implement an actual feature or function using arrays.

As for an easier way to include ArrayMaker in PlayMaker, I am planning on the following for next year (hopefully): I want to hit the asset store with a general data manager for PlayMaker, with the following trick: actions and updates would be made online ( as well as regular updates on the asset store of course), but the good thing is that I think it would be a good starting point to offer an stable and reliable way of managing data within PlayMaker projects as well as allowing the developer to pick what she/he wants from this system and just the specific actions would be downloaded, with notifications of updates, and automatic synchronisation with the project. In effect this would also be something to host all the custom actions eventually, where when you search for an action, it would also look in a database online and give you a choice of actions that you might not yet have on your project, and it would download it directly, ready for you to use it. This would include all the work I did so far on ArrayMaker, XmlMaker, CSV to XML, DataMaker and ParseMaker and few other real cool goodies that are cooking but not yet yet shared with you yet.


bye,

 Jean
 

tester:

--- Quote from: kiriri on November 24, 2012, 05:09:43 AM ---actually I think that's a bad idea (sorry :I ).
There are quite a bunch of important things which still need to be added to Playmaker. So I think it would be just a waste of time and already limited resources to spend time on something superficial. I do agree that some kind of integration would be great, but it should be done much later imo.
Additionally Jean's ArrayMaker really is splendid, it works very well for all purposes and makes it easy to see what's happening in game. I've used it a lot of times and whatever you call inconvenient, it is not :D (well at least not in my opinion). The proxy components are in and of themselves each a new "array-variable" and the reference is their name (Metaphorically speaking).
I do agree though that perhaps arrayMaker should be in the main build.

best,
kiriri

--- End quote ---



There are so many things that are hard to do.
For example:
- get all game objects with name "A" and store it in array.    (you may say modify the find game object with array proxy support)
- move/scale all array game object by 10 pixel  (you may say modify all transform to support array proxy)
- an array contain a number of hash tables (you may say modify "array add" with array proxy support)
- and more..


which you are basically tell me to modify all actions within playmaker to support array, if it is what you called as "convenient".



If author is so busy on other stuff. I wish author will just release the editor source in the next release, so maybe we can code for array natively in our own build instead.

kiriri:
no, the great thing about playMaker is that most actions more or less equal a certain function in a real script.

So all those things are already quite easy to do, like for the move scale you go through all the items in your list and do the transform on each every gameObject. It's how you'd do it in code so if there was an action, it would be nothing more than this all put into one action:

(I'll be using the most basic actions only, there are some like "list get next" which make it shorter)
1) Create a state where you use the "list count" action to get the total number of things. Int add -1 to get the last index(because indices actually use 0 as the first number).
2) create the "get" state. Use a new variable called "current index" which is an int and by default 0. compare if the current index is greater than the max index. If it is, exit that state into an empty one, if it's not, just do nothing. Now use a "list get" action to get the gameObject on your current index. Translate that gameObject by whatever. Then add 1 to the current index variable and either send an event or use the FINISHED event and connect it to itself (loop it).

This simple setup makes you loop through your array in a breeze and would work almost exactly like a script would. There are no functions tailored for arrays, so it's obvious that there don't really need to be any actions for this, although writing some actions is certainly time efficient in the long run.

As for your other things:
- You would never ever try to get all gameObjects of a certain name. Even looking for one gameObject of a certain name is suicide in any larger project because it actually does what we just did when we transformed everything in the array: it loops through each and every object and comparres its' name with the name you look for.

-an array that contains a number of hashtables would certainly be nice. It's also called a nested array/list. I personally do this by creating an empty, adding a proxy component and then adding that to the main array as many times as I need to. Later, I get the gameObject at a certain index, and then use get/set etc on the proxy component of that empty. It's working quite well actually.

If you think you could implement it then just contact Alex Chouls via the forums or mail, perhaps he'll let you help him, who knows :)

Navigation

[0] Message Index

[#] Next page

Go to full version