Panning Groups Dynamically

Discussion in 'Scripting Workshop' started by stevemazzaro, Jul 29, 2021.

  1. stevemazzaro

    stevemazzaro New Member

    Messages:
    18
    I have 8 groups set in a round robin (using KSP). To do this, I'm using disallow_group($ALL_GROUPS), random a number, and set that group enabled.

    I'd like to add a button called "triple" that plays two additional round robins, which I have working fine, but I'd love to pan the other 2 hard left and right (and then back to center on the next keypress). Is there a way to do this in ksp?
     
  2. EvilDragon

    EvilDragon Moderator Moderator

    Messages:
    19,513
    Yes, there's change_pan() command. See example in KSP reference.
     
  3. stevemazzaro

    stevemazzaro New Member

    Messages:
    18
    Does that mean the $ID_NUMBER (param 0) can be a group id?
     
  4. EvilDragon

    EvilDragon Moderator Moderator

    Messages:
    19,513
    No, that's an event ID. You can use set_event_par_arr() to disallow/allow groups per event (example is also in KSP reference).
     
  5. stevemazzaro

    stevemazzaro New Member

    Messages:
    18
    Hmm, I'm not entirely sure I'm understanding what you mean. What I'm looking for is to pan the 2nd and 3rd group separately (so the first group is centered, 2nd hard left and 3rd hard right) when only pressing one note. The change_pan() only seems to change the panning of the event ID which changes the panning of all groups currently playing.
     
  6. EvilDragon

    EvilDragon Moderator Moderator

    Messages:
    19,513
    That's what I'm saying, you need to create two additional events (via play_note()) and point them to your second and third groups then change the panning.
     
  7. stevemazzaro

    stevemazzaro New Member

    Messages:
    18
    Ah ha! I had no idea you could do that...

    Thank you, sir!