playMaker

Author Topic: Help: ArrayMaker process.  (Read 2403 times)

neowings

  • Playmaker Newbie
  • *
  • Posts: 25
Help: ArrayMaker process.
« on: April 27, 2014, 12:28:56 AM »
Hi.

I'm trying to save many int variables in one string, and this string
variable will use on Google Play Cloud Save data.

Array Maker is hard to understand for me although I checked and studied
via sample files.

I made test scene contains 2 buttons which add numbers when click
buttons, and the numbers store in integer variable.
(as you see attached image files.: sample_1.jpg)

Questions are:

1. What should I choose between 'ArrayList' and 'HeshTable'?
If it doesn't matter, what is the best for group of int variables?

2. How I start and process for sending from int info to List or Table?
and what 'Actions' should I use?
(I already added script on the GameObject. see sample_2.jpg
from attached file.)

3. Which Sample scene is good for me. / Or is there any tutorial
web pages about Array Maker?

I wish the video tutorial about Array Maker is on YouTube...

Thank you.
« Last Edit: April 27, 2014, 12:34:00 AM by neowings »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Help: ArrayMaker process.
« Reply #1 on: April 28, 2014, 06:25:16 AM »
Hi,

Tricky situation here. It's feasible but not sure this is the best way really, as I don't really have a serialization system for Arrays to become strings ( and back to an array) easily.

what I would experiment with is "easy save" add on to arrayMaker, it allows you to save in the playerprefs as a key, since the player prefs are strings, then you could simply use that content as is and send it to google. with easySave addon, you can seave an array with one action, so it will be easier for you then trying to do that manually.

 Doing it manually will mean you have ti iterate trhough all the array and build a string from it, and when you get the string from google, then trouble starts... because you have to split the string, and populate back an array. If you are new with all this, I would not recommand this as a first exercice really.



-- I think arrayList will be fine for your case, but if you use hashtable then you can express each int with a key, which is more meaningfull.


Bye,

 Jean

neowings

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Help: ArrayMaker process.
« Reply #2 on: May 02, 2014, 04:05:46 AM »

Hi Jean.

If the ArrayMaker is not sure about saving and distributing integers in one string, I have another way that using 'Binary Formatter' on the script, just incase.
Here is the link telling about Save multiple info in one string, as you know.

http://unitygems.com/saving-data-1-remember-me/

Sending a integer is not problem. Just I use 'Send Message' action with int parameter, (see 1_Send-int.jpg) and it stores in the script. (see 2_Send_Receive int.jpg)

Wondering part is distributing integers to FSM after load state.

Once int or other parameters gone to script with 'Send Message' action,
what action should I use to receive parameter or variables from the script?
I used 'Call Method' action, but I don't think that is right way.
(see 3_Receive int.jpg)

Thank you.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Help: ArrayMaker process.
« Reply #3 on: May 06, 2014, 07:06:45 AM »
Hi,

 that unitygem link doesn't work for me, it's odd, can you double check the site is actually up?

bye,

 Jean