Two nights ago, I had a wake for Dennis Hopper with my wife, Tod, and watched Giant. I also asked Cecilia Montiel, a production designer who lives on the same street as Dennis, to put some flowers on his gate. When I heard he was dying, I phoned a couple of times, spoke to the people in the office, and asked them to give Dennis my best regards. The last time I called, I talked to a lady who was either a nurse or the maid. She told me he was sleeping.

I'd like to have seen the old man before he went. In the late 1980s, I was Dennis Hopper's henchman, for a while. Dennis had several henchmen; I was low henchman on the totem pole. No 1 henchman was Paul Lewis, who produced the films that Dennis directed. Paul was loyal to Dennis, and Dennis was loyal to Paul, and from their relationship I learned the importance of having someone experienced and trustworthy among the rag-tag pack of "producers" who attach themselves to an independent film. On Dennis's films, Lewis was always the real producer: making sure hotels were booked, actors got fed, trucks had gas, and the production didn't run out of money.

No 2 henchman was Gary Ebbins, who handled Dennis's day-to-day business as his assistant. Gary was a charming, likable guy, and so was saddled with the worst jobs: telling Dennis's actor friends they hadn't got the part, giving Dennis's aspirant girlfriends the heave-ho. Henchman No 3 was Satya de la Manitou. Satya was Dennis's acting-and-driving henchman, pressed into service when Dennis made a film; you can see him, playing one of Sam Fuller's team of assassins, in The American Friend. Satya was a menacing biker-hippy-looking dude, and one of the more thoughtful, calmer individuals I met during my time in Los Angeles.

I was No 4: the writing henchman, called upon when Dennis needed a quick wash-and-rinse on a script. I attempted to fix a terrible screenplay called Easy Rider 2; that didn't pan out. I studied a draft of Fear and Loathing in Las Vegas he'd received; it convinced me the book was unfilmable. We had more success with a script called Backtrack, which I rewrote with Tod. Dennis was a tremendous boss: unlike the financiers and studio executives, he actually read the script and gave us comprehensible notes on it. And he stuck up for the writers when the money people asked for stupid, contradictory, anti-dramatic things.

I first met Dennis in 1983, when I was casting a film called Repo Man, and looking for an actor to play the principal car thief. Dennis didn't take the part – instead, for more pay, he made a film about road racers on Mullholland Drive – but our meeting stuck in my mind. I kept writing roles for him, though it would be a few years before I could snag him in my net, with Straight to Hell.

Dennis had a reputation for craziness, but to me he seemed crazy like a fox. He was constantly acquiring real estate: at this stage he owned two houses in Venice, California, and the old post office in Taos, New Mexico. Later, his LA compound extended to five houses, three of them designed by Frank Gehry. I lived for a while in the Gehry house closest to the Hopper family's giant, corrugated-metal hangar, filled with crushed window-glass and art moderne. The neighbourhood was a little dodgy back then, so the two houses were connected by a second-storey catwalk, inaccessible to the mean streets below. Venice was, in the 1980s, still a ghetto – the only place in Los Angeles where minorities got to live at the beach. The Repo Man office was just around the corner; I was robbed at knifepoint there. But Dennis loved Venice, never considered moving to a more conventional actor-director pad in Malibu or on Mulholland. Backtrack (aka Catchfire) is, in a way, his homage to the Venice artists' community of which he felt a part: Jodie Foster plays a Cindy Sherman-type artist-entrepreneur – her character lives in Dennis's hangar – and Dennis cast Bob Dylan as a chainsaw-wielding Venice artist modelled after Laddie Dill.

When Jodie goes on the run in Backtrack, her destination is Taos – Dennis's other home. As a director, he was unusually specific to his writers about his locations: Jodie was to hide in Mother Hubbard's shoe on a miniature golf course; on arrival in New Mexico, she was to visit the ancient church at Chamisal, famous for its lithium-impregnated earth. Why Mother Hubbard? Why lithium? We didn't ask him. Dennis knew what he wanted: it was our job, and Paul's job, and Gary's job, and Satya's, to see that he got it. No matter how strange or bizarre the action (he made me play the ghost of DH Lawrence – why?), Dennis was very down-to-earth and practical about achieving it. Dennis the actor specialised in chaotic, drug-crazed, out-of-control roles, but as a director he was always disciplined, always in control.

I was very surprised, when I first went to work for him, not to discover any Harleys in the garage – just the Cadillac. And I was shocked, in a most childish way, to discover my favourite film director was a fully paid-up member of the Republican Party. Dennis had always been associated with the revolution, with anarchy, with … with … it couldn't be! As Laurence Oliver might have remarked: "Haven't you ever heard of acting, dear boy?" Dennis was simultaneously a poster child for 1960s revolt and marijuana-smoking, but he was also a serious director and actor who worked for Henry Hathaway in cowboy films and died, twice, in John Wayne's arms.

Being a paid-up member of the Hollywood community involves certain compromises. And a strong sense of irony. Perhaps due to his ironic tendencies, Wayne and Hathaway thought Dennis was some kind of communist. Dennis told me Wayne came looking for him with a gun, to kill him. This was because Stokely Carmichael, the black radical, had used the F-word in a speech at UCLA, where Wayne's daughter went to school. Wayne blamed Dennis for the 1960s. On the set of The Sons of Katie Elder, young Dennis tried to do some "acting". Hathaway broke him: he made Dennis redo the scene dozens of times until he gave the performance Hathaway wanted, then collapsed in tears. Dennis – exuberant, funny, intelligent Dennis: why was he a magnet for these bozos' negative energy? And who were they? Hathaway was a second-rate studio director who never made a great film, or did anything of lasting value. Dennis, when he had a son, named him Henry.

Dennis acted all his life, but at a certain point he stopped directing. The studios used him as an actor – the crazy guy with the bomb on the bus! The crazy guy with the eyepatch! The crazy guy with the inhaler/bottle/drugs! – but blacklisted him as a director after The Last Movie. Why? Because he turned the film in late? Because the execs couldn't understand it? Because of something Carmichael said? After the brilliance of Easy Rider and the phantasmagorical promise of The Last Movie, Dennis the director wandered in the wilderness. For a few years, an "independent" studio, Orion, gave him director jobs. Colors, with a great cast and soundtrack, should have got Dennis back in favour at the studios. Instead, like Easy Rider, the film was plagued with controversy, which overshadowed the fact that Dennis – allegedly a mad, self-destructive artist-maniac – had made a very solid, mainstream American entertainment movie.

These last directorial efforts were works-for-hire, scripts that had been kicked around for a while. Dennis made them because he needed money for houses, alimony, wives, trips, kids. But he kept plotting to direct his own films. The pictures he wanted to make were Ambrose Bierce Meets Pancho Villa, a mega-western set in the Mexican revolution, and The Monkey Wrench Gang, based on Ed Abbey's immortal novel. Dennis the Republican directing a spirited tale of eco-terrorism starring Woody Harrelson and several other stellar names! The Monkey Wrench Gang would have been quite a picture, but – not entirely surprisingly – it was not to be. Dennis regretted not having made more features: directing films was, to him, his principal work.

One night, sitting at the big glass table in the boss's vast, metal house, going over script pages, I asked Dennis, "What do you want done with your remains? I mean, after you're dead?" Dennis shook his head. "Just wrap me in a blanket and leave me out for the coyotes." It hasn't turned out quite that way, but maybe that's not a bad thing. Dennis is a great director, but his greatest creation is probably that character we all think we know called Fucking Dennis Hopper. Fucking Dennis Hopper is known to both those who sleep in alleys and to princesses at Parisian fashion shows. Great actor, great director, great character, he played dramatic roles, and lived a dramatic life. Nightmare tales were told about him. To me and Tod, he was a great boss. If Dennis went to his reward in a hubbub of battling exes, lawsuits and controversy, well, perhaps he wanted it that way.