Easy save wont ignore a value and sets it to empty instead

Discussion and help for Easy Save 3
Post Reply
JordanCW97
Posts: 12
Joined: Thu May 12, 2022 11:00 pm

Easy save wont ignore a value and sets it to empty instead

Post by JordanCW97 »

Hi there, I have a script that I will post below, I have an es3 type setup for each of the classes in it and the parent class itself and mostly it works fine however there are several ui fields in the class that are setup that I want es3 to ignore so I did not add them to the type however when using load or load into on this script it keeps setting the values to empty and overriding the default. I have tried using the es3 non serializable attribute but nothing works, how can I get it to stop touching these values and only amend the ones that are active in the es3 type.

Here is my class, the ones I am having issues with is everything inside the UI class, these values are all set inside the inspector and should never need to be saved or changed. Thanks.

public class Player_Stats : MonoBehaviour
{
public GameObject xpBar;
public Image mask;
public TextMeshProUGUI levelUi;

//Variables
//Player rank
public int playerRank = 1;
public float currentXp;
public float xpToRank = 250;
private float xpMultiplier = 1.2f;

[System.Serializable]
public class Reputation
{
public float millitaryRep;
public float runnerRep;
public float hollowedRep;
public bool hostileToAll;
}
public Reputation reputation;

[System.Serializable]
public class Skills
{
public List<Player_Skills> pSkills = new List<Player_Skills>();
public int availableSkillPoints;
[System.Serializable]
public class UI
{
public List<GameObject> skillAddIcons = new List<GameObject>();
public List<Image> skillFills = new List<Image>();
public TextMeshProUGUI skillPointsIndicator;
}
public UI uiElemts;
}
public Skills skills;
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Easy save wont ignore a value and sets it to empty instead

Post by Joel »

Hi there,

Please could you show the ES3Type file(s)? This can be found in Assets/Easy Save 3/Types/. Note that an ES3Type file will override any attributes.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
JordanCW97
Posts: 12
Joined: Thu May 12, 2022 11:00 pm

Re: Easy save wont ignore a value and sets it to empty instead

Post by JordanCW97 »

Hi there, thank you for getting back to me, I have attached two screenshots of the es3 type. I have the skills class inside the player stats class enabled and then inside the es3 type for skills I have ui elements un ticked.

Thanks

Jordan
Attachments
Screenshot 2022-08-10 102932.png
Screenshot 2022-08-10 102932.png (59.88 KiB) Viewed 1001 times
Screenshot 2022-08-10 102913.png
Screenshot 2022-08-10 102913.png (73.15 KiB) Viewed 1001 times
JordanCW97
Posts: 12
Joined: Thu May 12, 2022 11:00 pm

Re: Easy save wont ignore a value and sets it to empty instead

Post by JordanCW97 »

Just some further information, it seems like the ui elements data is not being saved in the save file at all so not sure why loadinto is then setting these ui elements to an empty value.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Easy save wont ignore a value and sets it to empty instead

Post by Joel »

Hi there,

If it's not in the save data then Easy Save won't touch the value upon loading. Can you replicate this in a new project with a new scene to isolate the issue to Easy Save?

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