Newly-released documents have detailed gunman Thomas Hamilton's paranoia about police and parents in Dunblane.
Thomas Hamilton killed 16 children and a teacher
He killed 16 children and a teacher at Dunblane Primary School in March 1996 before shooting himself.
More than 3,000 witness statements and other documents from the Cullen Inquiry into the shootings have been released.
One witness, who knew the gunman for about 15 years, told police how Hamilton regularly phoned him to complain about people in Dunblane.
"I would say he did have a thing, almost paranoia, about the Scouts, police and parents in Dunblane," the witness told police.
"He felt everyone was against him, really the whole thing became repetitive and very boring. I never paid a great deal of attention when he started."
The witness, who was aged 28 at the time, said Hamilton's grievances seemed to have diminished in the six months before the killings.
"I got the impression that he seemed to be giving up his battles against the various organisations and local authorities," he said.
"I do remember that when he was going on about the problems he was having about his boys' clubs, he would specifically mention Dunblane, mainly the parents who he felt were going about talking about him, he felt they were ganging up on him."
The witness had attended one of Hamilton's boys clubs and had worked in his shop.
He said Hamilton had started phoning him in 1990 after losing touch for several years.
However, the calls became such a nuisance that the witness' family developed a telephone code so he could distinguish their calls.
The man spoke to Hamilton for about 45 minutes the night before the killings.
The files were to have remained secret for 100 years
During the conversation Hamilton complained that his camera business was not going well and said he did not want to spend his life alone.
"This was not the worst I had heard him," said the witness.
"He certainly seemed down, but not as bad as on other occasions."
The documents have been made available after initially being placed under a 100-year closure order.
Another witness told how he confronted Hamilton over pictures he had taken of his partner's young son.
The man said that he and his friends had gone to Hamilton's home in Stirling, where they kicked the front door and demanded that he hand over the photographs.
The police were called and officers found a picture of the boy in the house, although Hamilton was not prepared to hand it over.
The man said: "After a short period of time, we were released by the police, saying that there wouldn't be any charges against us.
"However, the police did say that our allegations against Hamilton would be looked into and that he may already be under investigation."