Just days after a gunman opened fire in a gay club in Orlando, Florida, a complex and sometimes contradictory picture of his motivations is emerging. He called 911 during the attack to pledge allegiance to the jihadist group ISIS and its rival, the al-Nusra Front, according to the FBI. He was known to spew hatred against women, Jews, black people and gays, but apparently used gay dating apps and visited Pulse (the nightclub he would later attack) regularly for years, according to multiple people who knew him before the shooting.

As bizarre as these facts are, mixed and murky motivations are standard for so-called lone-wolf attackers, regardless of whether they are defined as terrorists, experts say. There is no template for the path to violence, and rarely can a single cause explain any one atrocity.

What that means is that researchers and others trying to prevent these attacks are focusing less on ideology and more on behavior. One study of lone terrorists of all stripes found that 83 percent had hinted to others about their plans before becoming violent, said Mia Bloom, a professor of communication at Georgia State University who researches suicide terrorism. The Orlando club shooter was reportedly no exception: NBC has reported that his wife told the FBI that she knew of his plans and tried to talk him out of attacking.

No template for violence

The revelation that the Orlando shooter used gay dating apps and frequented Pulse has led to speculation that closeted self-loathing played a role in the shooting. There is some scientific evidence that self-hate can be outwardly destructive. A 2012 study published in the Journal of Personality and Social Psychology found that people with implicit same-sex desires (revealed by word-association tasks) who identified strongly as heterosexual were more likely than those who were more in touch with their sexual desires to show hostility toward gay people.

Parenting also played a role in this association. In the 2012 study, people who grew up in authoritarian households—those with strict, harsh parents—showed larger gaps between their implicit sexual desires and their outward sexual orientation than people raised by more accepting parents. [5 Myths About Gay People Debunked]

The problem with understanding lone-wolf terrorists or mass shooters, however, is that anger or hate alone doesn't predict violent action.

"There is no template," Bloom told Live Science. In the past, many scholars looked at terrorism as a destructive, but basically logical, decision. People born to Irish nationalists in Northern Ireland in the 1950s, for example, might have absorbed political messages from a young age about British oppression and then joined a paramilitary group that matched their ideology, Bloom said.

"What we're seeing more and more is that the logical, normal sequence is out of whack," Bloom said. Jihadist groups such as ISIS recruit in prisons, luring people who have checkered pasts with the promise of personal reinvention or greater meaning in life. Lone actors may use political causes as a veneer of respectability to cover for personal rage or despair, she said.

"You can have multiple, overlapping motivations," Bloom said.

Personal or political?

Some researchers think that even people who seem like straightforward terrorists—suicide bombers, for example—are driven by personal mental-health problems. In his book, "The Myth of Martyrdom: What Really Drives Suicide Bombers, Rampage Shooters and Other Self-Destructive Killers" (St. Martin's Press, 2013), University of Alabama criminal justice professor Adam Lankford argues that mental-health problems are common in suicide attackers. In a sample of 130 suicide terrorists, he found that 44 showed signs of depression, post-traumatic stress disorder or other mental-health issues; 104 had dealt with a crisis event before the attack; 12 had serious physical injuries or disabilities; and 66 had previously lost a loved one unexpectedly. [Mass Shootings: Why It's So Hard to Predict Who Will Snap]

Lankford's analysis goes against the mainstream view of suicide terrorists, which holds that most are psychologically normal, he said. The debate hints at the challenges of understanding motivations across time and culture, especially when a suicide attacker's family or fellow terrorists have a vested interest in making him or her seem sane and devoted to a righteous cause.

Lone-wolf terrorists are less likely to be suicidal than public mass shooters in the U.S., Lankford told Live Science, but many lone wolves suffer from mental-health problems or personal crises that echo those seen in public mass shooters. A terrorist is defined as someone who uses violence in pursuit of political aims, whereas a public mass shooter is generally driven by more personal motivations.

However, these categories can blur and overlap, said Lankford. For example, the shooter who killed African-American congregants at a church in Charleston, South Carolina, ultimately was not charged with terrorism but rather a hate crime. That was a controversial decision, as many saw his desire to start a "race war" as a political motivation.

It can also be difficult to tease out who is ideologically motivated. For example, the shooter who carried out an attack on Virginia Tech in 2007 referred to martyring himself "like Jesus Christ," but isn't usually seen as having religious motivations.

"We just tend to dismiss such claims because we 'know' that Christianity isn't really the explanation for the [Virginia Tech] killer," Lankford wrote in an email to Live Science.

A final complication is that terrorist organizations are constantly changing and adapting. When Israel's security forces started to catch male suicide bombers, Bloom said, terrorist groups started sending women strapped with explosives to checkpoints. In Nigeria, the Islamic militant group Boko Haram has even used children to carry out attacks. ISIS has, at various points, tried to recruit everyone from violent prisoners to do-gooders who feel the urge to help war orphans, Bloom said. The group also exhorts loners with no real connection to ISIS to commit attacks in its name.

"The moment there is a profile, you know what they do? They switch it up, and they change the operative," Bloom said.

Mass shooting intervention

With no consistent profile to use as a guide, researchers and threat-assessment professionals are working to figure out who, among the unstable and rage-filled, might progress to violence. This is not an easy task.

"You can't measure the dogs that don't bite," Bloom said.

Standard measures for violence risk in extremists often fall short. Scientists reporting in a paper published in March in the Journal of Threat Assessment and Management attempted to use a standard risk checklist called Identifying Vulnerable People to determine if that list could have predicted people who committed violence under a host of ideologies, including radical Islam, animal-rights activism, far-right ideology, militant Sikh ideology and the Irish Republican Army. School shooters were also used for comparison.

The checklist turned out to be somewhat reliable in screening Irish Republicans and Islamic terrorists, the researchers found, but it didn't do well at detecting those who committed violence for animal rights, or nonideological school shooters. The screening tool was best used for screening conventional violent extremists, the researchers concluded. Even then, the predictive power is modest, given that violence is a relatively rare outcome.

Another method is to look for red flags in online missives. A study published online in January in the Journal of Crisis Intervention and Suicide Prevention found that automatic text analysis can detect linguistic patterns that predict self-harm or violence toward others. The researchers analyzed suicide notes and legacy videos from active shooters and compared them to writings by typical college students. Red flags from online rhetoric could provide justification for law-enforcement sting operations, Lankford said, though sting operations themselves can be controversial.

Perhaps the best hope for stopping terrorists and active shooters before they kill is to recruit bystanders, Bloom said. By studying the cases of 119 lone-wolf terrorists, scientists found that in 82.4 percent of cases, people around the terrorist knew of his or her grievances prior to the plot; in 63.9 percent of the cases, the attacker actually told at least one other person that he or she planned to take violent action. In nearly a quarter (22.7 percent) of cases, the person issued a direct pre-attack warning, the scientists reported in 2013 in the Journal of Forensic Sciences.

In almost 54 percent of cases, friends and family described the lone-wolf terrorist as angry. Of those, 62.5 percent noted that the person had been increasingly angry leading up to the attack.

In that sense, the Orlando shooter is very typical. Former co-workers and his ex-wife have described him as angry and violent. His father reported that the shooter had flown into a rage after seeing a gay couple kissing. He had been reported and investigated by the FBI in 2013 and 2014 because of talk about terrorism, but those investigations were closed. Though his wife apparently knew of his plans and even accompanied him to buy weaponry, authorities didn't know of the final planning phases of the attack. That's where bystanders could have mattered, Bloom said.

"We need to get rid of the bystander effect," Bloom said. "We need to find a way that if someone says they are planning to do something, that there are safe mechanisms for the individual to report without themselves becoming a suspect or a person of interest. We need to come up with a way of separating the wheat from the chaff as far as people who are serious."

Copyright 2016 LiveScience.com, a Purch company. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.