playMaker

Author Topic: Questions about "ArrayMaker" - CheckPoint sample file  (Read 3760 times)

neowings

  • Playmaker Newbie
  • *
  • Posts: 25
Questions about "ArrayMaker" - CheckPoint sample file
« on: April 03, 2013, 12:51:47 AM »
Hi, Jean

The "CheckPoints" scene file really helped me a lot, not 100% understand though. :)
I played and stopped game, and play again... the player got position at last checkpoint!
That is what I want! :) Thank you!

and ... Questions! :)


1.
There is an Inspector called "Play Maker Array List Proxy(Scrip) from CheckPoint Manager GameObject. Prefill count is set 6 and each Item is set as CheckPoint+Num.
Does 'Item 5 = CheckPoint 6' tell FinalCheckPoint and does it make 'Reset Game'? (see image "arrayProxy.jpg")


2.
I'm wondering the Variable called "PlayerPref Last CheckPoint Key", and the var is setting as 'String'. That var is used as the 'Key' in "PlayerPrefs Get Int". Maybe this function can do SAVE the game status, but why the 'Key' is using 'String'? I know 'String' var is usually using for text, by the way, is the 'Key' somekind of "SAVE FILE"?


3.
'Array List Get' function in FSM looks connected with "Play Maker Array List Proxy
(Script)" Do I understand correctly? (see image "arrayProxy1.jpg")



4.
Finally, my game has many stage scene files, and I'm thinking creating CheckPoint manager GameObject in separate scene file (For example, stageManager or in SelectStage scene file.)
Is it possible 'global send event' can do communicate between different scene files?


5.
I searched 'PlayerPrefs' options from Unity Forum, and the document tells the savedata file is located is different from web, PC and Mac version each other. When I build my game for mobile devices (iOS and Android), do I have to concern about savedata file location?


Question is a lot, I will be very happy when I see your reply.
Thank you.


Lee


« Last Edit: April 03, 2013, 12:56:42 AM by neowings »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Questions about "ArrayMaker" - CheckPoint sample file
« Reply #1 on: April 03, 2013, 01:48:58 AM »
Hi,

 I am glad the sample was useful :)

1: no, the reset procedure only happens in the fsm "CheckPoints Manager" that is on the gameObject "-- CheckPoints Manager --". EveryTime a check point is passed, it triggers from the fsm "CheckPoint" attached to each "CheckPoint x" gameObject, the event "CHECK POING TRIGGER". That event is caught by "CheckPoints Manager, and there is detects if there is a win, and if the reset has to happen.

2: player prefs key can be any strings, so in your player preferences ( which is a regular text file). Let me actually tell you EXACTLY what's in there :)

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LastCheckPointIndex</key>
<integer>4</integer>
<key>UnityGraphicsQuality</key>
<integer>3</integer>
</dict>
</plist>

so you see that the Key "LastCheckPointIndex" can be any string ( more or less, try to keep it with letters on ly and avoid weird chars obviously)

and you can see that this player prefs is also used by Unity itself, SO be careful to always name your keys something quite unique, cause you may have other frameworks in your game that you installed and might ( very unlikely, but it's possible) clash with your own prefs if the keys are not unique enough.

so your key is not like saving file, it's more like representing a property that you defined.

3: yes this is the way it works. the arrayMaker actions works with the related proxies. So if you work with hashtable proxy, use the hashtable set of actions. Same with array

4: that's where creating unique and well defined keys will be important, because there is only one playerPref file, and so, you can't use the same key from one scene to the other. You will need something like "Level1LastCheckPointIndex", and then "Level2LastCheckPointIndex", and so forth.

5: Do not worry about that, Unity handle this very well for you. MOre infos on where exactly this pref file si stroe on the various systems:

http://docs.unity3d.com/Documentation/ScriptReference/PlayerPrefs.html

Bye,

 Jean



neowings

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Questions about "ArrayMaker" - CheckPoint sample file
« Reply #2 on: April 03, 2013, 04:11:48 AM »
Hello Jean,

Very Thank you for replying.


I notice "Int Add" action in 'Is it the last CheckPoint' State counts -1 every player passed new CheckPoint. That was why the state goes to 'Win' State.

Now what I have to do is getting start and test for it.
YOU ARE MY HERO, JEAN  ;D

Thank you very much!!!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Questions about "ArrayMaker" - CheckPoint sample file
« Reply #3 on: April 03, 2013, 05:59:01 AM »
 ;D

Study the other examples as well, just to get acquainted with what ArrayMaker can do, and also how generally things can be achieved in playmaker.

bye,

 Jean