Problem with activating and deactivating groups

Options
treynterrio
treynterrio Member Posts: 64 Member

Hi there, this is my Code: on "on note" I allow and disallow the groups to be active in the on ui_control I mute a group and "active" volume up a group. My problem is when I click the first group and then the second and the third and I want to active the first group again there is no sound and on the second one is no sound as well even the main group (0) is deactivated does anyone have a idea where the problem is? When I delete the "on note" part it works but the over groups are still active then and everything sounds weird. Thanks!


on note

disallow_group($ALL_GROUPS)
allow_group(0)
allow_group(6)

if ($group1 = 1)
disallow_group(0)
allow_group(1)
allow_group(6)
end if

if ($group2 = 1)
disallow_group(1)
disallow_group(3)
disallow_group(4)
disallow_group(5)
allow_group(2)
allow_group(6)
end if

if ($group3 = 1)
disallow_group(1)
disallow_group(2)
disallow_group(4)
disallow_group(5)
allow_group(3)
allow_group(6)
end if

if ($group4 = 1)
disallow_group(1)
disallow_group(2)
disallow_group(3)
disallow_group(5)
allow_group(4)
allow_group(6)
end if

if ($group5 = 1)
disallow_group(1)
disallow_group(2)
disallow_group(3)
disallow_group(4)
allow_group(5)
allow_group(6)
end if

end on

on ui_control($group1)
if ($group1 = 1)
$i := 0
while ($i < num_elements(%buttonIds))
set_control_par(%buttonIds[$i], $CONTROL_PAR_VALUE, 0)
inc($i)
end while
$group1 := 1
end if
if ($group1_enabled = 0)
set_engine_par($ENGINE_PAR_VOLUME, 630000, 1, -1, 0)
set_engine_par($ENGINE_PAR_VOLUME, 0, 0, -1, 0)
$group1_enabled := 1
disallow_group($ALL_GROUPS)
allow_group(0)
allow_group(6)
else
set_engine_par($ENGINE_PAR_VOLUME, 630000, 0, -1, 0)
set_engine_par($ENGINE_PAR_VOLUME, 0, 1, -1, 0)
$group1_enabled := 0
end if
end on

on ui_control($group2)
...
end on

on ui_control($group3)
...
end on

on ui_control($group4)
...
end on

on ui_control($group5)
...
end on
Back To Top