THE SET OF “Ocean’s Thirteen” was a war zone. George Clooney flipped out when anyone forgot a line. Brad Pitt’s costars were under orders not to look him in the eye. And Matt Damon threw a hissyfit about having to wear that prosthetic nose.

As if.

It’d be refreshing to report some juicy infighting during the filming of the latest “Ocean’s” installment, but we can’t. Steven Soderbergh’s genial cast had as much of a grand old time filming this one as they did “Ocean’s Eleven” and its unfortunate sequel, “Ocean’s Twelve.” The good-time gang was born from director Steven Soderbergh’s cardinal casting rule: “No jerks,” he said at the Cannes premiere last week. “That solves everything.”

Thankfully, these nice guys are anything but dull. We scrounged up a few stories - 13, to be exact - about the making of the film, due out Friday, in which Danny Ocean (Clooney) and his crew exact revenge on nasty casino owner Willy Bank (Al Pacino) in trademark grandiose fashion.

1. The Ocean Club

“Thirteen” was filmed largely on a set in Southern California. But producer Jerry Weintraub - who also appears in a bit part as high-roller Denny Shields - went to great lengths to re-create the boys’-night atmosphere of the first two shoots.

“Jerry created this Vegas-style lounge right next to the set, out of a couple of Warner Brothers offices,” says actor Eddie Jemison, who plays electronics expert Livingston Dell. “He had a designer come in, and they put in a bar and a buffet and a foosball table and some gaming tables.”

“There were poker games every day,” says Brian Koppelman, who co-wrote the screenplay with David Levien. “One of the producers even brought in ‘autographed’ pictures of old starlets: ‘Thanks for last night, George - Love, Rita.’ ”

Gambling was a constant diversion for those who weren’t busy shooting, well, gambling scenes. Unfortunately for the actors, they were up against the guys who wrote the 1998 card-shark movie “Rounders,” which starred Matt Damon, who returns as con man Linus Caldwell.

“We took a lot of people’s money,” Koppelman confirms. “The two of us - David Levien and I - and Matt, we got all the money.”

2. The Chewbacca Gag

One of Soderbergh’s favorite running jokes is that Shaobo Qin’s Chinese acrobat - who speaks only Mandarin - can somehow be understood by all the other guys. When accused of ethnic insensitivity by a Chinese reporter at Cannes, Soderbergh seemed taken aback.

“Look, I’m really sorry that was your response,” he said. “The movie is an equal opportunityoffender. This could be somebody from any culture for that joke. It’s sort of like Chewbacca in ‘Star Wars.’ He talks all the time and everybody acts like they know what he’s saying.”

Watch out for Wookiee protests at your local theater.

3. The Skunk

As longtime scammer Rusty Ryan, Pitt dons glasses, shaggy hair and khakis to infiltrate Pacino’s office, posing as an earthquake expert with seismographs. The writers had a specific model in mind for Pitt’s costume: “That was nicknamed the Skunk Baxter look,” says Levien. “You know - that guitarist from the Doobie Brothers.”

4. The Method

The rule of thumb on-set was not to overthink - and certainly not to overact. “There’s not a lot of actor angst going on,” says Jemison. “Not a lot of actors talking about ‘the process.’ I think that would be frowned on by Steven.”

At one point, he says, someone brought in an instructional drama book, which was, predictably, mocked.

“We were all joking, especially Matt and Don, about this book about the acting process called ‘Relaxantration,’ ” says Jemison with a laugh. “We just made fun of all those rules that actors have.”

5. The Oprah Lovers

Ocean’s con men of may be savvy, but they’re no match for the queen of daytime - Clooney’s Danny gets his chops busted by Pitt’s Rusty when he gets choked up watching Oprah.

“That scene is directly out of our lives,” says Koppleman. “David walked into this hotel room with me watching the show, and yeah, I had gotten a little emotional. But when David comes and watches with me, he gets sucked in, too. He might even ask me for a tissue.”

The writers added the bit to the script and held their breath.

“That was the one scene, every draft, we would pray that that scene would stay in the movie, that the guys would be willing to do it,” says Koppelman. “It’s George Clooney and Brad Pitt acting out, word for word, our lives. These great-looking, perfected versions of us. Totally hilarious. We were able to use all of our resources and connections for our own personal catharsis.”

6. The Dame

With Julia Roberts out of the picture, Ellen Barkin turns up as the lone female character in “Thirteen.”

She’s Abigail Sponder, righthand woman to Pacino’s Willy Bank. The role was written for her, as her scene with Damon in “Twelve” wound up on the cutting-room floor. Fortunately, she likes being one of the guys.

“She was totally game,” says Koppelman. “She’s got a riotous sense of humor. She loves being campy. She’s a total gun-moll type of woman.”

7. The Cat Herder

What a cast full of hams, Soderbergh’s directorial experience sounds approximately like trying to quiet a classroom full of fourth-graders on Red Bull.

“Steven would have to yell ‘Action!’ three times sometimes,” says Jemison, “because people were cutting up and singing and joking, trying to crack each other up.”

“There are occasions,” Soderbergh acknowledged at Cannes, “when it’s hard to get everybody to be quiet and focused.”

To which nearly every cast member chimed in: “Matt!”

8. The Sinatra Code

Who knew that simply meeting the Chairman of the Board made a fella beholden to a code of honor?

The arcane notion of the “Frank Sinatra handshake” becomes a minor theme in the movie, which Soderbergh explains thusly: “There’s this urban legend that if you once shook Sinatra’s hand, and you’re dealing with somebody else who did, too, there’s supposed to be a code [between you].”

The code, however, didn’t apply to most of the cast. Only Weintraub and Barkin belong.

“Basically,” Weintraub says, “the older people.”

9. The Schnozz

The enormous false beak Damon sports during a good chunk of “Thirteen” is a plastic surgeon’s nightmare - and something the star couldn’t wait to wear.

“Matt originally had this prosthetic nose for [Terry Gilliam’s 2005 movie] ‘The Brothers Grimm.’ ” says Koppelman. “But when the Weinsteins saw it on him and saw how it diminished his Matt Damon-y good looks, they wouldn’t let him wear it, and he was really disappointed. The idea of Matt going through a lot of this movie wearing this big honker was funny to us. And we knew he would be totally into it.”

As for the nose model, the writers say it comes closest to that of actor Adrien Brody -and, in fact, it’s actually referred to as “The Brody” at one point in the film.

10. The Do-over

While “Ocean’s Eleven” charmed audiences with its breezy plotting and Rat Packretro banter, the sequel fell short of expectations. So did Soderbergh set out to make up for “Twelve”?

Producer-star Clooney admitted as much in an interview last year.

“‘Thirteen’ happened because we thought we could do it better than ‘Twelve,’” he said. “And we didn’t want to go out getting socked in the chin. [This one] is back to ‘Eleven’ in terms of spending more time with the guys.”

But Clooney’s candor paled by the time he made it to Cannes. When a reporter stated flatly that “Thirteen” was far superior to “Twelve,” Clooney seemed wounded. “Wow,” he said. “That’s a backhanded compliment.”

11. The Revolutionaries

Perhaps the most unexpected story line in “Thirteen” is that of bumbling brothers Turk and Virgil Malloy (Scott Caan and Casey Affleck, respectively), who go undercover at a dice factory in Mexico, where Virgil incites a workers’ insurrection.

“We were researching in Las Vegas when we met this guy responsible for gaming elements,” says Koppelman. “And we asked him, ‘How would you get fake dice in?’ He said, ‘You can’t, after they leave the factory.’ And we go, ‘Well, what about in the factory?’

“He said the chemicals they use to make them are incredibly poisonous, and they can’t make them in this country - they make them in Mexico,” Koppelman adds. “We looked at each other and said, ‘Oh, it’s so unfair.’ And then we just started laughing. Casey’s character would totally have a conscience about that.”

12. The Rewrite Men

As natural as Clooney & Co. make it look, the witty, rapid-fire dialogue comes largely from the minds of Koppelman and Levien. And when it came time to make changes in the script, Clooney would call in the writers. Which, at one point, struck Koppelman as amusing.

“George called us over, and we’re looking around at Steven Soderbergh, Academy Award winner for writing ‘Sex, Lies and Videotape’; Matt Damon, Academy Award winner for writing ‘Good Will Hunting’; and George Clooney, Academy Award winner for writing ‘Good Night, and Good Luck.’

“We were like, you’re the guys who won the Oscars - you come up with it.”

13. The Godfather

Guest stars abound in the “Ocean’s” franchise, but Pacino was a particularly weighty addition. “He raised our respectability, and we brought his down,” Pitt said at Cannes.

Says Weintraub: “He asked me, ‘What do these guys think of me? They’re all friends.’ I said to him, ‘What did you think of Brando when you did “The Godfather”? That’s what they think of you.’ ”

Pacino had a few more “Godfather” connections: He starred with James Caan - father of Scott - in “The Godfather,” and he and Andy Garcia - who reprises his role as casino owner Terry Benedict - were both in “Godfather III.”