UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Level start VOX when players see the first zombie (Level: Easy)

broken avatar :(
Created 1 year ago
by John_Banana
0 Members and 1 Guest are viewing this topic.
460 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 5 December 2016
Last active: 3 hours ago
Posts
59
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
John_Banana's Groups
John_Banana's Contact & Social LinksJohn_BananaYouTube Channel
Add:
Code Snippet
cpp
    level thread level_start_vox();
in your nazi_zombie_mapname.gsc  main() function
 
Then paste this in at the bottom:
Code Snippet
cpp
level_start_vox()
{
    wait( 5 );
   
    players = get_players();

    for( i = 0; i < players.size; i++ )
    {
        players[i].has_talked = 0;
       
        for(;;)
        {
            zombies = getaiarray("axis" );
            close_zombies = get_array_of_closest( players[i].origin, zombies, undefined, undefined, 600 );
           
            for( j = 0; j < zombies.size; j++ )
            {
                if ( (players[i] IsLookingAt(zombies[j]) || close_zombies.size > 0 || players[i].score_total > 500) && players[i].has_talked == 0 )
                {
                    players[i].has_talked = 1;
                    index = maps\_zombiemode_weapons::get_player_index( players[i] );
                    plr = "plr_" + index + "_";
                    players[i] thread create_and_play_dialog( plr, "vox_level_start", 0.25 );
                    break;
                }
                else
                {
                    wait(0.1);
                    continue;
                }
            }
            if(players[i].has_talked == 1)
            {
                break;
            }
            wait(0.05);
        }
    }
}
- You can easily change the cooldown at the start, I put it at 5 seconds so the intro sounds start to finish before the player can talk
 
- This code also has 2 fallbacks in case IsLookingAt doesn't activate, even if you look at a zombie (it happens). First it checks if there is a close proximity zomb, and then it also checks if you have gained score (damaged a zombie), either way, it will force the dialogue so it feels natural when you see a zombie
 
- I think the classic Der Riese "we need to turn the power on" is getting a bit old eh? There's lots of cool un-used VOX that could work here, like the characters saying "Here they come" or "incoming" etc.

 
Loading ...