Kev was talking about something different, if you want to trigger a p-switch effect from Lua code.SAJewers wrote:ping
Anyway, here you go.
- Update LuaScriptsLib\core\defines.lua from this version (will be included in future LunaLua updates)
- Unzip the pSwitchTicking library into LuaScriptsLib (will be included in future LunaLua updates)
- Put the line in the lunadll.lua or lunaworld.lua where you want it to apply. I assume probably lunaworld.lua for A2XT usage.
Code: Select all
loadSharedAPI("pSwitchTicking")
The defines.lua update contains that capability of applying an asm patch to disable normal SMBX p-switch music effects. The pSwitchTicking.lua API activates this, and then listens for "P Switch - Start" and "P Switch - End" SMBX events to trigger start/stop of an auto-looping sound)