[PLAYMAKER] Possible to save an array made of game objects?

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
Miguelfanclub
Posts: 10
Joined: Fri May 04, 2018 2:25 pm

[PLAYMAKER] Possible to save an array made of game objects?

Post by Miguelfanclub »

An en example of how to save multiple variables from a gameobject in an array would be also great.
All the playmaker examples are saving 1 variable.

Can i save several types in the same file? how to access them later on? Loading with tag?

thanks
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: [PLAYMAKER] Possible to save an array made of game objec

Post by Joel »

Hi there,

It's not possible to save an array of GameObjects in Easy Save 2. However, you can create arrays of supported properties and save them.

For example, if you wanted to save and load the position of lots of GameObjects, you would put their positions into a PlayMaker array (see PlayMaker's docs for more information on using their array functionality), and save this using the Save Vector 3 Array action.

You could then load this array using the Load Vector 3 Array action, iterate over it, and assign the positions back to each GameObject.

Alternatively you might find it easier to add an FSM to each GameObject and get them each to save to a different tag in the file.

Just to clarify, tags allow you to save multiple things to the same file. If you specify two different tags but use the same filename, they will both be saved to the file separately. If you specify the same tag, one will overwrite the other.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Locked