Professor Moriarty

Self-aware holodeck villain

Professor Moriarty was a holodeck version of the Sherlock Holmes villain who became self-aware aboard the Enterprise-D and longed to live outside the holodeck.

Professor James Moriarty began as a character in a Sherlock Holmes program on the Enterprise-D. When Geordi La Forge asked the computer to create an adversary able to defeat Data, the computer gave Moriarty a mind of his own. He became aware that he was a hologram, gained control of the ship's systems and took Dr. Pulaski hostage, but agreed to release the ship when Picard promised to find a way for him to exist outside the holodeck. His program was then saved in the ship's memory.
Years later Reginald Barclay accidentally reactivated him. Angry at being forgotten, Moriarty took control of the Enterprise and demanded that he and his love, the holographic Countess Regina Bartholomew, be allowed to leave. Picard and Data tricked him into believing he had succeeded, while in fact the couple were placed in a simulated universe inside a memory module.
Moriarty was one of the earliest Star Trek stories to treat a hologram as a person, a theme later explored through the Doctor on Voyager.