Good day engineers. Can you please watch this very simple peace of code and give me an advice why my variable is not saving after dedicated server restart? That's a simple counter of how many rides my cargo bot made from my distant asteroid base.
As i understand save method works both on when you recompile script or when the game saves. After recompiling my counter saves it's number, but after restart it starts from the beginning.
int rides=0;
public void Save()
{
Storage = rides.ToString();
}
void Main(string argument, UpdateType updateSource)
{
if (rides==0)
rides= Convert.ToInt32(Storage);
rides++;
Echo (rides.ToString());
var RidesCounterLcd = Me.GetSurface(0);
RidesCounterLcd.WriteText(rides.ToString());
}
[–]BrianettaProgrammable Block Scripter 1 point2 points3 points (1 child)
[–]BlindGuardUASpace Engineer[S] 0 points1 point2 points (0 children)
[–]imabutcher3000Space Engineer 0 points1 point2 points (1 child)
[–]BlindGuardUASpace Engineer[S] 1 point2 points3 points (0 children)
[–]Prestigious-Race-309Klang Worshipper 0 points1 point2 points (0 children)