When John Hodge first watched T2 Trainspotting, which he scripted, he couldn’t help but notice how many of the sporting and musical “greats” the film features have died. Johan Cruyff, seen performing his famous turn at the start of the movie, dead; George Best, talked about in adulatory fashion by Renton and Sick Boy for his love life as much as for his brief time playing for Hibs, dead; Lou Reed, whose “Perfect Day” is heard briefly on the soundtrack, dead; Joe Strummer of The Clash, dead; David Bowie, whose albums Renton so cherishes, dead. The list goes on.

“It hadn’t really occurred to me until afterwards, the mortality…there are so many dead people in the film”, Hodge cheerfully reflects. “These are the people Renton and Simon (Sick Boy) have grown up idolising and they are all disappearing. To me that’s part of the film – loss. It’s what Renton talks about, the people you love…disappearing.”

As Hodge’s remarks suggest, anyone who goes to T2 expecting just a romp may be taken by surprise. The film takes a despairing as well as comic look at masculinity and middle age.

The ‘T2’ screenwriter John Hodge at the premiere of the ‘Trainspotting’ sequel

“Young people tend to be more reckless and self-destructive. We know in cinema that watching people being reckless and self-destructive can be really entertaining…but when you get to 40, 50, you’re not so reckless and self-destructive. If you are, it’s not so admirable. It’s more tragic. That’s the shift,” Hodge explains. “Life can be terrible when you’re 20-something and there’s still hope. Life can be OK when you’re 50-something but there’s no hope!”

In T2, the four main characters are continually reminded of their pasts. This, Hodge, in his early 50s himself, insists, isn’t just an attempt to invoke the best moments in the original film. “You can’t separate who they are from where they’ve been and what they’ve done.”

Hodge, a qualified doctor turned screenwriter, freely admits that, 20 years ago, he never even considered there would be another Trainspotting film. “In those days, especially in Britain, you didn’t automatically think ‘sequel’,’” he remembers. It was only when Irvine Welsh wrote Porno, his follow up to Trainspotting, in 2002 that director Danny Boyle first thought another film might be possible.

Hodge attempted a first draft of a script. “It wasn’t very good. I think the problem with it was that it was too soon to do anything with the material.” The team didn’t want to make just another film about sex and drugs and violence in downtown Leith. “Not enough distance had gone by to do something new. We just abandoned it really.”

McGregor as Renton and Bremner as Spud in ‘T2 Trainspotting’

It didn’t help, either, that actor Ewan McGregor, who played Renton, had briefly fallen out with Boyle after being passed over for the main role in The Beach (2000). Hodge had thought reviving Trainspotting was a difficult prospect anyway and was happy, as he puts it, “just to let it go by.” It was Boyle who, two or three years ago, suggested that they should try again. The actors were all committed – and it was up to Hodge to come up with a script that satisfied everybody.

Like its predecessor, T2 both celebrates and ridicules Scotland and Scottishness. The two films are flagship productions for the Scottish film industry and Hodge suggests that the barbed humour should be taken with a grain of salt. “The ambivalence about Scotland is just honest. I think of Scotland football fans who’ve suffered over the years. There’s now a fantastic cynicism about the national team and there has been for a long time. It’s humorous and it is despairing.”

Hodge adds that you should have a healthy cynicism about your own country and learn how to “embrace its faults and not have any illusions.” It is quite possible to agree with the sentiments behind Welsh’s famous dictum “it’s shite being Scottish” and still be a patriotic Scot. Hodge’s screenplay can’t resist throwing a few digs about such recent Scottish marvels as the white elephant of an Edinburgh tram service (Renton is one of the few people to have travelled on it) and the Scottish Parliament. The script was written before Brexit and there’s a wry scene in which Renton and Sick Boy apply for EU funding to set up a sauna/brothel to help regenerate Leith.

Just as on the first film, Welsh was supportive of Hodge’s screenplay. “He’s very generous with his creations and the goodwill that he brings with him.”

There are certain areas of expertise Hodge has that not even Welsh can match. For example, thanks to his years practising medicine as a junior doctor first at Old Church Hospital, Romford, and then at St George’s Hospital, Tooting, Hodge has a much better idea of medical details than the average Hollywood screenwriter.

In T2, one character stuck in prison gets himself stabbed so he will be transferred to the hospital and therefore be able to escape. Not long after writing the scene, Hodge was in a bookshop, flicking through a volume on “Britain’s hardest men” and was gratified to find an account of a prisoner in the special unit in Barlinnie in Glasgow who had got a friend to break a mirror and stab him in the back so he could get to hospital. “The plan had gone wrong and he had nearly died. I was quite pleased to see that I had unconsciously imitated life.”

Carlyle as Begbie in Danny Boyle’s ‘Trainspotting’ sequel

As part of his research, Hodge visited Saughton Prison in Edinburgh and quickly realised that it is nearly impossible to escape modern prisons. Getting yourself stabbed is one of the only options.

For all his success both as a screenwriter and as a playwright, Hodge has had one or two misfires along the way. Back in the late 1990s, for example, he scripted a film about a gameshow host called The Final Curtain that was barely released. At least, he got to spend some time with the film’s star, Peter O’Toole. There are stories of O’Toole naked in his dressing room with a glass of wine after a day’s shooting and being approached by the production staff, asking if there was anything they can get him. “Yes, an 18-year-old seamstress,” O’Toole replied.

When Hodge talked with him at the “wrap” party, O’Toole told him that he wanted Hodge to go away and write him a script on a subject that had never been dealt with in cinema before, “a love affair between an older man and a young woman – ‘a complete love affair that is emotional, spiritual and sexual.’” Hodge had to tell him, “Peter, the whole of Hollywood is predicated on that idea.”

Another recent Hodge screenplay was for Stephen Frears’ The Program, about disgraced American cyclist Lance Armstrong. Ask Hodge about the recent controversy surrounding Team Sky and British cyclist Bradley Wiggins’ use of “therapeutic use exemptions” to take banned drugs and he can’t help but express his dismay. “I find it really depressing,” he says. “I really thought maybe it had changed.”

Why, Hodge wonders, did Wiggins never mention that he had been ill before and why didn’t the journalists question him more closely about his need for the medication?

“I would have wanted to know who had made the diagnosis of asthma, how was the diagnosis verified, had you tried other treatments first of all, an inhaler (for example). Why did the doctor go straight to giving you the most powerful cortical steroid available – which I’ve only ever seen given to people who are about to be ventilated because they’ve got respiratory failure.”

For a few moments, as he holds forth, Hodge sounds like the doctor he once was. Back on the subject of Trainspotting, I ask if he could envisage a third film (Welsh permitting), perhaps a Last Of The Summer Wine style affair with Renton and co as old skaggies still behaving badly. “God, I hope not. The headache of trying to think up what they could do,” Hodge says but then reconsiders: “I wouldn’t rule it out I suppose.”