Vo sound problem


(pigg221462) #1

my vo’s for my forward spawn are not working at all. I also have command post for each side the vo’s work kinda for them. the problem with the cp vo’s is as a axis player you construct the command post and the vo works but when a allied player comes into the game 10 min later he gets the vo that the axis have constructed a cp and vise versa how do i fix this please help this is my script below

//
//Brush Scripting
//Map: beachgoodcopy1
//Last edited by: =WF=Pigg
//

game_manager
{
spawn
{
// Set the respawn times

  wm_allied_respawntime 15 
  wm_axis_respawntime 20 
  wm_set_round_timelimit 20

  // Set the number of objectives for the map 

  wm_number_of_objectives 5

  // Axis control all objectives at the start (0 == AXIS, 1 == ALLIED)

            wm_objective_status 1 0 0 //blow the door              <objective team status>
	wm_objective_status 1 1 0 //                           status: 0 = default
	wm_objective_status 2 0 0 //capture the forward spawn          1 = succeeded
	wm_objective_status 2 1 0 //		                       2 = failed
	wm_objective_status 3 0 0 //blow stairwell door
	wm_objective_status 3 1 0
	wm_objective_status 4 0 0 //take the documents
	wm_objective_status 4 1 0
            wm_objective_status 5 0 0 //transmitte the document
	wm_objective_status 5 1 0

  // Set Defending Team for SW Mode 

  wm_set_defending_team 0 

  // If the round timer expires, the Axis have won, so set the current winning team 
  // Set the round winner: 0 == AXIS, 1 == ALLIED 
  wm_setwinner 0 

  // Accum #1 will be the state of objective number one 
  accum 1 set 0 
  // Accum #2 is set after either wall is breached, so that the sirens are set only once 
  accum 2 set 0

  wait 150

  setautospawn "Bunker"     0

  wait 350


}

trigger objective1
{
wm_objective_status 1 1 1
wm_objective_status 1 0 2
}

trigger objective3
{
wm_objective_status 3 1 1
wm_objective_status 3 0 2
}

trigger objective5
{
// Change the objective state internally, so UI can update, etc.
// Allied takes control of objective #5
wm_objective_status 5 1 1
wm_objective_status 5 0 2

  // Change the variable within the script so that we can check if someone wins the round 
  accum 1 set 1 

  // UI pop-up to alert players 
  wm_announce "Allies transmitted the documents!" 

  // Call function to check if the round has been won 
  trigger game_manager checkgame 

}

trigger axis_object_stolen
{
// Change the objective state internally, so UI can update, etc.
// Allied have stolen the documents (0 == AXIS, 1 == ALLIED)
wm_objective_status 4 1 1
wm_objective_status 4 0 2
setstate allied_gold_cm_marker invisible

  //turn on sirens 
  accum 2 abort_if_not_equal 0 
  alertentity siren_relay 
  accum 2 set 1 

}

trigger axis_object_returned
{
// Change the objective state internally, so UI can update, etc.
// Axis have returned the documents (0 == AXIS, 1 == ALLIED)
wm_objective_status 4 1 2
wm_objective_status 4 0 1

  wm_announce 0 "The Documents have been returned" 
  wm_announce 1 "The Documents have been returned" 
  setstate allied_gold_cm_marker default 

  //turn on sirens 
  accum 2 abort_if_not_equal 1 
  alertentity siren_relay 
  accum 2 set 0 

}

trigger checkgame
{
wm_setwinner 1
wait 200
wm_endround
}

trigger oldcity_flagblue
{
// Some kind of UI pop-up to alert players
wm_announce “Allies captured the Bunker!”

  wm_objective_status   2 1 1 
  wm_objective_status   2 0 2 
  //accum 1 set 0 

}

trigger oldcity_flagred
{
// Some kind of UI pop-up to alert players
wm_announce “Axis captured the Bunker!”

  wm_objective_status   2 1 2 
  wm_objective_status   2 0 1 
  accum 1 set 1 

}

}

// ===============================
// ========= main objective=======
//================================
allied_objectives
{
death
{
trigger game_manager objective5
wait 50
trigger game_manager checkgame
}
}

//=========================
//=====explosive stuff=====
//=========================
wall
{
spawn
{
wait 200
constructible_class 3
}

death
{
wm_announce “Allies have blown the wall to Shit they’re coming in!!”
}
}

door
{
spawn
{
wait 200
constructible_class 3
}

death
{
wm_announce “Allies have blown the door to hell!!”
trigger game_manager objective1
}
}

door2
{
spawn
{
wait 200
constructible_class 3
}

death
{
wm_announce “Allies have entered the Stairwell!!”
trigger game_manager objective3

}
}
//===========================
//===== command posts========
//===========================
axis_cp_open
{
spawn
{
wait 100
accum 0 set 0 // 0=CP Closed, 1=CP Damaged
constructible_class 2 // Dyno+Satchel

	trigger self disable_cp_features		// Default charge bar times
	setstate axis_cp_damaged invisible	// Hide damaged CP clipbrush+model
	setstate axis_cp_damaged_model invisible
}

trigger disable_cp_features
{
	setstate axis_cp_open_model invisible	// Hide Open CP model

	setchargetimefactor 0 soldier 1
	setchargetimefactor 0 lieutenant 1
	setchargetimefactor 0 medic 1
	setchargetimefactor 0 engineer 1
	setchargetimefactor 0 covertops 1

	sethqstatus 0 0			// Landmines team warning message
	disablespeaker axis_cp_sound		// Disable morse code sound
}

trigger enable_cp_features
{
	setstate axis_cp_open_model default	// Show open CP model

	setchargetimefactor 0 soldier 0.75
	setchargetimefactor 0 lieutenant 0.75
	setchargetimefactor 0 medic 0.75
	setchargetimefactor 0 engineer 0.75
	setchargetimefactor 0 covertops 0.75

	sethqstatus 0 1			// Landmines team warning message
	enablespeaker axis_cp_sound		// Enable morse code sound
}

buildstart final
{
	setstate axis_cp_closed invisible		// Hide closed CP clipbrush+model
	setstate axis_cp_closed_model invisible
	setstate axis_cp_damaged invisible	// Hide damaged CP clipbrush+model
	setstate axis_cp_damaged_model invisible
}

built final
{
	accum 0 set 1			// Only show the damaged CP model
	trigger self enable_cp_features		// Increase charge bar times

	wm_announce "Axis Command Post constructed. Charge speed increased!"
	// *----------------------------------- vo ------------------------------------------*
	wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"
	wm_teamvoiceannounce 0 "axis_hq_compost_constructed"

	wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"
	wm_addteamvoiceannounce 1 "allies_hq_compost_constructed_axis"
	// *----------------------------------- vo ------------------------------------------*
}

decayed final
{
	setstate axis_cp_open_model invisible	// Hide Open CP model
	trigger self show_damaged_cabinet	// Show previous cabinet state
	trigger self show_closed_cabinet
}

death
{
	trigger self show_damaged_cabinet	// Show damaged CP model
	trigger self disable_cp_features		// Default charge bar times

	wm_announce "Allied team has destroyed the Axis Command Post!"
	// *----------------------------------- vo ------------------------------------------*
	wm_teamvoiceannounce 0 "axis_hq_compost_damaged"
	wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

	wm_removeteamvoiceannounce 1 "allies_hq_compost_constructed_axis"
	// *----------------------------------- vo ------------------------------------------*
}

trigger show_closed_cabinet
{
	accum 0 abort_if_equal 1		// Closed cabinet active yet?
	setstate axis_cp_closed default
	setstate axis_cp_closed_model default
}

trigger show_damaged_cabinet
{
	accum 0 abort_if_equal 0		// Damaged cabinet active yet?
	setstate axis_cp_damaged default
	setstate axis_cp_damaged_model default
}

}
allied_cp_open
{
spawn
{
wait 100
accum 0 set 0 // 0=CP Closed, 1=CP Damaged
constructible_class 2 // Dyno+Satchel

	trigger self disable_cp_features		// Default charge bar times
	setstate allied_cp_damaged invisible	// Hide damaged CP clipbrush+model
	setstate allied_cp_damaged_model invisible
}

trigger disable_cp_features
{
	setstate allied_cp_open_model invisible	// Hide Open CP model

	setchargetimefactor 1 soldier 1
	setchargetimefactor 1 lieutenant 1
	setchargetimefactor 1 medic 1
	setchargetimefactor 1 engineer 1
	setchargetimefactor 1 covertops 1

	sethqstatus 1 0			// Landmines team warning message
	disablespeaker allied_cp_sound		// Disable morse code sound
}

trigger enable_cp_features
{
	setstate allied_cp_open_model default	// Show open CP model

	setchargetimefactor 1 soldier 0.75
	setchargetimefactor 1 lieutenant 0.75
	setchargetimefactor 1 medic 0.75
	setchargetimefactor 1 engineer 0.75
	setchargetimefactor 1 covertops 0.75

	sethqstatus 1 1			// Landmines team warning message
	enablespeaker allied_cp_sound		// Enable morse code sound
}

buildstart final
{
	setstate allied_cp_closed invisible		// Hide closed CP clipbrush+model
	setstate allied_cp_closed_model invisible
	setstate allied_cp_damaged invisible	// Hide damaged CP clipbrush+model
	setstate allied_cp_damaged_model invisible
}

built final
{
	accum 0 set 1			// Only show the damaged CP model
	trigger self enable_cp_features		// Increase charge bar times

	wm_announce "Allied Command Post constructed. Charge speed increased!"
	// *----------------------------------- vo ------------------------------------------*
	wm_removeteamvoiceannounce 1 "allies_hq_compost_construct"
	wm_teamvoiceannounce 1 "allies_hq_compost_constructed"

	wm_teamvoiceannounce 0 "axis_hq_compost_constructed_allies"
	wm_addteamvoiceannounce 0 "axis_hq_compost_constructed_allies"
	// *----------------------------------- vo ------------------------------------------*
}

decayed final
{
	setstate allied_cp_open_model invisible	// Hide Open CP model
	trigger self show_damaged_cabinet	// Show previous cabinet state
	trigger self show_closed_cabinet
}

death
{
	trigger self show_damaged_cabinet	// Show damaged CP model
	trigger self disable_cp_features		// Default charge bar times

	wm_announce "Axis team has destroyed the Allied Command Post!"
	// *----------------------------------- vo ------------------------------------------*
	wm_teamvoiceannounce 1 "allies_hq_compost_damaged"
	wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

	wm_removeteamvoiceannounce 0 "axis_hq_compost_constructed_allies"
	// *----------------------------------- vo ------------------------------------------*
}

trigger show_closed_cabinet
{
	accum 0 abort_if_equal 1		// Closed cabinet active yet?
	setstate allied_cp_closed default
	setstate allied_cp_closed_model default
}

trigger show_damaged_cabinet
{
	accum 0 abort_if_equal 0		// Damaged cabinet active yet?
	setstate allied_cp_damaged default
	setstate allied_cp_damaged_model default
}

}
//====================================
//==========bunker forward spawn======
//====================================
oldcity_spawns
{
spawn
{
}
}

old_city_wobj
{
spawn
{
}
}

oldcityflag
{
spawn
{
accum 0 set 0 // Who has the flag: 0-Axis, 1-Allied
}

trigger allied_capture
{
accum 0 abort_if_equal 1 // do Allies own flag?

  trigger game_manager oldcity_flagblue 

  setstate oldcityspawns default 
  setstate old_city_wobj default 

  trigger oldcityflag setallies 

  // *----------------------------------- vo ------------------------------------------* 
  wm_addteamvoiceannounce 0 "battery_axis_bunker_cap" 


  wm_teamvoiceannounce 0 "battery_axis_bunker_cap"  

  wm_teamvoiceannounce 1 "battery_allies_bunker_cap" 

  wm_removeteamvoiceannounce 0 "battery_axis_bunker_defend" 

  wm_removeteamvoiceannounce 1 "battery_allies_bunker_cap" 
  // *---------------------------------------------------------------------------------* 

}

trigger setallies
{
accum 0 abort_if_equal 1
accum 0 set 1

  alertentity old_city_wobj 
  alertentity oldcityspawns 

  setautospawn "Bunker" 0 

}

trigger axis_capture
{
accum 0 abort_if_equal 0 // do Axis own flag?

  trigger game_manager oldcity_flagred 

  setstate oldcityspawns default 
  setstate old_city_wobj default 

  trigger oldcityflag setaxis 

  // *----------------------------------- vo ------------------------------------------* 
        wm_addteamvoiceannounce 0 "battery_axis_bunker_defend" 

  wm_addteamvoiceannounce 1 "battery_allies_bunker_capture" 

  wm_teamvoiceannounce 0 "battery_axis_bunker_captured" 

  wm_teamvoiceannounce 1 "battery_allies_bunker_lost" 

  wm_removeteamvoiceannounce 0 "battery_axis_bunker_capture" 

  wm_removeteamvoiceannounce 1 "battery_allies_controls_destroy" 
  // *---------------------------------------------------------------------------------* 

}

trigger setaxis
{
accum 0 abort_if_equal 0
accum 0 set 0

  alertentity old_city_wobj
  alertentity oldcityspawns 

}
}
//=========================
//======radar rotation=====
//=========================
radar
{
spawn
{
wait 100
setrotation 0 30 0
}
}


(S14Y3R) #2

Hi pigg, the reason your bunker vo’s don’t work is because you need to set up a custom(your_map_name).sounds file. Only vo’s prefixed with axis_ or allies_ can be used off the bat. k, (After extracting pak0) have a look in the pak0/sound/scripts folder to see the standard map vo scripts, specifically the battery.sounds file.

eg.

wm_addteamvoiceannounce 0 "battery_axis_bunker_defend"

calls this function in battery.sounds:

battery_axis_bunker_defend
{
	sound sound/vo/battery/axis/hq_bunkerdef.wav //actual .wav file played
	voice 
	streaming 
}

The problem is that these will only work for the battery.bsp/battery.script. What you want to do is create a file called

yourmapname.sounds

and every vo reference you create in it must start with

yourmapname_

So you’d want to have:

wm_addteamvoiceannounce 0 "yourmapname_axis_bunker_defend"

which will call your:

yourmapname_axis_bunker_defend
{
	sound sound/vo/battery/axis/hq_bunkerdef.wav //path to .wav
	voice
	streaming
}

in YOUR.sounds file.

Simple enough, right?

k, now the problem of vo’s not going away… now that you know how to customize your own vo’s, you should set up vo’s for each command post. eg. a set for cp1 and another set for cp2. Using the paths in the default.sounds, Or this is where you would “insert your own” :slight_smile: Some people have recorded their own vo announcement. The .sounds file is how you implement personal .wav’s ingame.

Just remember the vo.sounds script MUST be named as your .bsp and to append yourmapname_ to all of “your” Vo’s.

Hope that helps.

Easy as pie :chef:


(pigg221462) #3

still kinda confused. i extrated all the sounds for the game and have been using them for everything. the problem with the command posts is that after the cp has been constructed you do hear the vo “axis has constuted a command post” but the problem is a allied player coming into the game 10 minutes later hears that when he spawns into the game. why is that it should only say it once the command post is build and never again unless it was destroyed and them build again


(S14Y3R) #4

K, wm_teamvoiceannounce <team> <soundname> //instantly plays sound ->Plays sound to target team when called in the script.

These next two are for players just joining a team. There are two caches of sounds to be played when a player joins the map. One for Axis, and one for Allies. When you use wm_addteamvoiceannounce 1/0, it add that sound to the cache for that team. Multiple addteamvoiceannouncement can be added to each teams cache. But you don’t want to overwhelm people when they join, so don’t add too many.

wm_addteamvoiceannounce <team> <soundname> //places sound in the queue to play when player joins a team.

K, now wm_removeteamvoiceannounce removes a sound that was added to a teams cache.
wm_removeteamvoiceannounce <team> <soundname>

From Level Designers Reference:

Adds or removes sound to/from the queue of sounds that a player gets to hear when he joins a team. 

self explanitory.

Okay, now with your two different command posts adding the same sound to the cache with the same name somethings not getting removed properly. That’s why I recommended creating your own .sounds file. That way you have a specific Vo for each cm_post, its still the same sound file though. :drink:


(pigg221462) #5

wow think i got it now. think i’m just going to erase the vo’s and start over making sure if i add one to remove it when it should be removed thanks a lot think i got it now