string and uuid compatibility
complete
Wulfie Reanimator
In LSL/Mono the following script is valid: (Note that I'm passing a string where
key
is expected, and a key where string
is expected.)string str = "28c5efb6-fcaa-4ed5-9cf1-a640d1a99272";
key uuid = "28c5efb6-fcaa-4ed5-9cf1-a640d1a99272";
llInstantMessage(str, uuid);
However, in Lua the following script isn't valid:
local str = "28c5efb6-fcaa-4ed5-9cf1-a640d1a99272"
local key = uuid(str)
ll.InstantMessage(str, key)
-- lua_script:3: invalid argument #2 to 'InstantMessage' (string expected, got uuid)
-- [C] function InstantMessage
It's valid to pass a string where
uuid
is expected, but not the other way around.Log In
H
Harold Linden
complete
WolfGang Senizen
Todays release
Luau 2025-03-18.13925620430
Seems to have added some of this but caused some... problems with general string coersionH
Harold Linden
WolfGang Senizen:
The general coercion details were addressed addressed in that thread, looks like the
UUID
-> string
is handled though, thanks for sending this in!Signal Linden
planned
Thanks for the reminder on this quirk! We're implementing it because it's trivial and maps to how people currently use
ll*()
functions, but do you will have to do explicit casts for your own functions that expect strings.