W.P. Kinsella stands on the baseball field before Game 5 of the 1992 World Series between Toronto and Atlanta. (Rusty Kennedy/AP)

Canadian author W.P. Kinsella, whose novel “Shoeless Joe” inspired the hit film “Field of Dreams,” has died, according to his agent. He was 81 years old.

“He was a unique, creative and outrageously opinionated man,” Carolyn Swayze said in a statement (via CNN). “One of North America’s most prolific and popular authors, he published almost 30 books of fiction, nonfiction and poetry, which were translated into many languages around the world.”

He is best known, however, for his novel that inspired the American film “Field of Dreams.”

Kinsella began writing “Shoeless Joe” as a student at the Iowa Writers’ Workshop in Iowa City near where the story was set. The story, which was published in 1982, follows a farmer who is coaxed in a dream to build a ballpark in a corn field and is visited by the ghost of “Shoeless” Joe Jackson, the White Sox star who was banned from baseball over the 1919 World Series betting scandal.

The 1989 film version, starring Kevin Costner and James Earl Jones, made the phrase, “If you build it, he will come,” one of the most famous movie lines ever.

The film, by the way, actually did build a ballpark in the tiny town of Dyersville, Ia., which still exists today, a concept that delighted Kinsella.

“That’s a real thrill,” Kinsella told the Des Moines Register in 1995. “I get up there every year. It doesn’t matter when you go there; there’s always 40 or 50 people from all over the world playing catch and you can stand there and watch.”

Kinsella chose to end his life with the help of a doctor in Hope, British Columbia, Canada, where doctor-assisted death is legal, according to Canada’s CBC.

Kinsella’s biographer, Willie Steele, hinted that the decision to die on his own terms had been in the works for at least the past few weeks.

“He essentially told me a couple of weeks ago, ‘You know, I’m not going to be here much longer, so whatever questions you’ve got, let’s get them done,'” Steele said in an interview with CBC Radio One’s On the Coast (via CBC.com).

Steele later revealed one of the last correspondences he had with Kinsella, in which he was sent an email.

“I’m a storyteller, in that my greatest satisfaction comes from making people laugh and also leaving them with a tear in the corner of their eye,” Kinsella wrote, according to Steele.

“I think he’s done that for a lot of people,” Steele added.

Kinsella has one last book, “Russian Dolls,” that will be published posthumously, according to his agent.