Page 1 of 1

Custom Lua Function replaces decimal separator with a comma

Posted: Fri Nov 03, 2023 7:00 pm
by Nonungus
Hi. Hope you're having a nice week.

I've been working in my Unity game using this beautiful asset. Works great but the only problem I found recently is that when inputting a Custom Lua Function in the Script field that has a double parameter, when setting a decimal value, it will end up with the decimal separator as a comma, which doesn't work because I guess it takes the two numbers as separate parameters, triggering this error:
Dialogue System: Lua code 'Fade(1, 0,5)' threw exception 'Number of parameters specified does not match the expected number.'
In this case I have a custom script that fades the screen, first value is the target fade and second value is the duration of the fade. If I want the duration to be 0.5 for example, when added it will replace the "." with a ",".
FadeExample1.png
FadeExample1.png (5.62 KiB) Viewed 300 times
FadeExample2.png
FadeExample2.png (2.24 KiB) Viewed 300 times
Tried with 0.5, 0,5, 0.5f and 0,5f just to check if I was doing something wrong but it still ends up as 0,5 so I have to manually correct it. Do you know why is this happening or is it because it's just the way it is?

Thanks in advance. Love this asset.

Re: Custom Lua Function replaces decimal separator with a comma

Posted: Fri Nov 03, 2023 8:52 pm
by Tony Li
Hi,

What is your operating system's language set to? I'm guessing that your system language uses "," for the decimal separator.

Please try this patch:

DS_LuaWizardPatch_2023-11-03.unitypackage

It should always use "." for decimal separators in the Lua wizards.

Re: Custom Lua Function replaces decimal separator with a comma

Posted: Fri Nov 03, 2023 8:58 pm
by Nonungus
Wow, I didn't even think about that. Yeah, my OS is set to Spanish so it makes sense that it replaces it with a ","
Thanks a lot for the patch, works perfectly! :D

Re: Custom Lua Function replaces decimal separator with a comma

Posted: Fri Nov 03, 2023 9:11 pm
by Tony Li
Glad to help!