“Wonderful! Smashing!” the director Danny Boyle called out, as Ewan McGregor and Robert Carlyle finished their fifth take of a tense and poignant scene that comes near the end of “T2: Trainspotting.” He laughed. “Literally smashing,” he said to a group of onlookers, referring to the brutal events with which the scene ends.
Mr. Boyle, who directed the first “Trainspotting,” was not far from the end of the 53-day shoot last summer that reunited the original quartet of actors — Mr. McGregor, Mr. Carlyle, Jonny Lee Miller and Ewen Bremner — for a much-anticipated sequel to the mordant, bitingly irreverent 1996 movie about heroin addiction, sex, squalor and friendship set to a memorably rousing soundtrack in a decidedly tourist-unfriendly Edinburgh. (It opens in the United States on Friday, March 17.)
“You can’t avoid the first film,” Mr. Boyle said during a break in filming. “You keep bumping into it whether you like it or not.”
That’s because the original “Trainspotting,” based on Irvine Welsh’s 1993 novel of the same name, was a phenomenon; a low-budget film that became one of the most successful movies ever made in Britain, and which came to stand for a particular cultural moment (a potent mix of aspiration, money, unemployment and AIDS) in the post-Thatcher era. (A high-speed, bitter monologue by Mr. McGregor’s character, Mark Renton, beginning with “Choose life,” was a popular dorm-room poster in Britain at the time.)
“It’s terrifying if you think about living up to the success of the first film,” Mr. Boyle said in a recent telephone interview. “You have to put it away because it can’t be a specter following you. But occasionally I’d catch the actors looking at me, and you could tell they were thinking, this better not be rubbish. And they were quite right, because you’d be disturbing a bit of national treasure, even if it’s an odd choice as a national treasure.”
In Britain, where the film opened in January, reviews were largely enthusiastic. “What began as a zeitgeisty outlaw romp in the Uncool Britannia of the 1990s is now reborn as a scabrous and brutal black comedy about middle-aged male disappointment and fear of death,” Peter Bradshaw wrote in The Guardian.
“T2: Trainspotting” picks up 20 years after the end of the first movie, as Mark Renton returns to Edinburgh from Amsterdam, where he has been living since fleeing with the proceeds of a drug deal, stolen from his friends. He reunites with Spud (Mr. Bremner) and Simon (Mr. Miller, known as Sick Boy in the first film), and the plot is set in motion when the terrifyingly violent Begbie (Mr. Carlyle) escapes from jail and discovers that his old frenemy is back in town. Renton teams up with Simon and his partner Veronika (Anjela Nedyalkova in the only slightly substantial female role in the film) to raise money to start a brothel. But Begbie’s plans for revenge give events an unexpected turn.
Mr. Boyle said that although there had been no studio pressure to make a sequel after the first film, people asked him about it constantly. “It became a sort of self-fulfilling prophecy,” he said. “I’d joke and say, ‘They aren’t old enough yet.’” After Mr. Welsh published “Porno,” an equally squalid sequel to “Trainspotting,” in 2002, Mr. Boyle and John Hodge, who wrote the first film’s screenplay, made a stab at an adaptation, but decided it wasn’t good enough.
“As the 20-year anniversary came up, we started to think well, maybe we should have another go,” Mr. Boyle said. “John, Andrew Macdonald, who produced the first film, and I got together for a week in Edinburgh and talked through ideas. It became about masculinity, men aging badly, not dealing with time very well — not another high-jinks version of the first film.”
Mr. Boyle added that changing the mood in this way made it easier not to mind the pressure around a sequel. “We were not just repeating the formula, although there is some of that too,” he said. “Then again, the characters are trying desperately to relive the past too.”
Although the second film uses elements from “Porno,” like the impending confrontation between Renton and Begbie, Mr. Boyle said the story was largely a development of ideas from the original book. “Irvine was wonderful about that,” Mr. Boyle said. “We came from modest beginnings and the film had such a big impact on all our careers, that there were no issues then or now about who had control of what. That was true in the filming, too. All four characters have an equal share in the story, and each felt they were returning for a good reason. They didn’t get a lot of money; it was like paying forward in a way.” Mr. Boyle laughed. “That’s an American expression I love.”
While “Trainspotting” essentially centered around the character of Renton, the narrative voice of that film, “T2” offers a more subtle exploration of each man’s character and trajectory, with the hapless Spud emerging at the emotional heart of the drama.
Mr. Bremner, who was filming the new “Wonder Woman” movie just before starting work on “T2,” said that the first time he took the idea of a sequel seriously was around three years ago, when he received a postcard from Mr. Boyle. “It had a picture of a kitten lapping a saucer of milk, and it said, ‘We’re working on a script and if it’s any good, we’ll send it to you,’” Mr. Bremner recalled in a telephone interview.
The script was so good, he said, that he easily overcame the reservations he had felt at the prospect of a second film. “The public felt so invested in the original film, in those characters — their youth, their personalities, their recklessness. It’s a huge responsibility.”
It was only when the script was final, however, that it became clear to Mr. Bremner that he needed to pull off the idea that Spud, who attempts suicide early in the sequel, undergoes a psychological transformation as he begins to write down the stories of the friends’ early lives. “In effect, he is like Irvine, creating the stories that make up the film,” Mr. Bremner said. “It’s a very meta concept to put across, but Danny has done it brilliantly.”
The four principal actors have all had successful careers since “Trainspotting,” as has Mr. Boyle, who has subsequently directed “The Beach” (he reportedly fell out with Mr. McGregor over its casting), “Slumdog Millionaire” and “Steve Jobs” among other films, as well as directing the opening of the London Olympic Games in 2012.
“When we filmed the first film, we were all kind of battering around,” Mr. Boyle said. “There is something wonderful in that, too, if you can use that innocence and naïveté, but I really noticed now how experienced these men are, how well they use the camera. They didn’t need coaxing into areas of the script. Actors often lack confidence, and it’s the job of a director to coach them through that, but I didn’t have to do any of that work.”
In a telephone interview, Mr. McGregor said that the experience of working on the second film had made him feel mindful of the passing of time: “From 22 to 45 in the blink of an eye,” he said. “When I first read the script, I felt very moved by the retrospective, nostalgic quality of it. For our past and our youth, for the ’90s, for the movie itself.”
Slipping back into the role of Mark Renton was easy, he said. “We have lived with these characters for 20 years, and although it was daunting up to the moment of putting on those clothes, the minute I did, Renton was there, still in my bones.”
He added: “There is something about the fact that they haven’t moved on. That’s what’s nice about Renton’s arrival in Edinburgh, which he hardly recognizes. The city has moved on in a way he hasn’t; when he falls back into the relationship with Simon, they all fall into the old patterns of their friendship.”
Although Mr. McGregor said that he felt the new film spoke to our era, Mr. Boyle and Mr. Hodge didn’t tackle two of the most urgent issues that have gripped Britain over the past few years: the question of Scottish independence and Brexit. (The stay-or-leave referendum took place during the filming of “T2.”)
Asked if he had considered introducing these elements, Mr. Boyle said he thought it was delusional to try to capture a historical moment. “People may want to try to be zeitgeisty, but that almost guarantees you’ll miss,” he said. “And the timing of filming and editing means you are always six months or a year off from the moment anyway. I think when you look back at the first film now, it’s not so much about a particular time as it is about youth and the contradictions of that time in your life; good things, bad things, recklessness and carefreeness that are enormously attractive. But there is a payback eventually, and it’s manhood.”
Mr. Boyle added that the characters in “T2” “are trying to have their cake and eat it, to recapture the bravado, the insouciance of youth stuck on middle-aged bodies. All the choices Renton was so arrogant about dismissing. What choices did he make? And what does he have now?”
Finding out about those choices, and seeing how the characters had changed (or not) was “like discovering what had happened to old friends,” Mr. McGregor said. He laughed. “I’m looking forward to doing the third one when we’re all in our 60s.”