Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO1 Modding Releases & Resources
  3. [ZM] Deterministic Moon characters

[ZM] Deterministic Moon characters

Scheduled Pinned Locked Moved BO1 Modding Releases & Resources
3 Posts 2 Posters 861 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ojogoperdiundefined Offline
    ojogoperdiundefined Offline
    ojogoperdi
    wrote on last edited by
    #1

    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++;
    }
    
    1 Reply Last reply
    3
    • bhfffundefined bhfff referenced this topic on
    • bhfffundefined Offline
      bhfffundefined Offline
      bhfff
      wrote on last edited by
      #2

      Love this one! Never knew you could call those functions to change model 😄

      1 Reply Last reply
      1
      • ojogoperdiundefined Offline
        ojogoperdiundefined Offline
        ojogoperdi
        wrote on last edited by ojogoperdi
        #3

        Thank you bhfff for linking to this script from your topic.

        It was an adventure to figure out how scripting works and how to replace game logic. The script sources for BO1 and your code explorer were very useful resources. I hope those get advertised more prominently in the official Plutonium documentation.

        1 Reply Last reply
        2

        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Donate