BlackOpsModder
Veteran
- Messages
- 80
- Reaction score
- 20
- Points
- 578
Code:
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 70% a 4 rounder and in 30% 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?
Last edited: