Closed Mochnant closed 4 months ago
@Mochnant I'm curious about when an Author would need to be using or storing the value of Infinity in a Twine project?
I have found a use for it in a project I am working on, but I would prefer not to dive too deep into perceptions of the the best way to tackle any particular programming issue.
I've addressed the issue on my end, so this is not a critical issue (for me), but I maintain it would be useful for Sugarcube to behave the way it seems it should. Infinity in, Infinity out. I notice that json5 is already a dependency, so I am hopeful the fix would not be too difficult.
I notice that json5 is already a dependency, […]
Not for SugarCube it's not.
[…] so I am hopeful the fix would not be too difficult.
It will not be, no.
Apologies, I noticed it was installed when I built from source but that seems to be a node dependency of some sort.
Thanks for adding this to the todo list.
No problem. It's likely included by one or more of the development dependencies.
When a session is saved/restored (via a manual browser refresh, but this may also impact the default save/load system), Sugarcube variables that are set as Infinity are converted to null, likely due to the use of JSON.stringify();
There are various workarounds, but it would be useful to have native Infinity support.