EvilDragon
KSP Wizard
You use .and., not .or.. This will test all bits for equality, then you need to query if that result is the same to the state of your current filter. To get the state of your current filter based on buttons that represent them:
To query a bunch of soundsources for their attributes and fill an array with results:
Code:
current_filter := 0
for i := 0 to NUM_TAGS - 1
current_filter := current_filter + (sh_left(1, i) * BrowserButtonIDs[i] -> value)
end for
To query a bunch of soundsources for their attributes and fill an array with results:
Code:
num_results := 0
array.fill(filtered_results, -1) // just a quick function that runs a loop throughout the whole array (first arg) and fills it with a specified number (second arg)
for i := 0 to num_elements(sound_bitmasks) - 1 // sound_bitmasks would be the array that contains integers that pose as bitmasks for the attributes you want
if sound_bitmasks[i] # 0
if (sound_bitmasks[i] .and. current_filter = current_filter
filtered_results[num_results] := i
inc(num_results)
end if
else
i := num_elements(sound_bitmasks) // break loop
end if
end for