Page 1 of 1

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

Posted: Tue Aug 09, 2022 7:42 pm
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;

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

Posted: Wed Aug 10, 2022 7:14 am
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

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

Posted: Wed Aug 10, 2022 9:30 am
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

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

Posted: Wed Aug 10, 2022 9:36 am
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.

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

Posted: Wed Aug 10, 2022 7:28 pm
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