STEPHEN Greenhorn has butterflies. On River City's eve of broadcast, the man who headed the writing team is anxiously anticipating how punters at his local caff will react to the new Scottish soap. ''The crunch is going to be when I'm sitting in the Bungalow cafe and listening to people discussing Tuesday night's episode,'' he says. ''If they liked it then I'll be happy; if they're critical I'll be taking notes and phoning up the producers and trying to put some of the things right.''

He is the sort of bloke who could easily pass unnoticed in a busy caff, hunched over a cup of tea and the morning paper. Polite, softly spoken, and dressed unobtrusively in jeans and blue shirt, his natural inclination is to stay out of the limelight his work creates. He describes the official launch party he is due at this evening as ''the final trial to endure''. His career ''hasn't been about being nice to people over cocktails, it's been about speaking to actors in rehearsal rooms and sitting in the back bedroom through there trying to produce a script at three in the morning''.

The 38-year-old from Fauldhouse, West Lothian, could be forgiven for allowing himself to enjoy the attention, being, as he is, one of the most sought-after writers in the country. After winning an Edinburgh Fringe First for the play Heart and Bone (1988), which he wrote while still at Strathclyde University studying English and psychology, he has won further acclaim for Passing Places, which was staged at the

Traverse, Edinburgh, in 1997, and TV projects like Glasgow Kiss for BBC TV Scotland in 2000.

River City, however, has been the biggest commission yet. This is Greenhorn's baby in as much as it is anyone's and, sitting perched on the edge of his sofa in his airy top-floor tenement flat in Glasgow's south side, he looks not unlike an expectant father - nervous, but also excited. The press have already seen the first two episodes and tomorrow night, the residents of the fictional Clydeside town of Shieldinch will open their homes and hearts to TV viewers

in Scotland.

The show has been anticipated with a mixture of eagerness and trepidation: eagerness because the corporation has sunk (pounds) 10m into it, and trepidation because the BBC's last golden hope for prime-time drama, Eldorado, turned spectacularly to dust. It will stand or fall not on critical acclaim but the punters' verdict. The BBC may stop short of bugging water coolers but they will be as anxious as Greenhorn to know viewers' first impressions.

The road has been a long one. It is two and a half years since Greenhorn was ''seduced'' into doing River City over a series of lunches with BBC executives (he had just finished Glasgow Kiss at the time and was reluctant to do more TV straight away) and in that time it has come to dominate his life. ''The more we talked about it over those lunches, the more I realised that what they were offering was unique. It's not very often that people are asked to set up something that is an hour-a-week's worth of drama, 104 episodes a year.''

Talking about it now, it is clear that he has become an expert in the art of making soaps. He already had some experience of writing for established characters with The Bill and the series Where The Heart Is, but preparation for River City involved watching long-running soaps - EastEnders, Coronation Street, Brookside, Emmerdale - and working out a list of do's and don'ts. He had to: with soaps, everyone's an expert.

He is only too aware of this. Mention you have stopped watching EastEnders lately after years of devotion and his soft voice suddenly takes on a sharper tone. Why, he asks, watching attentively. Because the characters started acting out of character. I mean, how did nice-but-wet Laura suddenly become so hard-nosed and what happened to Janine's drug addiction?

He nods. ''I used to watch it on and off and the thing that really annoyed me was when Grant Mitchell left and Phil became Grant. Phil was always the softy and suddenly Phil's going about threatening people with a knife.''

Exactly. So how do you avoid that bind? He draws a deep breath and laughs, a little nervously. ''With luck, skill, and judgment.''

He is determined to learn from the mistakes of soap opera writers and avoid sensational storylines to boost ratings for a week while compromising the characters for a lifetime. ''One of the things that struck me about EastEnders were those phases where it would find a fantastic storyline, like the Slater

storyline, and it would take its time to let that story build and build and build and suddenly it would be required viewing for six or seven weeks because everything would come to a head.

''The storyline that I thought was less successful was the who-shot-Phil one. You move into that realm and you're burying bodies under the patio like in Brookside. We want to root the storylines in a reality that doesn't at a certain point become hysterical. Watching the who-shot-Phil story I was not convinced there were many of the 11 and 12 million audience who were going 'that reminds me of the time I was accused of murder'.''

The scriptwriters' aim is to maintain credibility and keep the dramatic momentum going at the same time: ''It's a balance between having the audience feel that it reflects something in their lives, but slightly magnified, so that they can get the pleasure of working through problems that they've got a sense of empathy with.''

He does not think soaps should be hijacked by helplines. It is more ''forgivable'' for playwrights to write issue-based work because they are only asking the audience for two hours of their time. But with a soap ''it's a betrayal of the characters that people have spent time in getting to know if you start imposing issues''.

''It's not a case of someone scanning the papers and saying, let's give someone breast cancer because it's breast

cancer awareness week in six months' time and we can tie it into a health campaign. It's equally not the case that the show should become a medium for government agencies to phone up and say 'please can you shove in a storyline about glue sniffing or teenage drinking because we think you need to address that'. What the show's about is drama. At the point where the show becomes agenda-led and not character-led, then I think that's when you run into trouble.''

Greenhorn has written only the first three episodes. Most of his work has been concerned with developing the characters and setting parameters so the soap's writing team of 18, which includes respected writers such as Iain Heggie and Ann Marie DiMambro, can take them forward. The first step was to produce a document called the Bible which set out in detail each character's past and present and their possible future storylines.

The next step was to start developing and interweaving the storylines. Then, around a year ago, the production team was engaged and the scriptwriters assembled for the detailed writing. ''Sometimes somebody will stand up and say, 'no, she wouldn't do that'. Those are the best fights where you've got two writers arguing over the soul of the character.'' But no writer can go off on a flight of fancy because the storylines are interdependent. Greenhorn has been the one to see to that.

Not for much longer, though. He is now stepping back from the process and working on the other projects he has put off over the past two years. Never one to take the easy option, Greenhorn has taken on a BBC docudrama called Derailment, which will examine the state of Railtrack over the period of the Ladbroke Grove and Hatfield rail crashes. Based on the Ladbroke Grove inquiry, it will be fact-based, reconstructing real events in a

similar way as Jimmy McGovern's film on the Hillsborough disaster.

The BBC altered its producers' guidelines before embarking on the project. Previously, those stated that people whose lives were to be represented on screen, or their near surviving relatives, must give their approval before the portrayal proceeds. That, says Greenhorn, ''would have meant it would have been very difficult to produce a critical drama, a drama that was critical, for instance, of Railtrack's management structures, because obviously you'd be representing their people and they'd just object to it and it would never get done''.

Greenhorn's other TV project is a drama about the NHS. But both of those will be out of the way by early next year, he hopes, allowing him to write

another play, ''a very restful occupation'' after the ''fraught business'' of TV.

He does not believe his future necessarily lies in TV. ''I've got no intention of abandoning Scottish theatre,'' he says, adding that the prospect of screenwriting is also ''hugely appealing''. But he admits to watching lots of television, ''good and bad''. The shows he sets the video for are American dramas like The West Wing and Six Feet Under, which he would love to work on for a year. Better still, though, would be the chance to do a British West Wing which wouldn't have the ''layer of sugariness''.

''After a while the excitement comes from being asked to do things you haven't done before and not being sure whether you can pull it off or not,'' he says. Scottish audiences will be able to judge for themselves tomorrow night.

River City will be broadcast on BBC1 Scotland twice weekly on Tuesday and Thursdays at 8pm, starting tomorrow.

the life and times of Stephen Greenhorn

l Age: 38

l Education: English and psychology degree at Strathclyde University

l Family: Unmarried. Grew up in Fauldhouse in West Lothian. Greenhorn's father worked for the Co-op and his mother did a variety of jobs as an administrator.

l Career: Came to prominence with Heart and Bone which won the Edinburgh Fringe First in 1989; it was adapted for BBC Radio Scotland the following year. Realised that he should concentrate on writing as a career when he was turned down for a job as night shift petrol pump attendant at an Edinburgh garage. Wrote the road-movie-for-the-stage Passing Places in 1997 which was highly acclaimed when it was staged at the Traverse Theatre in Edinburgh. Last year, he adapted King Matt, a Polish children's fable about an

11-year-old boy who is put in charge of a kingdom, for

TAG, Scotland's national

theatre for young people.

He wrote the romantic drama Glasgow Kiss for the BBC in 2000, the same year work began on River City.

l Current projects: Working on two projects for the BBC, the docudrama Derailment and a

one-hour drama about the NHS.