UGX-Mods

Call of Duty 5: World at War => Tutorial Desk => Scripting => Topic started by: John_Banana on February 16, 2022, 10:21:48 pm

Title: How to make barrier sound effects play like Black Ops 1 (Easy)
Post by: John_Banana on February 16, 2022, 10:21:48 pm
In Black Ops 1 onwards, Treyarch made it so the "cha ching" money sound only played when you were actively earning +10 from barriers, and once you stopped then only the wood board sound played. So, today I just fixed this for WaW and it's super simple.
 
1) Go to _zombiemode_blockers gsc
 
 
2) Find this:
Code Snippet
cpp
            chunk play_sound_on_ent( "rebuild_barrier_piece" );

3) And replace it with:
Code Snippet
cpp
            if( player.rebuild_barrier_reward < level.zombie_vars["rebuild_barrier_cap_per_round"] )
            {
                chunk play_sound_on_ent( "rebuild_barrier_piece" );
            }
This tests for if your current reward level is less than the cap set per round, and if it is then it will keep playing the +10 points sound effect.
 
 
4) Scroll down a bit and comment this out, because we need to move it up to before our new if statement. That way the score level is updated right before playing the sound and won't accidently play the sound longer than it should.
Code Snippet
cpp
            player.rebuild_barrier_reward += cost;

5) So, it should now look like:
Code Snippet
cpp
            player.rebuild_barrier_reward += cost;
            if( player.rebuild_barrier_reward < level.zombie_vars["rebuild_barrier_cap_per_round"] )
            {
                chunk play_sound_on_ent( "rebuild_barrier_piece" );
            }
That's all, I'm still a bit new so feel free to let me know if I did something wrong,  to me it looks good and works fine. Tested it on Der Riese.