Problems with saved strings

Stefan Scholl 4 years ago updated by Lazlo Bonin (Lead Developer) 4 years ago 7

Bolt 1.2.3 - Unity 2017.3.1p3 - Windows 10

Saved Variables Initial:

(TestString was type String but loses the type after loading the project again.)

Saved Variables Saved:

When I hit Play I get this (Saved Variables Saved):

Value of TestString is gone. The Integer variable TestNumber2 after it has the initial state.

Exception in the Console:

ArgumentNullException: Value cannot be null.
Parameter name: type
Ludiq.EnsureThat.IsNotNull[Type] (System.Type value) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Ensure/EnsureThat.Objects.cs:16)
Ludiq.ConversionUtility.GetRequiredConversion (System.Object value, System.Type type) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:363)
Ludiq.ConversionUtility.CanConvert (System.Object value, System.Type type, Boolean guaranteed) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:205)
Ludiq.ConversionUtility.IsConvertibleTo (System.Object source, System.Type type, Boolean guaranteed) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:262)
Bolt.SavedVariables.MergeInitialAndSavedDeclarations ()
Bolt.SavedVariables.OnEnterPlayMode ()

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):
Pending Review

Thanks for the report, I'll look into it.

Does this happen all the time or did it only happen once?

Is this the first time you've seen this issue or have you been able to reproduce it on different projects?

Happened in my current project. Trying to read game state directly from a script using the Bolt API. No problem saving it via the API.

Then I reproduced it in a new testing project just for this. Screenshots from this test project. Variables written directly in the Variables inspector. No scripts involved in this project.


Ah, I think I see what might be happening here. I'll try to fix it for v.1.3.

In the mean time, you can give you string an empty value in the initial tab and it should be fix it. To do "empty" and not "null", switch to string type, type one character, then delete it. I believe it should workaround the issue for now.

Workaround fixed the problem. Thank you.

Fixed in Beta

Will be fixed in v.1.3.0b4+.