1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Solved SUPER SIMPLE ISSUE

Discussion in 'Scripting Workshop' started by KirkHunter, Jul 30, 2019.

  1. KirkHunter

    KirkHunter NI Product Owner

    Messages:
    41
    Why doesn't the message() not work when loading an instrument? For example, in the REALLY simple script:

    on init
    make_perfview
    message("TALK TO ME")
    end on

    The message DOES display upon first editing the script. Then when the instrument is saved, closed and then re-loaded, NO MESSAGE appears. Why?
     
  2. franto

    franto NI Product Owner

    Messages:
    43
    Hmm, I can reproduce it. I would expect the message displayed. After loading and click on Restart or Apply, the message appears.

    It's strange, when I add some UI there, UI is created on reloading, so on init callback is executed.
     
  3. KirkHunter

    KirkHunter NI Product Owner

    Messages:
    41
    Yes, when anything that triggers the on init callback AFTER the instrument is loaded, the message is displayed. But on the initial load of the instrument, the message does NOT appear. STRANGE, and unexpected.
     
  4. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    This seems to have been in Kontakt forever, so I wouldn't expect it changed. It works fine if you print something on an ui_label, though... (Which is something I think you should do, rather than abusing the message line like many other libraries do - which is not nice IMHO.)
     
  5. KirkHunter

    KirkHunter NI Product Owner

    Messages:
    41
    Right. I only use the message line while programming. Sometimes, I like to do a "hard" launch of the instrument rather than simply re-applying the script to check to make sure that the on init stuff is really working.
     
  6. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    But reapplying the script is exactly the same thing as opening the NKI from scratch. Minus the samples loading, of course.
     
  7. KirkHunter

    KirkHunter NI Product Owner

    Messages:
    41
    Thanks, Evil. But then why does the message display when reapplying the script, but NOT when opening from scratch? Just a Kontakt thing, I suspect.
     
  8. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Yeah, Kontakt has its weird ways sometimes :)