Custom Lua Function replaces decimal separator with a comma

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Nonungus
Posts: 4
Joined: Thu Feb 09, 2023 9:04 pm

Custom Lua Function replaces decimal separator with a comma

Post 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 299 times
FadeExample2.png
FadeExample2.png (2.24 KiB) Viewed 299 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.
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom Lua Function replaces decimal separator with a comma

Post 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.
Nonungus
Posts: 4
Joined: Thu Feb 09, 2023 9:04 pm

Re: Custom Lua Function replaces decimal separator with a comma

Post 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
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom Lua Function replaces decimal separator with a comma

Post by Tony Li »

Glad to help!
Post Reply