"Ambient Sound Override" Test map
by demagogue (cade@trioptimum.com) 
13 Dec 2015

Files:

- new location_settings.script, goes inside tdm_base01.pk4\script\
- new misc.def (with location_settings def), goes inside tdm_defs01.pk4\def\
- A test map, override.map

(Needless to say, you may want to make backups of the original
location_settings.script & misc.def before replacing them.)

-------------------------------------------------------------------------------

The Test map includes:

2 rooms each with their own location ambients (snd_alpha, snd_beta) that play on entry as usual

10 buttons x2 (the same set for each room) that setKey the location_settings "override" property to various keys. 

The buttons are arranged like this (from door to outside):

------------------------------------------------------------------------
     '(1)override off'  '(2)override on (silence)'    	'(9)no override fade (blasts in)'  
D					     		'(10)normal override fade'
O    '(3)override gamma' '(5)override alpha'
O    '(4)override delta' '(6)override beta'
R
     '(7)override null' '(8)override silence' 
-------------------------------------------------------------------------

Here's what's actually being setkey'd for each button:

1. '0'. The starting default. Turns override off and current location ambient plays.
2. '1'. Turns override on and turns off location ambient (techincally plays '1' ambient, but since it doesn't exist, it plays silence).
3. 'snd_gamma'. Turns override on, turns off location ambient, plays snd_gamma ambient.
4. 'snd_delta'. Turns override on, turns off location ambient, plays snd_delta ambient.
5. 'snd_alpha'. Override on, and plays the same ambient as room-1, for testing overlapping ambients. 
6. 'snd_beta'. Override on, and plays the same ambient as room-2, for testing overlapping ambients.  
7. ''. This is just a test to make sure that playing a null entry ambient doesn't crash it. It doesn't.
	But in testing, "" was making it play a previous ambient, so I made "" register as "snd_silence" to override. So only "0" turns override off.
8. 'snd_silence'. Turns override on, turns off location ambient, plays snd_silence ambient (silence).
9. [many setkeys to fade values, no-fade]. Turns fading off for the override so so it blasts right in. 
10. [many setkeys to fade values, "-1"]. The value "-1" reverts fading to default values to make it simple, i.e., a 4 second transition fade.

---------------------------------------------------------------------------------

When you run the system, have the console open and it sys.prints the transitions:
- When location changes
- When a location ambient starts playing
- When an override ambient starts playing (including silence or any other non-zero variable which plays silence, effectively turning the speaker off)

These also sys.print to the console, but should be commented out for the final version to prevent console spam.
- When override is invoked (including when it's switched from one override ambient to another)
- When override is turned off

---------------------------------------------------------------------------------

The three things you can do with the system is: 
(1) Run around in your favorite FM to see that the location ambients still work as usual.
(2) Play around in the Test Map, pushing buttons and walking between rooms any way you like, 
    checking that the right ambient plays in the right way at all times. 
(3) Make your own map in DR with overrides to see how to make the system work. 

I've tested this a lot myself and nothing's broke in this version yet. 

I'm releasing this test-map as a way for others to verify for themselves that the system works (and how it works).
I encourage people to try any crazy thing to see if it ever breaks. 
And it's also for mappers to understand the setup to make it easy for them to use in their own FMs. 
They can just open it up in DR and copy exactly what they see.
I'll also explain it all on the "Location Settings" wiki page.  


