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

Zone volumes are not editable due to scripting. Add another script to enable this?

Discussion in 'Scripting Workshop' started by RiffWraith, Mar 15, 2015.

  1. RiffWraith

    RiffWraith NI Product Owner

    Messages:
    383
    Hi :)

    So, a commercial lib which shall remain nameless (at least publicly) has for one reason or another disabled the ability for the end user to change the volume of the zones. Is there a way for me to add a script to an available tab which will enable this - theoretically without screwing with the script already in place?

    Thanks in advance.
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    It's not really "disabled". It's a byproduct of using change_vol() in the script. You can't really influence that... Unless you add your own change_vol() command when particular group(s)/key(s)/velocity(ies) are played, with relative bit set to 1 in a script slot AFTER the last script used by the product. It won't work before a script slot, has to be the last in the chain. Tricky business.
     
  3. RiffWraith

    RiffWraith NI Product Owner

    Messages:
    383
    Thanks for the response. :)

    Well, there is an empty tab, and it's the last tab avail, so this script would in fact be AFTER the last script used by the product. So that works.

    Looking at the KSP manual, I find:

    Code:
    on note
    $vol amount := (($EVENT VELOCITY -1) * 12000/126) -6000
    change vol ($EVENT ID,$vol amount,1)
    Am I barking up the right tree here? I would still have to define the groups tho, no?
     
  4. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    That's the way it's supposed to be done. But of course if you need to fix the tuning of only particular zones in particular groups, you will have to detect which group/s is/are played by the current event (there's an array variable for that, use search() to find the groups you need), and of course match the key/vel range, too.