There was a period starting in the late 90s to late 2000s when special effects, stunts and set pieces were thought to bring in the money.
Ohh, that goes back to the late '70s and early '80s, when Lucas and Spielberg pioneered the modern FX-heavy action blockbuster and other filmmakers strove to imitate their success. For that matter, it arguably goes back decades more. Think of all the '50s B-grade monster movies from America and Japan that were all about the special effects and thrills, with story and character taking a back seat.
I remember quite a few summer *cough* Michael Bay *cough* blockbusters in that era were rumored to have been written only after the action sequences have been filmed and the role of the story was simply to link the separate action sequences into some semi-coherent story.
You might be thinking of the second Transformers
movie. Because of the 2008 writers' strike, Bay had to plot out the action set pieces without the help of scriptwriters, and then once the strike ended, he had Kurtzman & Orci assemble a script draft that would tie those set pieces together; but the film wasn't actually shot until after there was a script.
I think Joss Whedon's Avengers have shown that movie audiences do put as much stock in a good story as good action sequences. So hopefully going forward, writers will get more say.
There have always been some good movies that balanced action and spectacle with strong story, but that's never stopped the film industry from churning out plenty of badly-written films. Case in point -- the giant-monster genre of the '50s and '60s was pioneered by some solidly written, thoughtful films, including Them!
in the US and Gojira
) in Japan; but in both nations, those films were followed by a spate of lower-quality films that focused only on the action and spectacle and lacked the sophisticated writing of their forebears.