A life spent as a TV actor on "Sons of Anarchy" and "CSI" prepared this screenwriter to write the biggest indie hit of 2016.

What makes a low-budget movie the must-see indie of the year?

With Chris Pine and Ben Foster as bank-robbing brothers and Jeff Bridges as the Texas Ranger on their tail, David Mackenzie’s “Hell or High Water” (Lionsgate/CBS Films) debuted at Cannes to critics’ raves. And as of October 3, the contemporary heist western passed “The Witch” to become the highest-grossing independent film of the year,with $25.8 million in the till and counting.

“Hell or High Water” is the result of that increasingly rare invention: an original screenplay. It sprang from the mind of Taylor Sheridan, a Texas-born former actor who, in the tradition of “The Last Picture Show” and “Hud” author Larry McMurtry (another Texan whose stories fueled some great Hollywood movies), set his story in the Lone Star State.

Sheridan wrote “Hell or High Water” after his first script, “Sicario,” but “Hell or High Water” sold first. “Sicario” was “toxic,” he said; among other things, it had a female lead.

“I wrote the Spanish dialogue without subtitles,” he said. “It was dark, the act structure didn’t make sense, nobody wanted to make a movie about cartels.” Eventually producer Basil Iwanyk (“The Town”) sent “Sicario” to director Denis Villeneuve; the rest is history (three Oscar nominations, $78.5 million worldwide).

Sheridan sees both films as part of a trilogy of “the modern-day American frontier,” he said, “about how much has changed in 100 years, and how much things haven’t. What are the consequences of decisions and actions that are a century old and today? I was exploring the death of a way of life, and the acute consequences of the mortgage crisis in East Texas.”

CBS Films/Lionsgate

Shortly after the bottom fell out during the debt crisis, Sheridan was visiting McMurtry’s hometown of Archer City. “The towns physically felt abandoned,” he said. “‘Someone should rob this place blind,’ I said. That’s where I got idea for the bank robbers.”

Sheridan never studied writing or went to film school. He learned how to write screenplays from being a TV actor on series like “CSI,” “Sons of Anarchy,” and “Veronica Mars.” “I’m been in some bad TV shows, and suffered through so much poor writing,” he said, “that when I had the opportunity to work on any good writing, it stuck with me. So I pulled up good and bad scripts and compared them and figured out why the good ones stood out and what shortcuts people were required to take in television.”

And Sheridan had no intention of writing a genre western. “It takes place in rural west Texas,” he said. “People in Texas wear cowboy hats, they’re good at keeping the sun off your neck and face. You set something in modern-day Texas, which is so identifiable as the old west, and everyone’s wearing guns, so it looks like it’s going to be by default partially considered a western.”

Actually, he set out to make a “buddy road film which was also a heist thriller, with elements of the inevitable showdown of a western with some of the real consequences of the flawed characters of a real drama,” he said. “I wanted it to feel real. I didn’t want the movie to end and for everyone to go home and forget about it. For me, the greatest thing a movie can do is rivet you while you’re watching, but also give you something to chew on for days and weeks after you’ve seen it. And give you ideas to think about. And maybe show you a bit of yourself you really like or don’t like, and maybe you’re going to effect a little change without the burden of having to experience the lesson.”

Among Sheridan’s primary influences, besides McMurtry, was Peter Berg’s “Friday Night Lights.” “He accurately captured the landscape and the mood of the people of that area,” said Sheridan, who wrote “Hell or High Water” for Berg to direct. He got the script to him and eventually they met. “He sat down with me: ‘Let’s go make it.’ He took it out and found a home for it (Sidney Kimmel Entertainment). Ultimately, he had other obligations and we went looking for a director.”

It took three years to find director David Mackenzie, whose violent prison film “Starred Up” Sheridan admired for its rough authenticity. “That was the most important thing,” he said. “If the film was stylized, it would minimize the impact emotionally of the story.”

Which is how “Sicario” ended up coming out first. In both films, “the characters are fiction, but the landscape and the lives the characters are navigating are real,”said Sheridan. “The only fiction is the actual mechanics of the stories and the names of the characters.”

Sheridan wanted the audience to root for bank robbers Toby (Pine) and Tanner (Foster) “in spite of what they are doing,” which is why the script keeps their motivations obscure for so long. “If you know why they’re doing it from beginning, that they have noble reasons, that would make Marcus (Bridges) the villain. I wanted you to fall in love with these boys and then learn what they’re doing, so you are rooting for Marcus and Alberto (Gil Birmingham) as well. So when you see the inevitable conclusion, you don’t mind if the cars crash together.”

He feels no need to apologize for this being a movie that’s only about men. “Exploring how men relate to men is what this is about,” Sheridan said. “It’s about how emotionally dishonest they can be to themselves and each other and how difficult it is to show someone affection and articulate that. Toby and his brother, all they have is each other. And Marcus has to express his relationship with Alberto through insults and superficial, racist means of expression.”

While Sheridan said Mackenzie directed the movie he wrote, “David was able to find ways to visually riff on the themes with some incredible montages and angles, to expand the sense of loneliness and isolation,” he said. “David created a movie that feels like it was shot in 1973.”

While Bridges and Foster seemed like natural fits, the toughest role to cast was Toby. Said Sheridan: “Who could play Toby and be that still and quiet and be interesting and convey all that emptiness without a word and be that unsentimental?”

When Sheridan met Pine on another project, he suggested him to Mackenzie. “That was Toby. You don’t see it in the studio films, but he’s kind of Gary Cooper decent and a real throwback.”

Next up: Sheridan is writing a remake of the French film “Disorder” for Sony. And yes, he will keep trying to “somehow entertain and enlighten. It’s a lot easier to do one of the two. None of it is easy. It’s easier to go in with the goal of either entertaining, or enlightening. But to try and do both is really hard.”

Sign Up: Stay on top of the latest breaking film and TV news! Sign up for our Email Newsletters here.