Caligula (Italian: Caligola) is a 1979 Italian-American erotic historical drama film focusing on the rise and fall of the Roman Emperor Caligula. It stars Malcolm McDowell, Teresa Ann Savoy, Helen Mirren, Peter O'Toole, John Steiner and John Gielgud. It is the only feature film produced by the men's magazine Penthouse. Producer Bob Guccione, the magazine's founder, intended to produce an explicit pornographic film with a feature film narrative and high production values.

The men's magazine Penthouse had long been involved in film funding, helping invest in films made by other studios, including Chinatown, The Longest Yard and The Day of the Locust, but it had never produced a film on its own. The magazine's founder Bob Guccione wanted to produce an explicit adult film within a feature film narrative that had high production values; he decided to produce a film about the rise and fall of the Roman emperor Caligula. Development began under producer Franco Rossellini, the nephew of filmmaker Roberto Rossellini. A screenplay was written by Lina Wertmuller, but Guccione rejected Wertmuller's script and paid Gore Vidal to write a new screenplay. Vidal's screenplay had a strong focus on homosexuality, leading Guccione to demand rewrites which toned down the homosexual content for wider audience appeal. Guccione was concerned that Vidal's script contained several homosexual sex scenes and only one scene of heterosexual sex, which was between Caligula and his sister Drusilla. Vidal was paid US$200,000 for his screenplay, which was titled Gore Vidal's Caligula. Elaborate sets were built by production designer Danilo Donati, who also designed the film's costumes, jewelry, hair styles, wigs and makeup. Several mainstream actors were cast, Guccione intending to make a film which he felt, like Citizen Kane, would be a landmark in cinematic history. Guccione offered directing duties to John Huston and Lina Wertmuller, both of whom rejected the film. After viewing scenes from the film Salon Kitty, Guccione agreed to have lunch with that film's director Tinto Brass, believing Brass would be the ideal person to direct Caligula. Brass had a reputation for being difficult to deal with on film sets but Guccione thought the film's epic scope would "keep [Brass] in line" and that Brass understood the concept of the film enough to direct it. Brass described Vidal's screenplay as "the work of an aging arteriosclerotic" and agreed to direct only if he was allowed to rewrite Vidal's screenplay. Brass' screenplay expanded the sexual content to include orgies, decorative phalluses, and much female nudity. Guccione said Brass' rewrites were done out of necessity to the film's visual narrative and did not alter the dialogue or content. In an interview for Time magazine, Vidal said that in film production, directors were "parasites" and a film's author was its screenwriter; in response, Brass demanded Vidal's removal from the set and Guccione agreed. Guccione considered film to be a "collective effort, involving the input of a great number of artists and craftsmen", and the director to be the leader of a "team effort". Vidal filed a contractual dispute over the film because of Brass' rewrites; Guccione said Vidal had demanded 10% of the film's profits, which Vidal said was not the case. Vidal distanced himself from the production, calling Brass a "megalomaniac". Brass publicly stated, "If I ever really get mad at Gore Vidal, I'll publish his script". Vidal's name was removed from the film's title; the credits were changed to state that the film was "adapted from a screenplay by Gore Vidal", crediting no official screenwriter. Guccione said, "Gore's work was basically done and Tinto's work was about to begin".

Using a quote from the above article, answer the following question: who wrote the screenplay
screenplay was written by Lina Wertmuller, but Guccione rejected Wertmuller's script and paid Gore Vidal to write a new screenplay.