If you use the
ambience action without setting the rgb colors nothing will happen.
The script should look like this:
;Artificial Intelligence Script
;Header
desc = set ambience to 5
;Triggers
:state=0:state=1
:state=1:ambience=5,ambiencered=255,ambiencegreen=255,ambienceblue=255
;End of Script
Some weeks ago i made fun script for testlevels.
If you add it to a dynamic entity and go close to it you'll be able to change the ambience by using the page up and page down keys in 10 steps between 0 and 50. (script starts with ambience 25 as default):
;Artificial Intelligence Script
;script by ctm
;Header
desc = change ambience with pageup, pagedn keys
;Triggers
:state=0:localvar=1,setvar=25,state=1
:state=1:localvar=1
:state=1,varequal=0:ambience=0,ambiencered=255,ambiencegreen=255,ambienceblue=255,state=2
:state=1,varequal=5:ambience=5,ambiencered=255,ambiencegreen=255,ambienceblue=255,state=2
:state=1,varequal=10:ambience=10,ambiencered=255,ambiencegreen=255,ambienceblue=255,state=2
:state=1,varequal=15:ambience=15,ambiencered=255,ambiencegreen=255,ambienceblue=255,state=2
:state=1,varequal=20:ambience=20,ambiencered=255,ambiencegreen=255,ambienceblue=255,state=2
:state=1,varequal=25:ambience=25,ambiencered=255,ambiencegreen=255,ambienceblue=255,state=2
:state=1,varequal=30:ambience=30,ambiencered=255,ambiencegreen=255,ambienceblue=255,state=2
:state=1,varequal=35:ambience=35,ambiencered=255,ambiencegreen=255,ambienceblue=255,state=2
:state=1,varequal=40:ambience=40,ambiencered=255,ambiencegreen=255,ambienceblue=255,state=2
:state=1,varequal=45:ambience=45,ambiencered=255,ambiencegreen=255,ambienceblue=255,state=2
:state=1,varequal=50:ambience=50,ambiencered=255,ambiencegreen=255,ambienceblue=255,state=2
:state=2,plrdistwithin=100,scancodekeypressed=201:state=10
:state=2,plrdistwithin=100,scancodekeypressed=209:state=20
:state=10,scancodekeypressed=0:state=11
:state=11:localvar=1,state=12
:state=12,varless=50:incvar=5,state=1
:state=12,vargreater=45:state=2
:state=20,scancodekeypressed=0:state=21
:state=21:localvar=1,state=22
:state=22,vargreater=0:decvar=5,state=1
:state=22,varless=5:state=2
;End of Script
And the same script with rawtext that tells you the current ambience level (requires fpsc v. 1.16):
;Artificial Intelligence Script
;script by ctm
;Header
desc = change ambience with pageup, pagedn keys
;Triggers
:state=0:localvar=1,setvar=25,state=1
:state=1:fpgcrawtextsize=16,fpgcrawtextfont=verdana
:state=1:fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255
:state=1:fpgcrawtextx=50,fpgcrawtexty=5
:state=1:state=2
:state=2:localvar=1
:state=2,varequal=0:ambience=0,ambiencered=255,ambiencegreen=255,ambienceblue=255,fpgcrawtext=ambience = 0,state=3
:state=2,varequal=5:ambience=5,ambiencered=255,ambiencegreen=255,ambienceblue=255,fpgcrawtext=ambience = 5,state=3
:state=2,varequal=10:ambience=10,ambiencered=255,ambiencegreen=255,ambienceblue=255,fpgcrawtext=ambience = 10,state=3
:state=2,varequal=15:ambience=15,ambiencered=255,ambiencegreen=255,ambienceblue=255,fpgcrawtext=ambience = 15,state=3
:state=2,varequal=20:ambience=20,ambiencered=255,ambiencegreen=255,ambienceblue=255,fpgcrawtext=ambience = 20,state=3
:state=2,varequal=25:ambience=25,ambiencered=255,ambiencegreen=255,ambienceblue=255,fpgcrawtext=ambience = 25,state=3
:state=2,varequal=30:ambience=30,ambiencered=255,ambiencegreen=255,ambienceblue=255,fpgcrawtext=ambience = 30,state=3
:state=2,varequal=35:ambience=35,ambiencered=255,ambiencegreen=255,ambienceblue=255,fpgcrawtext=ambience = 35,state=3
:state=2,varequal=40:ambience=40,ambiencered=255,ambiencegreen=255,ambienceblue=255,fpgcrawtext=ambience = 40,state=3
:state=2,varequal=45:ambience=45,ambiencered=255,ambiencegreen=255,ambienceblue=255,fpgcrawtext=ambience = 45,state=3
:state=2,varequal=50:ambience=50,ambiencered=255,ambiencegreen=255,ambienceblue=255,fpgcrawtext=ambience = 50,state=3
:state=3,plrdistwithin=100,scancodekeypressed=201:state=10
:state=3,plrdistwithin=100,scancodekeypressed=209:state=20
:state=10,scancodekeypressed=0:state=11
:state=11:localvar=1,state=12
:state=12,varless=50:incvar=5,state=1
:state=12,vargreater=45:state=3
:state=20,scancodekeypressed=0:state=21
:state=21:localvar=1,state=22
:state=22,vargreater=0:decvar=5,state=1
:state=22,varless=5:state=3
;End of Script
hope that helps