Playmaker Forum
PlayMaker News => User Showcase => Topic started by: terrymorgan on June 22, 2012, 11:38:23 AM
-
Not exactly a 'showcase' but Mike Talbot has a Serializer for Unity (saves games) and also for
Playmaker FSM's
http://whydoidoit.com/unity-serializer-v0-2/
Playmaker support is in the Add-ons. I've only looked at his video so far.
-
wow it's even free! not to say that there's anything wrong with playMaker's internal save actions :D But this somehow looks like less work all in all.
-
Thanks for posting this here :)
At the moment I haven't written any playMaker custom actions to actually perform the save (just the code to actually do the saving and loading of the variables and the state) - I'd be happy to add actions too if people thought it would be useful.
-
Would be really interested in an action for this
-
I have added custom actions and an example scene to the PlayMaker Add On package on my website. This allows the storage and resumption of checkpoints and also the ability to build a complete save game/load menu system. A simple example is available in a demo scene inside the add on package on my website. http://whydoidoit.com/unity-serializer-v0-2/
-
If anyone could help me in any way getting these to work? Ive stored all my FSM's and i have a load and save actions. but the screen just goes white when i try a load. and the project starts spawning empty game objects.
The save game action requires a name and the load game requires a number, that confused me a bit.
Anyway, any help would be super awesome and already a big thanks for the actions!
-
okay i got a little further but its not properly storing my fsm's and when i load, object that i had hidden appear, should i only be storing certain things? urggh sorry :(
-
What do you need it not to store? Did you have a chance to follow the Getting Started guide?
As mentioned on my blog this has far less testing than other parts of Unity Serializer - I have successfully stored and loaded NoExit and a couple of other scenes that I have,
-
If you are just wanting a single load and save you should use Checkpoint and Resume.
The example scene shows how to use the number to get at the slots that are filled every time you call SaveGame. Slot 0 is always the most recent saved game. Will be adding more documentation.
Things that are hidden should have a Store Information script on them (if they aren't already a Prefab (with Prefab Identifier added).
-
yeah its for a tamagotchi type game and my fsm's are pritty complicated, first i stored everything, and when i load the slot the game loads with my tamagotchi already dead in a bath tub with lots of other things that aren't supposed to show no matter where i save it. what do i have to do to prefabs? i only have 1 or two but do i have to assign anything to them? i tried the checkpoint approach initally but does that save even when the game closes and opens again?
i have read all your documentation btw but because im not a coder some of it isnt relative to what is required when saving playmaker projects. sorry for being such a noob.
-
You have to have Prefab Identifiers on Prefabs (and store information scripts on their children that need saving).
I'd be happy to take a look at your project if you like - there could well be problems and it would help everyone if we can sort them out. PM me and I can give you an FTP site to upload the project to if you like.
-
I have some screen shots of the load save and the objects stored.
if that doesnt tell you whats wrong then your plan sounds good haha :)
thankyou :)
(http://i47.tinypic.com/2eunyqe.jpg)
(http://i46.tinypic.com/kbybq.jpg)
-
Any game with a prefab called poop is alright with me. It will probably be easier just to look at the project. I can do that later today.
Will PM you FTP details.
-
I tried to run this using the pdf and the video, on my hack of the unity FPS tutorial. the save game manager was missing 'test serialization.cs' and
pause menu.cs
testserialization.cs and pause menu.cs was in /scripts once I did that, dragged them
onto the save game manager in the inspector, I could get some info showing in the
hierarchy. Not sure whether the barrel was a prefab or a 'store information' figured it
was a prefab but it had a smoketrail child and 'props and children' had 'store information' decided barrels should be prefab, the smoke trails had 'store information' after I did that.
Robot I put as a prefab. Try it here:
http://terrymorgan.net/dungeon_fps_exe.zip
18mb
-
Hi Mike, I just installed the package from the Asset Store, then installed the Playmaker package from your website. I then loaded the Example scene and play tested. When I click the save button, I get this message:
Failed to serialize status of Capsule with error System.NullReferenceException: Object reference not set to an instance of an object
at LevelSerializer.<SerializeLevel>m__8A (UnityEngine.Component c) [0x00000] in C:\Users\Amanda\My Files\My Game Projects\Pixel Pygmies\Development\Eden\Assets\Plugins\whydoidoit.com\Serialization\LevelSerializer.cs:779
at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[UnityEngine.Component,System.String].MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateDistinctIterator>c__Iterator3`1[System.String].MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.ToDictionary[String,String,Boolean] (IEnumerable`1 source, System.Func`2 keySelector, System.Func`2 elementSelector, IEqualityComparer`1 comparer) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.ToDictionary[String,String,Boolean] (IEnumerable`1 source, System.Func`2 keySelector, System.Func`2 elementSelector) [0x00000] in <filename unknown>:0
at LevelSerializer.<SerializeLevel>m__79 (UnityEngine.GameObject n) [0x00000] in C:\Users\Amanda\My Files\My Game Projects\Pixel Pygmies\Development\Eden\Assets\Plugins\whydoidoit.com\Serialization\LevelSerializer.cs:776
UnityEngine.Debug:LogWarning(Object)
LevelSerializer:<SerializeLevel>m__79(GameObject) (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:797)
System.Linq.Enumerable:ToList(IEnumerable`1)
LevelSerializer:SerializeLevel(Boolean, String) (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:756)
LevelSerializer:SerializeLevel(Boolean) (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:671)
LevelSerializer:CreateSaveEntry(String, Boolean) (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:294)
LevelSerializer:PerformSave(String, Boolean) (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:468)
LevelSerializer:SaveGame(String, Boolean, Action`2) (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:460)
LevelSerializer:SaveGame(String) (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:436)
TestSerialization:OnGUI() (at Assets/UnitySerializer/Scripts/TestSerialization.cs:22)
Any idea about what went wrong? After this happened, I re-imported PlayMaker and UnitySerializer. Retested. Same problem. Restarted machine for kicks. Retested. Same problem.
-
Mike answered my question on the forum here
http://whydoidoit.com
-
@amaranth: I made a copy of my playmaker working directory, imported the FSM serializer, the main serializer (generic) updated it to 1.43 of playmaker, I could save the example scene where the colored cubes are falling.