ProgrammingNeed help with GSC Coding...
Posted:

ProgrammingNeed help with GSC Coding...Posted:

BlackOpsProMod
  • New Member
Status: Offline
Joined: Sep 06, 20167Year Member
Posts: 4
Reputation Power: 0
Status: Offline
Joined: Sep 06, 20167Year Member
Posts: 4
Reputation Power: 0
dog_round_tracker()
{   
    level.dog_round_count = 1;
   
    // PI_CHANGE_BEGIN - JMA - making dog rounds random between round 5 thru 7
    // NOTE:  RandomIntRange returns a random integer r, where min <= r < max
    level.next_dog_round = randomintrange( 5, 8 );   
    // PI_CHANGE_END
   
    old_spawn_func = level.round_spawn_func;
    old_wait_func  = level.round_wait_func;

    while ( 1 )
    {
        level waittill ( "between_round_over" );

        /#
            if( GetDvarInt( #"force_dogs" ) > 0 )
            {
                level.next_dog_round = level.round_number;
            }
        #/

        if ( level.round_number == level.next_dog_round )
        {
            level.music_round_override = true;
            old_spawn_func = level.round_spawn_func;
            old_wait_func  = level.round_wait_func;
            dog_round_start();
            level.round_spawn_func = ::dog_round_spawning;

            level.next_dog_round = level.round_number + randomintrange( 4, 6 );
            /#
                get_players()[0] iprintln( "Next dog round: " + level.next_dog_round );
            #/
        }
        else if ( flag( "dog_round" ) )
        {
            dog_round_stop();
            level.round_spawn_func = old_spawn_func;
            level.round_wait_func  = old_wait_func;
            level.music_round_override = false;
            level.dog_round_count += 1;
        }           
    }   
}


At the level.next_dog_round = level.round_number + randomintrange( 4, 6 );
This function means i get a 4 or a 5 rounder of dogs at a random, If I change this code for example ( 4, 5 ) that would always give me a 4 rounder.
I wanna know a method to change this with percentages, for example I want in 90% a 4 rounder and in 10% a 5 rounder, can you teach me how to do it?
I tried to put 5 && 10 && 14 && 19 && 23 ... etc put that method to pre set the dogs in game doesnt work!
Im pretty sure you know how to do it, can you give me some help?
#2. Posted:
BlackOpsProMod
  • New Member
Status: Offline
Joined: Sep 06, 20167Year Member
Posts: 4
Reputation Power: 0
Status: Offline
Joined: Sep 06, 20167Year Member
Posts: 4
Reputation Power: 0
I also would prefer a way to change the coding that I can pre set all the dogs that I want for example in my match If I want 7,11,15,19,24,29,34,39,44,48 how Can I make the code to set that up?
Users browsing this topic: None
Jump to:


RECENT POSTS

HOT TOPICS