sound question

Gurtag

Active member
hey guys, is there a way to play a sound/sample on specific select.txt file? cant find anything on the manual aside from music command, but if i declare it 2 times, one for the music and one for the sound, it only executes one and the otter gets ignored, plus scipt dont work on select.txt am i right?
 
IT is possible to play a sound when tyoure in select screen, i have sample that plays on title screen :
Make updated.c and copy this  inside: ( updated.c should be in scripts folder)
Code:
void main(){
    void counter= getlocalvar("counter");  // Set a variable to trigger the spawn on and off
if(openborvariant("in_menuscreen")) // Check if the game is in menu screen
  {    counter = setlocalvar("counter",0);
	

 }
if((openborvariant("in_titlescreen")) &&(counter!=1)) // Check the variable to avoid double spawn
		{	
  
int SFX1 = loadsample("data/sounds/heros.wav");


			counter = setlocalvar("counter",1); // turn on the variable, blocking a new spawn to be made
playsample(SFX1, 0, 120, 120, 100, 0);

}
}
as you see it says "in menuscreen"
change that to "one of those :

Code:
**"in_cheat_options", - detects cheat options
**"in_control_options", - detects control options
**"in_gameoverscreen", - detects GAME OVER screen
**"in_halloffamescreen", detects HALL OF FAME screen
**"in_level", Whether you are in a level (e.g., select screen is not a level).
**"in_load_game", - detects LOAD GAME screen
**"in_menuscreen", - detects MENU screen
**"in_new_game", - detects NEW GAME screen
**"in_options", - detects OPTIONS screen
**"in_selectscreen", detects CHARACTER SELECT screen
**"in_showcomplete", detects COMPLETE SCREEN screen
**"in_sound_options", detects SOUND OPTIONS screen
**"in_start_game", detects GAME OVER screen
**"in_system_options", detects START GAME option
**"in_titlescreen", detects TITLE screen (the one with PRESS START)
**"in_enginecreditsscreen",


and change path  to your sound.

int SFX1 = loadsample("data/sounds/heros.wav");


 
thanks a lot mate, though that means the sound would play on all select.txt right? i mean i want x.wav to play on select1.txt, z.wav to play on select2.txt etc.
 
Back
Top Bottom