Some questions.
Some questions.
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.
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.
Re: Some questions.
Hi,
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.
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.
Re: Some questions.
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.
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.
Re: Some questions.
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.
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.
Re: Some questions.
That look good, I also think of using the global variable anyway I will try that.
thank you.
thank you.
Re: Some questions.
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.
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.
Re: Some questions.
Ok that look good, i'm going to leave you a good comment 

Re: Some questions.
Thanks! Glad to help. If any other questions come up, just let me know.
Re: Some questions.
Well is the global variable is saved ?
First I think yes but now I have a doubt.
First I think yes but now I have a doubt.
Re: Some questions.
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.
PixelCrushersSaveSystem_PlayMakerGlobalVarsSaver_2019-12-14.unitypackage
Import this package and add it to your Save System GameObject. It will save PlayMaker global variables.