Excluding certain groups from randomized group play with code

dassoop
dassoop Member Posts: 1 Newcomer
edited September 10 in Scripting Workshop

Is it possible to include/exclude groups from the Random group play option with code? I have tried using allow() and disallow() groups. This only mutes them, leaving an empty slot in the randomized play cycle. I want to disable it completely so the pattern is not broken.

If that's note possible, can you create/remove the groups in code?

Comments

  • Kaiwan_NI
    Kaiwan_NI Administrator Posts: 2,821 admin

    Hi @EvilDragon would you be able to help @dassoop out with this issue?

  • theodorech
    theodorech Member Posts: 68 Member

    You’d want to turn off the group start option and handle the group order through scripting instead. There are a bunch of ways to do this, but the simplest method is to create an array with all the groups you want to cycle through. Then, use disallow and allow_groups to trigger the groups you need.

    Quick example:


    on init
    define RR_NUM:= 4
    declare rr_groups[]:= (0, 2, 4, 6)
    end on on note
    disallow_group(ALL_GROUPS)
    allow_group(rr_groups[random(0, RR_NUM)])
    end on

Back To Top