‘Other Guys’ Will Ferrell and Mark Wahlberg hammer out the Partner’s Code

Will Ferrell and Mark Wahlberg play mismatched detectives in Adam McKay’s absurdist comedy “The Other Guys,” but they’re not an odd couple in the classic buddy-cop tradition in which the by-the-book officer endures the reckless behavior of his wild-card partner.

No, in “The Other Guys,” which opens Friday, Ferrell and Wahlberg both play the same thing — freaks. They’re incompatible only because their peculiarities don’t mesh. Wahlberg’s New York City police detective Terry Hoitz wants to hit the streets, fight crime and “fly like a peacock.” His partner, Allen Gamble (Ferrell), is a desk cop who gets off on paperwork. Different ambitions, but both weird, wounded man-children cut from much the same cloth as the characters in the three previous McKay-Ferrell collaborations (“Anchorman,” “Talladega Nights” and “Step Brothers”).

At the end of the day, though, the boys have each other’s backs, honoring what they repeatedly (and rather idiotically) call the Partner’s Code. Did Ferrell and relative comedy-newcomer Wahlberg have a similar agreement? Over lunch at Hollywood’s Chateau Marmont, we sifted through their own, unspoken version of the Code.

Rule No. 1: When making a first impression, pick your spots.

Two years ago, Wahlberg received an invitation out of the blue to have dinner with Ferrell and McKay to see if they might make a comedy together. “The dinner is crucial,” McKay says, “because we like to improv and throw lines out on the set and that can … some actors. So we’ve got to know if you’re going to be a pain in the … .”

“For them to call me was such a surprise,” Wahlberg says, “because I’m always going out of my way to convince people to hire me.”

Ferrell had done a bit at the 2007 Academy Awards in which he and Jack Black poked fun at audience members until Ferrell came upon Wahlberg. “I won’t mess with you,” Ferrell said, meekly. “You’re actually kind of badass.”

Wahlberg: “I didn’t know anything about it. But I knew something was up because I had gone to the bathroom and when I came back, John C. Reilly was sitting in my row. And he wasn’t there when I left. I wanted to say hi, but he seemed really focused.”

Ferrell: You know, I saw you at a Lakers game before that. John had told me that when you were doing ‘A Perfect Storm,’ they had that scene below decks where they’ve got this big catch and they’re eating ice cream and [director] Wolfgang [Petersen] kept saying, ‘OK, you are having a good time. You are having an ice cream party.’ ”

Wahlberg: “Because everyone was like, ‘Why are we eating ice cream? Shouldn’t we be pounding beers? We’re fishermen!’ ”

Ferrell: “And he was, ‘No, you caught lots of fishes. You’re having an ice cream party.’ So I was going to come up to you at the Lakers game and start saying that like Wolfgang. But I chickened out. I was afraid you’d call security.”

Rule No. 2: Be your authentic self.

In “The Other Guys,” Wahlberg does a ballet dance to impress an ex-girlfriend and reprised the routine later in the movie while directing traffic in the middle of Manhattan.

Wahlberg: “There’s no problem beating the … out of a guy and getting the girl [in a movie]. This? You’ve got to let it all hang out and not care if other people think you look ridiculous. I’ve spent a lot of time in my life trying to be cool … .”

Ferrell: “I’ve never had that problem.”

Wahlberg: “And that’s a huge advantage. You keep trying things. You keep going.”

Ferrell: “I remember watching you in the precinct, saying, ‘I’m a peacock, dammit! Let me fly!’ You really went for it in a way that I wasn’t expecting. The intensity, a guy yelling to his co-workers, ‘I’m a peacock!’ There’s such an earnestness to the character … and also this lack of understanding of not really knowing what a peacock is.”

Rule No. 3: Make good use of wisdom from the past.

One of the movie’s best bits comes early when Wahlberg’s detective calls Ferrell a fake cop and that if he were in the wild, he’d attack him. “If I were a lion and you were a tuna, I’d swim out in the ocean and eat you!” Ferrell then improvised a long explanation about how a lion would be out of its element in the ocean against a full-grown, 800-pound tuna.

Wahlberg: “It’s so funny because we went out on the fishing boats on ‘Perfect Storm’ and caught tuna and they’re massive. So he’s got a point.”

Ferrell: “I could tell you were actually having a flashback to that when I went into that whole tuna thing.”

Wahlberg: “I was thinking about it — mainly just to keep myself from laughing at you.”

Rule No. 4: Educate the public.

Ferrell drove around with a detective one day and unloaded a few rounds at the firing range, thinking a joke might come to him along the way. Action vet Wahlberg, meanwhile, served as something of an unbilled technical advisor on the movie. When the Other Guys learn that being caught near a real explosion isn’t like anything you see in the movies (Blood blisters! Soft tissue damage!), Wahlberg could confirm the message.

Wahlberg: “At the end of ‘Shooter,’ I have to walk out of this house while it blows up behind me. [Director] Antoine Fuqua is like, ‘Whatever you do, don’t flinch.’ Which is kind of hard because they’ve just put gel on the back of my hair so it won’t catch fire. And I had to start in the building that was stacked with the explosives.”

Ferrell: “The freaky thing must have been waiting in that house for ‘action.’ ”

Wahlberg: “I was a bit concerned, yeah.”

But worry seems to have absented itself from “The Other Guys,” even though McKay says he was bombarded with questions about teaming with Wahlberg before making the movie.

“Everybody’s like, ‘Oh, you’re working with an action guy,’ and I’m saying, ‘No, he can act,’ ” McKay says. “That’s the trick. And he’s funny too. Anyone who questioned casting him clearly hadn’t seen ‘The Departed’ or ‘I [ Heart] Huckabees.’ ”

“Bottom line, both Mark and Will are not very needy guys,” McKay adds. “Never was there a moment when Mark was like, ‘I gotta make sure I’m funny.’ And Will’s never like that. In fact, Will would love to be the straight man for a whole movie. So when you have that kind of match, it’s easy.”