You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Love this library! Integrating it into my game for in-game books & dialog!
As the title says, function return values don't seem to work. Take this example from the Ink docs:
Monsieur Fogg was looking {describe_health(45)}.
=== function describe_health(x) ===
{
- x == 100:
~ return "spritely"
- x > 75:
~ return "chipper"
- x > 45:
~ return "somewhat flagging"
- else:
~ return "despondent"
}
When run inside narrator, ~ return "despondent" (and others) compile to incorrect Lua code. It would generator an error along the lines of: narrator/libs/lume.lua:674: [string "return nil "despondent""]:1: '<eof>' expected near '"despondent"'.
It's not a showstopper for me, I prefer writing any functions in Lua and binding them, I'd prefer to keep the ink as free from any sort of code as possible. But it would be a nice to have. :) I didn't see this in the "known issues" tags, so I'm sorry if this already known! And hopefully it's not too niche.
The text was updated successfully, but these errors were encountered:
Thanks for the report, looks like a bug. Using bindings in this case will be the right decision, as local functions may not be as well tested in production I guess (at least I personally haven't used them yet).
I don't have high hopes that @abadonna will join in solving this problem since he's already created his own library, but if he suddenly gets bored and has nothing to do then I will welcome any ideas and suggestions 🙋♂️.
Otherwise, of course, I'll see what's going wrong here over some afternoon tea 🫖🌙.
Hi! Love this library! Integrating it into my game for in-game books & dialog!
As the title says, function return values don't seem to work. Take this example from the Ink docs:
When run inside narrator,
~ return "despondent"
(and others) compile to incorrect Lua code. It would generator an error along the lines of:narrator/libs/lume.lua:674: [string "return nil "despondent""]:1: '<eof>' expected near '"despondent"'
.It's not a showstopper for me, I prefer writing any functions in Lua and binding them, I'd prefer to keep the ink as free from any sort of code as possible. But it would be a nice to have. :) I didn't see this in the "known issues" tags, so I'm sorry if this already known! And hopefully it's not too niche.
The text was updated successfully, but these errors were encountered: