Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Float variables are printed with either comma or dot based on system regional settings #916

Open
tarnos12 opened this issue Oct 1, 2024 · 0 comments

Comments

@tarnos12
Copy link

tarnos12 commented Oct 1, 2024

Issue:
story.CurrentTags returns a tag with a float value either comma or dot separated (0,15 and 0.15)
"audioambient:asset\'ambient_sanctuary_deep\',volume\'0,15\',loop\'0\'"
or
"audioambient:asset\'ambient_sanctuary_deep\',volume\'0.15\',loop\'0\'"

Cause:
The reason is that those values are taken from a variable which seem to be converting floats based on system regional settings(No Invariant Culture is being used)
This makes tags inconsistent as this persist on a compiled game and happens both in inky editor, Unity engine or in a compiled game.

Test:
Regional Settings in Win11: Control Panel -> Region -> Format -> Switch between USA/Polish to see the difference.
You have to restart a compiled game or exit/enter playmode or restart ink editor with double arrow

Inky code:

VAR testFloat = 1
VAR constVal = 0.0001

Test {testFloat * constVal}

This will print 0.0001 or 0,0001 based on system region format in inky editor, unity playmode, compiled game.

Extra Context
We have had a short discussion on discord, but I tried to include most of it in this issue.
https://discord.com/channels/329929050866843648/471562851346153474/1290727976824209470

Might be related: #842
This reply has a code that seems to be converting floats with .ToString() #842 (comment)

I will test it if I can find that script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant