Wanting Kontakt to recognize script.lua in Resources directory
Hey!
So, I notice that when I repack a Resource Container it only reconizes scripts in the Resources folder IF they have a .txt extension. This is unfortunate, as I name them .lua so that Sublime will highlight the syntax correctly.
I know I can cut & paste the code into Kontakt's script editor, but I'd really rather avoid that. And I really don't want to code in Kontakt.
Is there a place to send "feature requests"???
Thanks for your thoughts, Patrick
Comments
-
it seems you are confusing things
scripts in /Resources/scripts should be vanilla ksp only and named with extension .txt
if you need syntax highlight you can use Sublime Text or VS Code and both of them have decent syntax highlighting for ksp code even if the file has a txt extension, in which case you would probably have to manually set the language syntax highlighting.
Lua scripts are meant to be used with Creator Tools or Kontakt 7 depending the API you are using, they are not meant to be packed in the nkr file.
-1 -
For anyone with the same question, Gablux is completely wrong. Also, look for the free KSP Sublime addon, which doesn't solve the issue, but has handy macros for coding using the preprocessor.
Native Instruments, if you are listening, LUA scripts should end in .lua, not .txt. Please fix this.-2 -
Gabriel is absolutely right. It’s always better to double-check information than to criticize his response as poorly made. Kontakt only reads scripts written in KSP, saved as .txt files in the Resources folder. On the other hand, Lua scripts with a .lua extension are only used in Creator Tools, a companion app by NI for Kontakt and the Kontakt 7 API, just like Gabriel mentioned.
If you’re hoping the KSP Sublime syntax add-on will fix your Lua script, you might want to rephrase your question or look up some info online about .lua, .ksp, and .txt script files. :) Cheers!0 -
No need, again, you have no clue. Kontakt reads a file, and the limitation is that it cares that it ends in .txt, it could care less what's in that file, WHICH is Lua based code. My issue is that NI has incorrectly limited it to this arbitrary file extension. But, I waste my time. It really doesn't matter as frankly I just automated it to do what I need anyway.
But NI, if you are listening, you need to remove this lame limitation, and let the editor load any filename.0 -
That's correct; you can include any content in a .txt file, but to give it a functional role in Kontakt, you'll need to use KSP to make it readable. Could you briefly explain what you're aiming to achieve by loading a .txt file in the script editor using Lua instead of KSP? I think we're all interested to hear more about it.
0 -
Finally figured out the correct way to do things. The problem is that using a .txt extension is a non-standard use of .txt, which is meant to signify that a file is a plain text file. Those extensions are properly used by computer systems to identify the application that will open a file by default, and in code editor's cases, which syntax highlighting & code completion to use.
After much research, I have concluded that the ideal way to code with such an external editor, such as Sublime is to code in a file with a .ksp extension, and then using a #pragma to compile to a .txt file, which Kontakt will then recognize in the Resources/scripts folder, allowing you to link from that file. That option will be greyed out until and unless there is a .txt file in the directory, and only permit you to link to a .txt file.
Originally, I wasn't interested in compiling to another file, and so would have appreciated the ability to link to the .ksp file. However, once you begin to use the more advanced add-on syntax provided by SublimeKSP add-on, this works just as automatically. But still, if given the option, I would prefer to have my source .ksp file somewhere outside the instrument structure, and then use #pragma to more correctly compile to a .ksp file, so that I can easily double click on it to open it in Sublime (or XCode, etc.) with the appropriate syntax checking etc. in place. A .txt file is not appropriate, and a poor design choice for standard practices.
But, at least I can work with it now.
0
Categories
- All Categories
- 19 Welcome
- 1.4K Hangout
- 60 NI News
- 735 Tech Talks
- 3.9K Native Access
- 15.9K Komplete
- 1.9K Komplete General
- 4.2K Komplete Kontrol
- 5.5K Kontakt
- 1.5K Reaktor
- 365 Battery 4
- 817 Guitar Rig & FX
- 417 Massive X & Synths
- 1.2K Other Software & Hardware
- 5.5K Maschine
- 7K Traktor
- 7K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators