Avoid ever being John Wick

Solution 1:

There's a way, but it only works if the host has configured it (installed a Lua script mod).

To install this mod, grab a copy of IPHLPAPI.dll from PocoHud or HoxHud and place it in the PAYDAY 2 game folder. You only need IPHLPAPI.dll (the Lua hook)*, so there's no need for the other files if you don't want to install the above mods.

Open the PAYDAY 2 game folder, and if these folders don't exist yet, then create a lib folder, and then create a Lua folder within it. Then create a text file in it and name it register_exclude_characters_mod.lua. Paste this script using a text editor in it and save the file:

-- http://gaming.stackexchange.com/a/191627/4797?exclude_characters_PAYDAY_2
RegisterScript("lib/Lua/exclude_characters/exclude_characters.lua", 2, "lib/network/networkgame")
RegisterScript("lib/Lua/exclude_characters/exclude_characters.lua", 2, "lib/managers/criminalsmanager")

Then go to \PAYDAY 2\lib\Lua\ then create a folder called exclude_characters and then create a text file within it and name it exclude_characters.lua . Paste this script using a text editor in it and save the file:

-- http://gaming.stackexchange.com/a/191627/4797?exclude_characters_PAYDAY_2
-- v2
local EXCLUDED_CHARACTERS =  EXCLUDED_CHARACTERS or {
        -- "russian", -- Dallas
        -- "german", -- Wolf
        -- "spanish", -- Chains
        -- "american", -- Houston
        "jowi", -- Wick
        -- "old_hoxton", -- Hoxton
        -- "female_1", --Clover
        -- "dragan", 
        -- "jacket", 
        -- "bonnie", 
        -- "sokol", 
}

if RequiredScript == "lib/network/networkgame" and (#EXCLUDED_CHARACTERS < 8) then

    function NetworkGame:check_peer_preferred_character(preferred_character)
        local free_characters = clone(CriminalsManager.character_names())
        for pid, member in pairs(self._members) do
            local character = member:peer():character()
            table.delete(free_characters, character)
        end

        for _, excluded_char in ipairs(EXCLUDED_CHARACTERS) do 
            table.delete(free_characters, excluded_char) 
        end

        if table.contains(free_characters, preferred_character) then
            return preferred_character
        end
        local character = free_characters[math.random(#free_characters)]
        print("Player will be", character, "instead of", preferred_character)
        return character
    end

elseif RequiredScript == "lib/managers/criminalsmanager" and (#EXCLUDED_CHARACTERS < 8) then

    function CriminalsManager:get_free_character_name()
        local available = {}
        for id, data in pairs(self._characters) do
            local taken = data.taken
            if not taken and not self:is_character_as_AI_level_blocked(data.name) then
                table.insert(available, data.name)
            end
        end

        for _, excluded_char in ipairs(EXCLUDED_CHARACTERS) do 
            table.delete(available, excluded_char) 
        end

        if #available > 0 then
            return available[math.random(#available)]
        end
    end

end

To check if you have installed it correctly, there should be a file named register_exclude_characters_mod.lua in \PAYDAY 2\lib\Lua\ and there should be a file named exclude_characters.lua in \PAYDAY 2\lib\Lua\exclude_characters\.

The script above will allow you to exclude any character from being used by both human players and team AI bots. (Only John Wick is set to be excluded by default in the above script.) Remove the -- in front of a name in the EXCLUDED_CHARACTERS table to also exclude the character. Note that the script will not activate if you only leave 3 characters or less to be usable (because the game will crash if the script allowed that).

The script was originally from the Block Wick (host-only) post in the PAYDAY 2 Steam forums by user, Seven. I modified it to easily allow excluding other characters aside from Wick in both human and bot teammates, and to not allow excluding too many characters.


* An alternative to the original Lua hook is the BLT: CSE Lua hook (the script can be installed the same way as described above), or the BLT hook (script installation method is different - see its manual on how to register a script as 'post-require').

Solution 2:

Unfortunately no, there's no way to prevent being a specific character.

From the Payday 2 Lua files:

function NetworkGame:check_peer_preferred_character(preferred_character)
    local free_characters = clone(CriminalsManager.character_names())
    for pid, member in pairs(self._members) do
        local character = member:peer():character()
        table.delete(free_characters, character)
    end
    if table.contains(free_characters, preferred_character) then
        return preferred_character
    end
    local character = free_characters[math.random(#free_characters)]
    print("Player will be", character, "instead of", preferred_character)
    return character
end

If your preferred character isn't available, it just picks one at random. Only real solution is to play with friends, and make sure you all have the character you want.