My friends and I started playing CoD Zombies to complete all easter eggs. We were always joining the lobby in the same order to play the same characters in each map. Except when we arrived at Moon and the characters were kind of randomized. This annoyed us greatly, so I decided to change this behavior by writing a script to make the character order deterministic.
// This scripts replaces Moon's default character pseudo-randomization with the behavior other maps have:
// each player gets Dempsey (1st), Nikolai (2nd), Takeo (3rd) and Richtofen (4th) according to the order they joined.
// If there are less than 4 players in the lobby, the last player to join is always Richtofen.
//
// Place this script in %LocalAppData%\Plutonium\storage\t5\scripts\sp\zom
// and save it as zm_moon_deterministic_char.gsc.
// Only the lobby host needs the script.
init() {
if (level.script == "zombie_moon") {
level.zombiemode_give_player_model_override = ::give_player_model_override;
}
}
give_player_model_override(entity_num) {
multiplayer = GetNumExpectedPlayers() > 1;
if (multiplayer) {
if (entity_num == (GetNumExpectedPlayers() - 1)) {
entity_num = 3;
}
self.zm_random_char = entity_num;
} else {
entity_num = self.zm_random_char;
}
self.entity_num = entity_num;
if (entity_num == 0) character\c_usa_dempsey_dlc5::main();
if (entity_num == 1) character\c_rus_nikolai_dlc5::main();
if (entity_num == 2) character\c_jap_takeo_dlc5::main();
if (entity_num == 3) character\c_ger_richtofen_dlc5::main();
level._num_overriden_models++;
}