LUA script: Global table 'Kontakt' is empty (nil value)

cinephos
cinephos Member Posts: 9 Member
edited March 27 in Scripting Workshop

1st attempt to work with Visual Studio and Kontakt LUA scripts.

I managed to launch Kontakt 8 from VS Run Task(*) and then I run the first lua script from the LUA API tutorial.

As you can see in the screenshot below, the 'Hello World" command is printed.

Yet, the Kontakt global object is empty.

This means that API falied to load the table?

What did I do wrong? Or what else do I need to do?

(*) In tasks.json, I replaced all instances of "Kontakt 7" with "Kontakt 8". I have KONTAKT 8 but not KONTAKT 7. I also enabled 'Developer Features" from Kontakt Options. I suppose that so far, I made no mistake.

Tagged:

Comments

  • cinephos
    cinephos Member Posts: 9 Member
    edited March 27

    II have already post a question here which received no answer. I expand the question now.

    LUA scripts that produce result on the "Rack area" can be run from KONTAKT (by F11).

    Same scripts fail on Creator tools as well as the VS code environment (previous post below).

    The problem is the same: Global tables Filesystem and Kontakt remain empty, nil, do not receive data from Kontakt.

    Any ideas what causes the problem on my system?

  • PoorFellow
    PoorFellow Moderator Posts: 6,209 mod

    Please do NOT open duplicate discussions on same topic ! Your duplicate thread has been merged here.

    If need be then 'bump' the thread by adding an update as done here.

    You can check lesson 10 here to see if there is something to pick up that will help you.

    You can also try joining the KSP Discord server and ask there , though you most likely are required to work hard yourself before asking for handouts : Please see Additional resources here.

    Community Code of Conduct - Please read before posting : Keep It Tidy .Don’t cross-post the same thing in multiple topics.

  • cinephos
    cinephos Member Posts: 9 Member
    edited March 29

    Thanks for the advice of joining the discord server.

    Thanks for the hint not to repeat a question twice, but at least my action brought a reaction and a possible second step.

    Your line "you most likely are required to work hard yourself before asking for handouts" is poor and uneducational advice. I consider it an insult.

    You do not know who I am, what is my life experience as a computer engineer, and how far I have come before addressing the forum. The fact that I am a Kontakt user since 2012 should give you a hint.

    I want to work with Kontakt Lua as in the videos I see, and this is not possible. If you do not have an answer, stop altering the focus of my request. Help me do my job without insulting me.

  • cinephos
    cinephos Member Posts: 9 Member
    edited March 29

    Solved!

    Lua / Api scripts DO NOT WORK on VS and do not work with Creator tools on Windows 11 system.

    After a little help from Discord servers, I discovered that they only work on Sublime Text only.

    CONSOLE Reporting works only with Sublime Text. Not VS or Creator Tools. Therefore a LUA script may run with F11 from Kontakt, may also run with Ctrl+B from Sublime Text, but it's execution stops with error when run from Creator tools or VS.

    Is this a bug?

    Is it a 'known issue'? It is not mentioned in Kontakt's release notes.

    Are they aware of the problem?

    NI are going to correct the problem?

    Should they add a disclaimer to their manuals about it?

    Am I going to receive an answer other than a moderator's insult?

  • cinephos
    cinephos Member Posts: 9 Member
    edited March 30

    Finally I would like to point out that standalone Kontakt runs a lua script from a terminal (cmd.exe in Windows) but it does not open a terminal window as the manual says. Here is a command line example, be careful with the double quotes: each directory has its own, but the argument is a single string:

    c:\"Program Files"\"Native Instruments"\"Kontakt 8"\"Kontakt 8.exe" "C:\Users\my home directory\Where I keep LUA API tutorial examples\Tutorial 01 - Hello World.lua"
    

    A different lua script as "Tutorial 08 - KSP.lua" produces the exected result in KOntakt's instrument rack, but still no terminal window.

    Finally I would like to point out a broken link in NI's relevant reference manual:

    https://native-instruments.com/ni-tech-manuals/kontakt-api-reference-manual/en/introduction-and-setup

     Operating System Facilities link should be corrected to https://www.lua.org/manual/5.4/manual.html#6.9 (this .html is missing)

    I hope that someone from NI reads the post and schedule a task in their "to do" list.

  • PoorFellow
    PoorFellow Moderator Posts: 6,209 mod
    edited March 30

    Your line "you most likely are required to work hard yourself before asking for handouts" is poor and uneducational advice. I consider it an insult.

    You do not know who I am, what is my life experience as a computer engineer, and how far I have come before addressing the forum. The fact that I am a Kontakt user since 2012 should give you a hint.

    I want to work with Kontakt Lua as in the videos I see, and this is not possible. If you do not have an answer, stop altering the focus of my request. Help me do my job without insulting me.

    No insult were meant , I were merely referring to that generally then people with a lot of knowledge on topics , in this case Kontakt scripting, most likely do not have the time to answer questions on the most basic so that people are required to do the basic groundwork themselves. My advice were a general observation and advice meant in kind (as introduction to the use of the Discord server) where that you take the advice and twist it into something that it was never meant to be and then you top it off demanding an apology.

    Am I going to receive an answer other than a moderator's insult?

    You were pointed to the Discord server by me because it appeared that you were not going to get the response that you wanted in the forum. I pointed you to the Discord server.

    I would appreciate if you could please stop twisting the meaning of my advice (which obviously makes it impossible to try to assist you). You might be an engineer but that does not give you the right to take out your annoyance and dissatisfaction with LUA on me.

  • cinephos
    cinephos Member Posts: 9 Member

    Thank you. You suggested the discord servers. I should have mentioned this clearly earlier.

    Case, closed. Now I have to wait for NI to address the issue, as it seems that it is a known issue although not mentioned in Release notes. I'll come back to this message when the problem is finally solved and the post has no reason to exist.

Back To Top