When Troy George Skinner sat down at his computer to play games in late 2017, he struck up an online friendship that led to an escalating series of bad decisions.
In February next year, those decisions will send the Auckland man to a United States prison for up to 30 years.
Skinner, 28, made headlines in 2018 after travelling thousands of kilometres across the world to get shot while trying to smash his way into the United States' home of a 13-year-old girl he had met online.
Last week, in a court in eastern Virginia on the US east coast, Skinner cut a plea deal with the Federal Bureau of Investigation. He pleaded guilty to possessing child sex abuse material, described in the US law books as "child pornography", as kidnapping and other charges were dropped.
Now, court documents have revealed Skinner's escalation towards the attempted home invasion and alleged kidnapping.
He encountered the young girl on online gaming platform Steam in December 2017. The platform aims to operate as a global network of gamers, building functions into its system that encourage community and communication.
Through Steam, Skinner had an existing online friendship with someone called Jenni, who was linked to the girl later known in court documents as RD.
Right at the outset, evidence showed Skinner initially believed she was 18. "Nope, I'm 16," she responded. Skinner replied: "Americans always act older than they are."
At some stage over the Christmas-New Year period, the conversation between the pair shifted to the Discord instant messaging app, popular with gamers but with a broad appeal because of its anonymity and privacy features on text and video chat.
During a video call on January 7, 2018, Skinner told her he wanted to be her boyfriend. That was the first video contact that turned sexual and during it, it is clear RD is uncomfortable with the prospect.
She tells Skinner she's in a relationship with someone else and "feels that sometimes she's just being used for her body".
"Okay," says Skinner. "So do you want to stick with just being friends with me?" Yes, she said.
Skinner's lawyer, assistant federal public defender Laura Koenig, later told the court it took a few days before that "relationship" turned again to sex. "And RD, in the Discord chats, is indicating that she wants that."
Koenig: "Is it a perfect relationship? Of course not. I mean, online relationships are just a different beast."
There were thousands of pages of chats between the two. There were also obscene internet memes and, in one case, disturbing rape "fan fiction" featuring a teacher and a student.
Evidence in the case showed they exchanged sexually explicit images. When the sexual contact occurred during video calls, Skinner would capture and save the video without RD's knowledge.
In the weeks that followed, Skinner encouraged her to join him in increasingly graphic sexual displays.
In late January, they talked about meeting in real life. And they talked of the age of consent. Skinner talked of her coming to New Zealand: "It's 16 in New Zealand. It would be fine. It's 16," he told her.
Not here in the US, she replied. If she's under 18, then he would have to be under 21. The discussion went as far as RD pulling up a website that showed the US law for age of consent - evidence he knew he was breaking US law, if not NZ law, the prosecution later said.
In March, RD told him she had celebrated her 17th birthday - in reality, her 14th birthday. Birthdays, arguments with parents, talk of drinking alcohol, homeschooling - RD's life was captured in Skinner's videos and chat logs, even her home address at one point.
The contact was constant until it wasn't. In May, RD brought it to an end. Some messaging continued, including threats by Skinner to self-harm. The final message exchange was on June 4, just over a fortnight before Skinner made yet another catastrophically poor decision.
On June 20, 2018, Skinner flew out of Auckland for Washington Dulles International Airport, about 40 kilometres west of Washington DC. Arriving June 21, he bought a Greyhound bus ticket to Richmond and took a room for the night at the airy and stylish Richmond Hostel.
The next morning, Skinner travelled north to Glen Allen, on the outskirts of Richmond. Once there, he found a Walmart superstore and went shopping off a short list he had written.
In separate purchase, Skinner bought a small pepper spray canister and then, together, a folding pocket knife and duct tape.
The items went into his small rucksack, which held little more than a few pieces of clothing and travel documents, then he moved on.
Skinner's journey was close to its end. Just 30 minutes' drive away was Goochland, the rural township where RD lived. Arriving there, he unfolded the blade from the pocket knife and tried to enter her house.
His first attempt was through a sliding glass door into the basement. He failed but his efforts alerted RD and her mother. Alarmed, the pair retreated upstairs where RD's mother called the girl's father.
RD's mother took with her a pistol and confronted Skinner as he tried to enter through a different door.
Ignoring warnings to leave, he picked up a paving stone and hurled it through a window, smashing a pane. As Skinner reached inside the house, his upper body inside the door and hand stretching for the interior lock, RD's mother fired two shots, hitting him in the neck.
When officers of the Goochland Country Sheriff arrived, they found Skinner lying in a neighbour's yard. What happened, he was asked. I was shot, he replied, trying to break a window to get to my girlfriend.
Nearby, they found his two mobile phones. On one, he had the copy of a graphic sexual video of RD. It had not been opened since he left New Zealand.
Skinner, his lawyer later told the court, was an "immature man who thought he was in love and acted improperly based on that".
The kidnapping and other charges from the June 22, 2018, assault on RD's home would have sent Skinner away for years. As it turned out, the initial court arguments were on charges of "child pornography", as the manufacturer and possession of child sexual exploitation material is described in US law.
Skinner's lawyers tried to argue that Skinner embarked on the "relationship" in New Zealand, where the age of consent was 16 and when he genuinely believed his sexual engagement with RD was legal.
Was it fair to impose the mandatory 15-year minimum sentence for manufacture of "child pornography" when he believed what he was doing was legal - because it was, in his own country?
"And there's absolutely no evidence to suggest that he was looking for a minor to exploit, looking for some young person to exploit sexually."
The prosecution said: "He could have asked her for a picture of her ID or something. He could have done that online."
The case will not go to trial. Skinner has taken a plea deal, accepting he manufactured child sex abuse material featuring RD. The remaining charges were dropped.
Next February, he finds out just how many years - between 15 and 30 - he will spend in a US prison.