Sound control script (first version!)
Similar to light control script in operation:
Attach to zone or entities (make them always active), name determines functionality.
First part of name identifies the control entities(s)
Second part determines how the control functions (defaults to 'Loop')
Third part determines the player distance at which the sound control occurs
Fourth part is the minimum volume (i.e. volume of sound at the trigger point)
Fifth part is the maximum volume (i.e. the volume at origin of zone or entity)
So as an example 'Clock_Loop_1000_60_99' would start looping the sound sample (only slot 0 at present) at 1000 units from a control entity at '60' volume (on my machine anything lees is virtually silent anyhow) and will gradually increase the volume the closer you get until you are at the entity position in which case it will be playing at 99.
If you give 2 or more entities the same name then the distance is calculated (with some 'Funky math') to a line drawn between the two closet ones to the player. (so place a bunch of entities at intervals down say a river bed, name them all 'River_Loop' and attach a running water sound to them all, simples)
If you use 'Play' the same applies except the sound slot 0 will only play each time you enter the specified range.
If you use 'PlayZone' or 'LoopZone' then the sound control will only occur when the player is within range and in the zone(s).
Added 'Periodic' and 'PeriodicRandom'.
Also added multiple sound slots.
So for example 'Radiation1_PeriodicRandom_1000_99_99_5_20_2000' means play one of the five slots at maximum volume with a periodicy of a minimum of 20 ms and maximum of 2000ms and a randomness added.
Added 'Random' which simply plays one of the attached sounds at a specified random interval.
So for example 'Birds_Random_3000_70_99_5_2000_10000' means when player within 3000 units play one of the 5 soundslots with a minimum interval of 2000 (i.e. 2 seconds) and maximum of 10000 (i.e. 10 seconds) with a minimum volume of 70 and maximum of 99 (depending on distance).
Phew.
Been there, done that, got all the T-Shirts!