Closed BoomDivX closed 2 years ago
Thanks for reporting. Since this is lua, have a look at its language documentation. I haven't looked into this in a while, but I assume that ||
is not valid and instead, you have to use or
.
This is another snippet from isp-atract.lua
from the piumk6
module/driver which actually uses the or
operator:
dest.digital[SCREEN_ATTRACT_DI_SELECT_NEXT] =
iop_input_state_is_pushed(IO_PIUMK6_DI_P1_RD, src, src_prev) or
iop_input_state_is_pushed(IO_PIUMK6_DI_P2_RD, src, src_prev)
So, in your case, I'd suggest the following:
dest.digital[SCREEN_ATTRACT_DI_SELECT_NEXT] =
op_input_state_is_pushed(IO_KEYBOARD_SDL2_DI_RIGHT, src, src_prev) or
iop_input_state_is_pushed(IO_KEYBOARD_SDL2_DI_UP, src, src_prev)
Indeed, it works perfectly with "or" instead of " ||". I did a pull request with the change in the readme file.
Summary
When the user adds a 2nd button for a function in isp-attract.lua or isp-operator.lua, SGL will crash on launch with the error "unexpected symbol near |"
Expected behavior
SGL should not crash and the 2nd button should do the same function as the 1st one.
Current behavior
SGL crashes on launch.
Detailed Description
When the user adds a 2nd button for a function in isp-attract.lua or isp-operator.lua, SGL will crash on launch with the error "unexpected symbol near |". Using version 1.03 (the one on GDrive).
Steps to reproduce
Context (Environment)
Windows 10
Log output
https://pastebin.com/f9vwZb8P
Configuration files
data\lua\io\keyboard\sdl2\isp-attract.lua https://pastebin.com/Agds2iTC
OS version
Windows 10 19042.1237