sed-based lsl-to-lua script converter
Tapple Gao
I've been evolving my lsl script conversion process for a few scripts now. My process looks like:
- Run the LSL script thru sed scripts 1-semicolens through 6-syntax
- Fix all reported syntax errors, type errors, and warnings generated by luau-lsp
- I now have a working script, but using llcompat. This
- Run the lua script thru sed script 7-index . This removes llcompat and autofixes some indexing
- Fix up the script to remove all uses of ll.SetTimerEvent and all off by one errors
- I now have a working script without llcompat
- Run the lua script thru sed script 8-semantics to get rid of some deprecated function warnings
Rough timeline
- I get my first working script with llcompat (step 3), after about 4 hours.
- I get my second working script without llcompat (step 6), after 1-4 days, depending on how much I abused timer and lists
Tools used:
- The above script converter
- vscode with luau-lsp plugin
- luau-lsp configured manually from https://github.com/secondlife/lsl-definitions/blob/main/generated/secondlife.d.luau
- luau-lsp has this custom patch applied: https://github.com/luau-lang/luau/pull/2184
Log In
Tapple Gao
Things I still want to improve in my converter:
- Add support for scripts with more than 1 state
- Automatically fix up more indexing errors. currently It only re-indexes for loops