In the episode "Ship in a Bottle", Lt. Barclay reanimates the Professor Moriarty program, who becomes incensed that Capt. Picard had forgotten his promise to bring Moriarty out of the holodeck. Barclay returns to the holodeck with Picard and Data. In an attempt to explain the issue to Moriarty, Picard calls for the holodeck exit and throws a book through it, which disappears. Moriarty then steps through the exit, to the deck of the Enterprise, surprising the three crew members, who then escort Moriarty to the sick bay. It is only later in the episode that we find out

this "exit" is not the true exit of the holodeck. Moriarty has created a holodeck within the holodeck, and this exit is the boundary between these two imaginary worlds. By stepping through it, the three crew members are now inside Moriarty's embedded holodeck.

Data discovers this at the end of act III. In the mean time, Moriarty gains control of the real Enterprise. Picard realizes that the only way to get Moriarty to give up control is to fool him into thinking he has left the holodeck. Picard does this by

creating his own embedded holodeck, inside Moriarty's embedded holodeck, and tricking Moriarty into entering it.

My question is when does Picard transfer Moriarty into this new level? Some possibilities I have considered:

  1. Picard creates a holodeck program, and the computer immediately transfers Moriarty into it.

    • This doesn't seem in the spirit of the episode.
    • Moriarty has self-awareness, and can sense the passage of time outside of his holodeck existence. It is thus plausible that he would become aware of such a manipulation.
  2. In the middle of act IV, we see Picard at a control panel outside a holodeck, saying "Resume holodeck program." He then enters the holodeck to begin a conversation with Countess Barthalomew.

    • It shows Picard operating (and perhaps programming) a holodeck.
    • This would be consistent with the earlier use of a holodeck exit as the boundary between embedded holodecks.
    • This scene would give Picard the opportunity to enter that level.
    • But this doesn't explain how Moriarty, Data, or Barclay enter that level, as they are absent from this scene.
    • IMHO this is when Picard activates his program, although Moriarty enters it at a later time.
  3. At the end of act IV, Moriarty visits the Countess on the holodeck.

    • Although it is not portrayed, Moriarty would need to pass through a holodeck exit to go from the Enterprise to the holodeck. This would give Moriarty an opportunity to change levels.
    • Moriarty may sense that he has changed levels, but he is expecting a level change anyway (though up, not down).
    • IMHO my recent viewing of the episode has changed my mind toward this possibility.
  4. At the start of act V, Moriarty and the Countess are beamed off the holodeck, to the Enterprise transporter room.

    • This would give the Countess and Moriarty an opportunity to change levels.
    • Moriarty may sense that he has changed levels, but he is desiring a level change anyway (though up, not down).
    • IMHO ever since this episode first aired, this is what I always assumed was the level change, until recently.
  5. Some other possibility.

Is there a canonical answer?

update: It seems to be the consensus among the various answers and comments that my option #2 (scene 33) shows the trap being set but not yet triggered. So let's take that as a given, and concentrate on when Moriarty actually switches levels.

  • 1
    Well researched question! I would upvote this twice if I could.
    – RichS
    Commented Sep 17, 2018 at 4:09
  • 1
    I assumed Moriarty was transferred into "the bottle" when he was on the transported pad.
    – RichS
    Commented Sep 17, 2018 at 4:10
  • 1
    @RichS That's what bounties are for!
    – Davislor
    Commented Sep 17, 2018 at 9:59
  • 17
    A holodeck within a holodeck within a holodeck. 17 years before Inception... Commented Sep 17, 2018 at 10:19
  • 2
    @MasonWheeler - yeah, but Philip K Dick had been there and done it all 28 years earlier.
    – Jules
    Commented Sep 17, 2018 at 19:21

2 Answers 2


The evidence onscreen highly suggests that the transfer happens when Moriarty steps into the holodeck within the holodeck to be with his wife Regina, the Countess Barthalomew, before "beaming" out.

After Barclay comes up with the idea of using pattern enhancers, he goes to one of the holodecks and tries to run the Sherlock Holmes program, which contains the Countess. But it turns out that the program is already running, with the Countess already inside. This indicates that the Library program has been running continuously, and is not usually shut off or paused.

However, just before Picard goes to talk with the Countess, we see that Picard at the simulated holodeck console, and we catch him at the end saying "Computer, resume program." Inside the holodeck, the Countess is waiting. This means he must have paused the Libary program for some purpose. And holodeck programs are often paused when they are altered.

Before being beamed out, Moriarty joins the Countess within the simulated holodeck. Anything after he crosses over can be part of the program. We know for sure that the beam out was fake, so they must've stayed put. Only their surroundings change into the transporter room, from which they travel to a simulated shuttle bay and into a simulated shuttlecraft.

Put all this together, this heavily suggests that Picard was able to alter the program containing the Countess. Hence Moriarty "changed levels" when he entered the simulated holodeck to be with the Countess.

  • 2
    In my answer, the only way Moriarty could actually notice anything is if he ran up on Picard while he was reprogramming the Library program. There shouldn't be any transition in the program to notice--the program was already changed before Moriarty goes into the simulated holodeck.
    – trlkly
    Commented Sep 17, 2018 at 10:55
  • 1
    @trkly - My main concern is that when programs change, there's a sort of 'transition effect' that's pretty consistently shown (along with a swoosh noise). You'd need something to cover that
    – Valorum
    Commented Sep 17, 2018 at 11:00
  • 4
    But that transition effect would be while the Countess's library program was paused, so she wouldn't see it, and Moriarty wouldn't see it because he's not inside the simulated holodeck at the time. Picard only changed the program for the holodeck inside the holodeck.
    – trlkly
    Commented Sep 17, 2018 at 11:03
  • 2
    @Valorum This might clear up your confusion. Moriarty thinks he's walking into the simulation with the countess, he's actually walking into a simulation of another holodeck (contained within another enterprise) containing the simulation of the countess. So beaming him out of it isn't a switch of programs. Commented Sep 17, 2018 at 14:24
  • 4
    What I like about this answer is that it requires Picard to do something that Data cannot do himself. Remember, Moriarty is the opponent that Data cannot beat (but not Picard). Data can easily program a holodeck transporter simulation. But there are numerous instances of Data being bad at persuading people, much less fooling Moriarty to walk into an embedded holodeck. That's the purview of the great diplomat, Jean-Luc Picard. In fact, it was Picard's diplomacy that saved the day in the first Moriarty episode, not Data.
    – DrSheldon
    Commented Sep 17, 2018 at 18:37

My gut instinct is that it was during scene 40, when Moriarty and the Countess beam from the holodeck and rematerialise outside. The disruption of the transport would cover the fact that moving from one program to another isn't seamless.


where they REMATERIALIZE after a slightly more protracted Transporter process than usual. Riker and Worf watch with a certain urgency -- if this doesn't work, Moriarty may not relinquish control of the ship.

Moriarty feels his hands and sides, as if testing their solidity. He and the Countess exchange huge smiles of relief and excitement.

TNG: Ship in a Bottle Screenplay

Note that while our antagonist doesn't see anything especially mind-blowing about the process of beaming a holodeck character into reality, Riker and Worf should be jumping around and pointing at the craziest damn thing that ever happened. Instead they take it completely in stride. That to me is a good indication that they've been programmed rather than acting normally.

As to when Picard actually created the program, that's during scene 33.


Picard at the panel. (NOTE: It is important that Picard be discovered at the panel, not approaching it.)

PICARD: Computer, resume program.


The Countess looks up, curious but not startled by the appearance of this stranger.

TNG: Ship in a Bottle Screenplay

So the transfer could, theoretically have taken place at this point.

  • 1
    This seems the best possible answer, given the screenplay notations.
    – Omegacron
    Commented Sep 17, 2018 at 17:03
  • 2
    The funny thing is the transporter does so many deus ex machina things that I'm not sure there's too many episodes where people are genuinely shocked by the transporter doing something unexpected (only one I know of is The Enemy Within from TOS)
    – Machavity
    Commented Sep 18, 2018 at 3:06
  • 2
    @Machavity That and the fact that they regularly encounter crazy new stuff on a regular basis. Sentient balls of energy? Sentient giant space crystals? Temporal paradoxes? God-like beings? Gotta develop new technology, and even theoretical frameworks, on the fly and cobble together ship components you aren't supposed to mess with? All a standard facet of everyone's resume by this point. Commented Sep 18, 2018 at 3:23
  • 2
    @zibadawatimmy - From what I can gather from Geordi's comment earlier, the likelihood of this happening is about as likely as monkeys flying out his butt.
    – Valorum
    Commented Sep 18, 2018 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.