In simpler times, a toy was a toy, a boy was a boy, and each knew where the other stood. But these days a casual introduction simply won't do. It takes a little marketing.

Tonka Toys, the $88-million toy manufacturer, showed that fact in launching one of the hottest-selling toy lines on the market these days, a set of robot figures called GoBots. The gimmick is that they can be reshaped into cars, trucks, locomotives, or other vehicles.

But that gimmick alone wasn't enough of an edge in the competitive toy market. GoBots were developed by Bandai Company Ltd., a Japanese toymaker, which sold some 20 million of them in Japan, Europe, and Australia before they were introduced here in 1982. But the toys (then called Machine Men) languished on the shelves for a year before Tonka bought the marketing rights. What GoBots needed was a story line.

"You have to establish a play pattern for the boy. He has to know how to use the toy," says Raymond McDonald, Tonka's director of marketing. "It's not enough to say, 'Here, go play with this.' We provide the names and the information, and the kids run with it."

Other successful toy lines were tied in to such films as Star Wars and such cartoon shows as "Masters of the Universe," which provided the story lines. The GoBots had no story, so McDonald, who had marketed the wildly successful Masters of the Universe toy line, called in a Hollywood screenwriter to do a treatment for the toys. Michael Halperin -- who numbers among his credits several episodes of such television series as "The Fall Guy" and "Falcon Crest," as well as the Masters of the Universe story line -- was chosen to pen the "GoBot Bible." In a month's time, he had constructed the story premise, a thinly disguised good-guys and bad-guys plot which divides the GoBots into teams of 16 good and 14 evil aliens from the planet GoBotron.

The toys hit the store shelves in January, priced at $3.29 to $9.99. By April, GoBots ranked as the fourth-best-selling toys in the country and toy stores were complaining of shortages. Tonka reported that a miniseries was in the works and licensing agreements were mounting.

But the market is already getting crowded. In February, Pawtucket, R.I.-based Hasbro Industries Inc. introduced the Transformers, a line of robots that can be twisted into cars, cassette players, and other objects. Ironically enough, the Transformers are also on their second go-round, having been marketed as Diakrons in 1983 by Takara Toys Corp., one of Bandai's chief competitors in Japan.