• Register
  • Help
Results 1 to 2 of 2

Topic: Script Editor/Compiler version 1.1

  1. #1

    Script Editor/Compiler version 1.1

    Hi everyone,
    The new 1.1 version of my free script editor/compiler is now available for both Mac and PC. Thanks to Frank van Gompel for kindly helping out with porting it to OSX. While it is of course possible to use this program like a normal text editor for Kontakt scripts, those who use its compiler part may be interested in these syntax extensions:

    family - organize your variables into logical groups:
    on init
    ``family settings
    ````declare x
    ````declare y
    ``end family
    ``settings.x := 10
    ``settings.y := 40
    end on
    import - split up large scripts into multiple files and factor out reusable functions to make scripts more comprehensible. Functions named "on_init" are treated a little differently - variables declared inside them are implicitly global so that they can be used by other functions in the same module (normally variables declared in functions are implicitly local). This sample shows how the first function module is imported into the main script:
    { Contents of file "crossfade.txt": }
    function on_init``
    ``declare old_id
    end function

    function crossfade_to_note(new_id)``
    ``fade_out(old_id, 100000, 1)
    ``fade_in (new_id, 100000)
    ``old_id := new_id
    end function

    { Contents of file "myscript.txt": }
    import "crossfade.txt"

    on note
    end on
    namespaces - it's also possible (and advicable) to import functions into a namespace of your choice. In this case the main script might look something like:
    { Contents of file "myscript.txt": }
    import "crossfade.txt" as cf

    on note
    end on
    Nils L

  2. #2
    Moderator/Developer Brian2112's Avatar
    Join Date
    Nov 2003
    Out of my Mind

    Thumbs up Re: Script Editor/Compiler version 1.1

    Well Done Nils!

    Your editor makes it so much easier to program scripts (plus it saves a lot of time and code)

    Also, those who are familiar with other programming languages have an easier time adjusting to the KSP syntax.

    Thanks so much! Great work!

    "So what if some parts of life are a crap shoot? Get out there and shoot the crap." -- Neil Peart
    Hint:1.6180339887498948482 Φ

Go Back to forum


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts