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 2 years ago
by John_Banana
0 Members and 1 Guest are viewing this topic.
1,129 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 5 December 2016
Last active: 16 hours ago
Posts
71
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.
broken avatar :(
×
broken avatar :(
Location: eg
Date Registered: 25 June 2023
Last active: 3 weeks ago
Posts
32
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
this man makes good maps
×
chill_AX2's Groups
chill_AX2's Contact & Social Linksc1a1
sexy
edit: its not that sexy tho
 
when i put
 
Code Snippet
Plaintext
level thread level_Start_vox
inside main() function then
 
Code Snippet
Plaintext
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);
        }
    }
}

at the bottom of the .gsc it gave me an error saying "level_start_vox" is already defined in dlc3_code
 
and yeah it was i checked on it, then i removed the "level_start_vox" from main()
 
still same error
 
then i removed it from your code i put at the bottom
 
i got bad syntax error lmfao
 
unless i didnt understand what u mean or ur wrong with the code, i hope u reach out to fix it or fix my mistake
 
anyways danke
Last Edit: April 20, 2024, 12:23:30 pm by chill_AX2
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 5 December 2016
Last active: 16 hours ago
Posts
71
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
sexy
edit: its not that sexy tho
 
when i put
 
Code Snippet
Plaintext
level thread level_Start_vox
inside main() function then
 
Code Snippet
Plaintext
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);
        }
    }
}

at the bottom of the .gsc it gave me an error saying "level_start_vox" is already defined in dlc3_code
 
and yeah it was i checked on it, then i removed the "level_start_vox" from main()
 
still same error
 
then i removed it from your code i put at the bottom
 
i got bad syntax error lmfao
 
unless i didnt understand what u mean or ur wrong with the code, i hope u reach out to fix it or fix my mistake
 
anyways danke
- You said you wrote "level thread level_Start_vox" that is incorrect, it should be "level thread level_start_vox();"
- You are on a custom map with script placer, dlc3_code contains some of your "mapname" gsc stuff so you can just follow my tutorial on this file only
- Since the default dlc3 code already threads a function called "level_start_vox", all you really have to do is leave everything unchanged except scroll down to where the level_start_function() is from your dlc3code and replace it with mine, that is literally it, I'm not wrong with the code it's what I use on my nacht der untoten custom mod so it will work for you
 
Good luck
 

 
Loading ...