inkle / ink-unity-integration

Unity integration for the open source ink narrative scripting language.
http://www.inklestudios.com/ink
Other
573 stars 100 forks source link

Ink Story converts floats based on user system regional settings #207

Open tarnos12 opened 5 days ago

tarnos12 commented 5 days ago

I have a problem with Unity reading 0.234 as 0,234 when I parse a tag

This can be fixed by changing system regional format to USA(so it uses a dot instead of a comma)

Problem is that this does not save when the game is compiled, so other users will experience issues if their regional format is not set to something that uses dot for a float.

Is there something that I might need to change in Unity or ink compiler/config?

"audioambient:asset\'ambient_sanctuary_deep\',volume\'0,15\',loop\'0\'"

This is the tag from story.CurrentTags where volume is 0,15 instead of 0.15 which is based on my regional settings.

tomkail commented 2 days ago

Hi! This definitely sounds like a problem. Can you move this ticket to the ink discord? This is for the Unity plugin.

On Sat, Sep 28, 2024 at 15:56 Mariusz Klimek @.***> wrote:

I have a problem with Unity reading 0.234 as 0,234 when I parse a tag

This can be fixed by changing system regional format to USA(so it uses a dot instead of a comma)

Problem is that this does not save when the game is compiled, so other users will experience issues if their regional format is not set to something that uses dot for a float.

Is there something that I might need to change in Unity or ink compiler/config?

"audioambient:asset\'ambient_sanctuary_deep\',volume\'0,15\',loop\'0\'"

This is the tag from story.CurrentTags where volume is 0,15 instead of 0.15 which is based on my regional settings.

— Reply to this email directly, view it on GitHub https://github.com/inkle/ink-unity-integration/issues/207, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJR3UGVP7UICEM427MCHRLZY27TTAVCNFSM6AAAAABPAWEDEKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU2TIMRYGY4TQNI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

tarnos12 commented 2 days ago

Hey, I thought it might be related to Unity plugin. The issue happens after the game is compiled, so the plugin is the one reading the json and converting it into readable format?

story.CurrentTags gives me values with a comma(or a dot based on my system settings)

tomkail commented 2 days ago

Ah I see. The plugin makes use of the runtime and the compiler, but isn’t where that code is developed. This plugin is more about the auto compilation and unity editor tools.

On Tue, Oct 1, 2024 at 07:21 Mariusz Klimek @.***> wrote:

Hey, I thought it might be related to Unity plugin. The issue happens after the game is compiled, so the plugin is the one reading the json and converting it into readable format?

story.CurrentTags gives me values with a comma(or a dot based on my system settings)

— Reply to this email directly, view it on GitHub https://github.com/inkle/ink-unity-integration/issues/207#issuecomment-2384895469, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJR3UCJN3JJAYQQVN4PA5TZZI5PJAVCNFSM6AAAAABPAWEDEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBUHA4TKNBWHE . You are receiving this because you commented.Message ID: @.***>

tarnos12 commented 2 days ago

Sorry for the confusion. Do you know specific channel to ask this question on the discord? I found Unity integration, but that's the same as this. Inky-engine-dev perhaps?

tomkail commented 2 days ago

Yes that would be right! Or just the ink channel. Tag Joe humphfey in it, he’s the lead dev

On Tue, Oct 1, 2024 at 18:32 Mariusz Klimek @.***> wrote:

Sorry for the confusion. Do you know specific channel to ask this question on the discord? I found Unity integration, but that's the same as this. Inky-engine-dev perhaps?

— Reply to this email directly, view it on GitHub https://github.com/inkle/ink-unity-integration/issues/207#issuecomment-2386578086, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJR3UEJSEDD4EFTU4MJ6K3ZZLMBRAVCNFSM6AAAAABPAWEDEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBWGU3TQMBYGY . You are receiving this because you commented.Message ID: @.***>

tarnos12 commented 2 days ago

Thanks, I have done what you said. We have figured out that the issue happens with inky variables converting floats without Invariant Culture. Probably with .toString()

This issue can be closed.