Onetime Enterprise commander Jonathan Frakes recently “took the con” — in more ways than one — at ABC’s Castle, directing an episode that lands its titular novelist (played by Nathan Fillion) at the “Supernova” convention where a murder happens to take place.

Frakes, whose recent directing credits also include Falling Skies (where he’s currently lensing a Season 3 episode), Burn Notice (next on his itinerary) and Leverage, gave TVLine a peek at the stellar genre-TV riff coming your way this Monday at 10/9c.

TVLINE | You directed Castle before, during Season 2. But how did this especially apropos assignment come to you?
Rob Bowman, who was one of our lead directors on Star Trek [The Next Generation] and is now the producing director on Castle, called me and said, “We’re going to juggle the episodes around so the assignment you get will be this Comic-Con/Dragon-Con convention episode,” because of how familiar I am with that world. And then [Castle creator] Andrew Marlowe admitted that he himself was in fact a “nerdist,” so… [Laughs] I liked the idea and we had a ball doing it.

TVLINE | How would you say the tone of this episode differs from the first Castle you directed?
The tone for this is so much lighter. There is so much more comedy – in spite of the fact, obviously, that there is a tragic murder to begin the episode. The canvas of the show is filled with double entendres, it’s a wonderful episode for Beckett (Stana Katic) to reveal her fangirl side, there are inside jokes and Easter eggs peppered throughout…. There are Firefly and Star Trek references, Nathan does an incredible Bill Shatner impersonation at one point, Armin Shimerman from [Star Trek] Deep Space 9 is in it as sort of a “mad scientist,” the captain of the [Nebula-9] ship is Ed Quinn from Eureka… It’s a very clever episode to begin with, and for those who are fans of different shows, there will be added pleasure.

TVLINE | You mentioned Beckett’s “fangirl side” — what do you mean by that?
We’re about to learn that when she was at Stanford, she dressed up like this mythical character, “Lieutenant Chloe,” who was on [the show within the show] Nebula-9 — and there’s photographic evidence of that period of her life that, as you could imagine, entrances Castle.

TVLINE | What unique set pieces did you get to work with for this episode?
Alfred Sole, the production designer, created – which is rare for episodic television – the entire bridge of a spaceship. A full 360[-degree] bridge, with green-screen projection…. It was like our bridge on the Enterprise, but completely different in terms of design and style and architecture. He also recreated the floor of a convention center in an interesting way. I must also give credit to Luke Reichle, the costume designer — some of the hundreds of extras we were able to bring in had their own costumes, but others [needed wardrobe]. It’s not lost on us that this is airing around Halloween, because it is filled with people in costume.

TVLINE | I imagine a lot of the costumes are generic, though, that you couldn’t really have people in Imperial Stormtrooper or Picard outfits.
Right. There was generic stuff, but because of ABC’s connection with Disney and Marvel’s connection with Castle, we were able to use Avenger design elements in the booth where Richard is signing his newest graphic novel.

TVLINE | Speaking of which: Did your cameo as a Rick Castle superfan make the cut? Last I heard, that wasn’t for certain.
I certainly hope so. It made my cut! [Laughs] When I turned it into Andrew and Rob, it was still in the show. It’s a good little moment, so I suspect it’s still in there.

TVLINE | Were there any instances where, because of your particularly qualified knowledge base, you tweaked something to make it a bit more on the nose?
I did. For example, on the second or third day that a fan is at a convention in his or her costume, the costume looks a little bedraggled, and their hair is a little more matted, nothing looks quite perfect…. That touch of realism makes the convention floor really feel like a Comic-Con or Dragon-Con.

TVLINE | Right, you don’t want anyone looking like they just grabbed a fresh costume off a TV series’ wardrobe rack.
Exactly. They’re sort of ill-fitted, some of them look handmade…. It was very realistic in that regard.

TVLINE | Would you say the episode pays tribute to as much as winks at the whole sci-fi convention experience? This is no Bill Shatner/”Get a life” thing, right?
No, it’s not like that at all. It’s much more celebrating the ability to dress up as a character you believe in and be in an environment in which that’s a safe place to express yourself.

TVLINE | Is there any time along the way for romantic moments for Castle and Beckett?
Ohhh, wait ’til you see the last scene of the show….

TVLINE | I have a good idea, based on the “Lieutenant Chloe” costume thing you mentioned before. I mean, I know what I would ask for if I was Rick….
There ya go. Spoiler alert!Follow @MattMitovich