Some questions.

Announcements, support questions, and discussion for Save System for Opsive Character Controllers.
Al.Bundy
Posts: 8
Joined: Sat Dec 07, 2019 5:32 pm

Some questions.

Post by Al.Bundy »

Hi,

Is it possible to Save Empty object with a playmaker scripte attached to it between a scene portal ?


I don't want to save anywhere in the game, only with ckeckpoint. How can I desactive the save button in the test menu ?

Thank you.
User avatar
Tony Li
Posts: 22886
Joined: Thu Jul 18, 2013 1:27 pm

Re: Some questions.

Post by Tony Li »

Hi,
Al.Bundy wrote: Sun Dec 08, 2019 7:24 amIs it possible to Save Empty object with a playmaker script attached to it between a scene portal ?
Yes. I'm not sure what you want to save with the PlayMaker script. But you can write a Saver script to save and restore your FSM's state, similar to this thread on the PlayMaker forum. There is a basic Saver starter template script in Plugins/Pixel Crushers/Common/Templates/Scripts.
Al.Bundy wrote: Sun Dec 08, 2019 7:24 amI don't want to save anywhere in the game, only with checkpoint. How can I desactive the save button in the test menu ?
The test menu is originally designed for testing, not for production use. But if you want to use it, you can edit the script and comment out the part that draws the save button.
Al.Bundy
Posts: 8
Joined: Sat Dec 07, 2019 5:32 pm

Re: Some questions.

Post by Al.Bundy »

Thank you for the fast response.

The fact is I'm not very good at coding that why I'm using playmaker, so all of this is complicated for me.

I find the SaverTemplate but i'ts written in it : Then fill in your code where indicated below.
I'm not sure what I have to put in there.
User avatar
Tony Li
Posts: 22886
Joined: Thu Jul 18, 2013 1:27 pm

Re: Some questions.

Post by Tony Li »

In that case I recommend setting a Dialogue System variable using the PlayMaker action Dialogue System > Set Variable. Dialogue System variables are automatically included in saved games.

When the FSM starts (e.g., when loading a saved game), use the Dialogue System > Get Variable action to check the value of the variable and transition to the correct start.

For example, say you have a werewolf character. It has an FSM with 2 states: Man and Wolf. When the character turns into a wolf, the FSM transitions to the Wolf state. When the character turns into a man, the FSM transitions into the Man state.

In the Man state, use a Set Variable action to set a Dialogue System variable named "werewolf" to "Man".

In the Wolf state, use a Set Variable action to set a Dialogue System variable named "werewolf" to "Wolf".

Add a transition that uses Dialogue System > Get Variable to checks the value of the Dialogue System variable "werewolf". If it is "Man", transition to the Man state. If it is "Wolf", transition to the Wolf state.

This way you don't have to save the FSM itself in saved games.
Al.Bundy
Posts: 8
Joined: Sat Dec 07, 2019 5:32 pm

Re: Some questions.

Post by Al.Bundy »

That look good, I also think of using the global variable anyway I will try that.
thank you.
User avatar
Tony Li
Posts: 22886
Joined: Thu Jul 18, 2013 1:27 pm

Re: Some questions.

Post by Tony Li »

Sorry, I forgot this was in the Save System for Opsive Controllers section and not the Dialogue System section. Yes, if you're not going to write a custom Saver script, then you'll need to use a global variable or a GameObject or component unless you're using the Dialogue System.

For example, you can add an empty GameObject to the scene with two child GameObjects and Wolf and Man. When the player is a wolf, activate the Wolf GameObject. When the player is a man, activate Man. Put two Active Savers on the parent GameObjects, and assign Wolf and Man.

When your FSM starts (e.g., after loading a saved game), you can check which GameObject is active, Wolf or Man.
Al.Bundy
Posts: 8
Joined: Sat Dec 07, 2019 5:32 pm

Re: Some questions.

Post by Al.Bundy »

Ok that look good, i'm going to leave you a good comment ;)
User avatar
Tony Li
Posts: 22886
Joined: Thu Jul 18, 2013 1:27 pm

Re: Some questions.

Post by Tony Li »

Thanks! Glad to help. If any other questions come up, just let me know.
Al.Bundy
Posts: 8
Joined: Sat Dec 07, 2019 5:32 pm

Re: Some questions.

Post by Al.Bundy »

Well is the global variable is saved ?
First I think yes but now I have a doubt.
User avatar
Tony Li
Posts: 22886
Joined: Thu Jul 18, 2013 1:27 pm

Re: Some questions.

Post by Tony Li »

The Save System doesn't save PlayMaker global variables by default, but I just wrote a saver for it:

PixelCrushersSaveSystem_PlayMakerGlobalVarsSaver_2019-12-14.unitypackage

Import this package and add it to your Save System GameObject. It will save PlayMaker global variables.
Post Reply