playMaker

Author Topic: arraymaker examples  (Read 5203 times)

Sjones

  • Full Member
  • ***
  • Posts: 203
arraymaker examples
« on: September 22, 2012, 04:43:05 PM »
with the release of the inventory examples I took a further look into arraymaker and its other example and have a couple of questions.

First question I think is a more generic playmaker question but have never seen it before your example, in your examples you have multiple "start/listening" states, in the inventory example this is the blank start state, inventory / item picked and inventory check out item, they seem to listen for events such as the scene pick action from somewhere else in the game.
how do you set these up? as in all examples so far have only had the start state in.

second question, could this be used for a save game system? add a do not destroy on level load (I think is the way to keep it) then get the properties from this and set them on level load? is this a bad idea for performance and instead look at/use something like unityserialisation to save any game data?

I am still trying to get to grips with arraymaker and when trying to use the "hash table tests" level, if you delete the hash table when there isnt one already existing there is an error given stating "hashtable proxy reference do not match" pressing the un-pause button in unity sends it to the hashtable not found state as expected. not sure if the error is supposed to occure and in a built game would simply continue?


along with the above I am still trying to figure out array lists and hash tables, as such I have a question regarding hash tables.
How much are they like a spreadsheet table? do they have multiple columns for each key and a row per key? if so is there a way to get all values in a specific column and do math on them like sum of or average etc? or is this what a database is for and instead hash tables just list values one after each other for each object. (look at screenshots for example)

and along with the question above, is it possible to have multiple of the same type of data, say 4 lots of positional data per key? if so, how do I access a specific one out of the 4?

sorry for the long post and many question, I am starting to struggle with this aspect of unity/playmaker/game creation.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: arraymaker examples
« Reply #1 on: September 24, 2012, 03:03:11 AM »
Hi,

1: Some Fsms do not need to do anything when they start, they are only reacting on global events ( defined as global transition in black above a state).
 
 to make this clear, I simply put a SPACE or "idle" as the start state name.

Is that your question? else can you make a screenshot of what you would like to implement?

2: It can indeed be used to save game states DURING RUNTIME. If the user is quiting the app, then it won't persist. For this you would need to use playerprefs or some serialization system that you can save and retrieve from as your player comes back to your app.

3: Yes, I do that in purpose to test that indeed it fires an error, this is for testing, so you also need to make sure it fires errors when it must.

4:  Spreadsheets  ( .csv) are not hasthables. This is two different concept all together. I do plan on supporting spreadsheet, and I do have working code for this

Code: [Select]
http://hutonggames.com/playmakerforum/index.php?topic=891.msg3876#msg3876
pm me if you are interested in getting this feature developed to be usable in your application.

ArrayMaker is not a database, totally not. It is simply to wrap arrays and hashtables to be available within playmaker. Database is a totally different fields.

 Having said that, I do use arrayMaker to retrieves resulsts from a database query. I do this by defining as much arrayList as there are columns ( one arrayList per column), and inject the result in each one of them. I then simply access the value I need based on the row index and the column name ( giving me a pointer to the arrayList holding this column set of value).

You can't have multiply data per item. instead, do as I mention aboved, have one arrayList or hashtable per type of data you want for a given key. That works very well


If you need a working sample ( try first tho, best way to learn is to try and do it :) ), I'll provide you with something to get you started.

Bye,

 Jean