Showing posts with label fountain. Show all posts
Showing posts with label fountain. Show all posts

2026-03-28

A fountain+ guide

Fountain+ syntax guide

This is a guide to an extension of the standard screenplay format fountain that, hopefully, will be useful to animators. This is a work in progress (currently at version 0.9.0). For one fountain+ example, click here. For the corresponding animation, check out this touching love story:-), Lucy meets Lenny (youtube, 71 seconds).

The basic idea is to hide carefully crafted syntax that AI video generators (such as flow or kling) can use for generating accurate animations. The [[ KEY: value ]] notes are embedded in the fountain file so they can be read by the converter (fountain2pam, which uses new python functions as well as the parsing of screenplain) to filter out prop, motion cues, and other blocking information. These fountain+ additions are valid fountain notes (hidden by standard renderers such as highland or screenplain or afterwriting), so they do not interfere with the standard screenplay format.

In other words, fountain+ exists to enrich and extend a standard .fountain screenplay so that fountain2pam.py can generate both better PAM JSON blocking and higher-quality AI video prompts (https://github.com/wdjoyner/pam). The idea is simple: put richer production metadata into the screenplay file itself so the same source file can drive PAM animation, prompt generation, and later video assembly.

The guide below was written with the help of sonnet 4.6 (anthropic) and chatGPT (openai).

Basic syntax

[[ KEY: value ]]

Notes may span multiple lines:

[[ KEY: first line
   continuation line ]]

Keys are case-insensitive and terminate at the first colon.

Supported keys

Key Scope Effect
MOOD Scene Visual tone appended to every subscene prompt
SCENE POPULATION Scene / mid-scene Character presence note for AI prompt generation
NEGATIVE Scene / mid-scene Negative prompt text
CAMERA Scene / mid-scene Camera direction override
KIND File Species/type template for character descriptions

MOOD

Use MOOD immediately after a scene heading to specify visual tone, lighting, palette, and general emotional register for all subscenes in that scene.

INT. VENUS CITY OBSERVATORY - NIGHT

[[ MOOD: cool blue-green, holographic, bureaucratic-noir ]]

Use 3–5 strong descriptive terms rather than vague labels.

SCENE POPULATION

Use SCENE POPULATION to tell the converter which characters are present at a given point in the scene. This is especially useful for AI video generation, because it helps prevent missing or hallucinated characters in a shot.

[[ SCENE POPULATION: Governor, Sidel. No other characters. ]]

Update it whenever characters enter or exit:

[[ SCENE POPULATION: Governor, Sidel, then Nona enters. ]]
[[ SCENE POPULATION: Sidel, Nona only. Governor exits here. ]]

In practice, this works best when paired with an updated NEGATIVE note so the active prompt and the “do not render” guidance stay aligned.

NEGATIVE

Use NEGATIVE to supply explicit negative-prompt text for image or video generators.

[[ NEGATIVE: No additional human figures. No crowd. No extras.
   No faces on the dodecahedron. ]]

Update it after entrances or exits:

[[ NEGATIVE: No dodecahedron. No geometric objects.
   No additional human figures. ]]

CAMERA

Use CAMERA when you want to override the converter’s default shot choice.

[[ CAMERA: Wide establishing shot. ]]
[[ CAMERA: slow push in toward the Governor during this exchange ]]
[[ CAMERA: over-the-shoulder from Sidel's perspective ]]

When CAMERA is present, it takes priority over automatic camera heuristics.

KIND

KIND defines a reusable species/type template for character appearance. Place these notes anywhere in the file; they are file-level, not tied to a single scene.

[[ KIND: Venusian | short, green-skinned humanoid, wide-waisted,
   large dark eyes, minimal body hair ]]
[[ KIND: talking dog | four-legged, golden retriever coloring,
   expressive face, wears a small bow tie ]]

Tag a character with a kind on the intro line:

NONA SONNOF [Venusian] — short, early 50s, formidable...
RAMIS [Dog], a compact robot dog with silver-grey joints, trots in.

The converter uses the kind template as a species/type baseline and combines it with the character’s own description.

Prop-character routing via [Kind]

Characters tagged as non-humanoid or special prop-characters can be routed to non-HumanGraph representations when appropriate.

RAMIS [Dog], a compact robot dog with silver-grey joints, trots in.

This allows dialogue to route to prop_say and movement to the proper non-humanoid action such as trot_to.

Complete scene opening example

INT. VENUS CITY OBSERVATORY - NIGHT

[[ MOOD: cool blue-green, holographic, bureaucratic-noir ]]
[[ SCENE POPULATION: Governor, Sidel. No other characters
   until Nona enters at her cue. ]]
[[ NEGATIVE: No additional human figures. No crowd. No extras.
   No faces on the dodecahedron. ]]

The room is a domed observatory. Cool blue-green light from slowly
orbiting holographic planets. Foreground: a long conference table
with a computer terminal. Background: two robot sentinels at sealed
blast doors, status lights blinking amber.

Practical guidance for stronger prompts

1. Put MOOD under the scene heading

Use 3–5 words covering palette, lighting style, and emotional register.

INT. HOSPITAL CORRIDOR - DAY

[[ MOOD: cold white fluorescent, clinical, quietly tense ]]

2. Write the opening action block like a cinematographer

Go near → far, mention the light source early, and end on the overall mood impression.

The room is a domed observatory. Cool blue-green light from slowly
orbiting holographic planets. Foreground: a long conference table
with a computer terminal. Midground: star maps covering the curved
walls. Background: two robot sentinels at sealed blast doors,
status lights blinking amber. The air feels bureaucratic and
slightly ominous.

3. On character introduction, give build/age, wardrobe, and posture

SERGEANT SIDEL [Venusian] — compact, mid-40s, the kind of face
that has followed orders for twenty years and found it agreeable.
Classic Venusian military dress uniform: deep cobalt blue, high
collar, gold piping at the shoulders and cuffs, regulation boots.
Stands at attention: chin up, arms at sides, eyes forward.

4. For prop-characters, describe size, surface, glow behavior, and states

The GOVERNOR OF VENUS — a slowly rotating dodecahedron roughly the
size of a basketball, hovering at eye level above the conference
table. Translucent gold, glowing from within. Each face catches
light differently as it turns. It pulses brighter when speaking.
It goes amber-orange in low-power mode. It goes dark when it exits.
It has no face and needs none.

5. For entrances, describe silhouette, wardrobe, entrance energy, and first gesture

NONA SONNOF [Venusian] — short, early 50s, formidable in the way
that small objects under high pressure are formidable. Futuristic
Venusian business suit: structured but fluid, deep charcoal with
subtle iridescent trim that shifts color in the light. She sweeps
in through the blast doors with the energy of someone who owns
every room she enters.

6. Use parentheticals for gaze or body orientation, not just tone

NONA
(not looking at Sidel — eyes on the Governor)
Every time one fails, the hospital fills up.

7. For “unanimatable” lines, write what the camera sees

A beat. The holographic Earth diagram pulses quietly behind them.
Nobody moves. The room hums.

Anything PAM cannot map directly into blocking may still enrich the AI prompt output.

8. For prop color changes, include color, motion change, and dramatic meaning

The dodecahedron's glow dims from gold to a flat amber-orange.
Its rotation slows. A power-conservation mode — the AI equivalent
of someone putting a hand up and saying "one moment."

9. For on-screen text, add a lead-in line

The dodecahedron's surface turns a corporate amber. Then, in
clean sans-serif:

> PLEASE WAIT...
> THE GOVERNOR OF VENUS
> WILL BE RIGHT WITH YOU.

10. End scenes with a clear final image

Describe what still moves and what emotional scale remains.

Nona stares at the empty air where the Governor was. The
holographic planets continue their silent orbits above her.
She looks very small in the room.

Quick reference card

What you're writing Rule of thumb
Scene heading Put [[ MOOD: ... ]] immediately below
Species / type Use [[ KIND: name | description ]] anywhere in file
Character intro [Kind] tag, then build/age, wardrobe, posture
Prop-character intro size, surface, glow behavior, color states
Entrance silhouette, wardrobe, entrance energy, first gesture
Parenthetical eye contact or body orientation, not just tone
Unanimatable action write what the camera sees
Prop color change color, motion change, dramatic meaning
On-screen text add a context lead-in line
Final image say what remains moving and what the emotional scale is
Population change update SCENE POPULATION and NEGATIVE together
Camera override add [[ CAMERA: ... ]] before the relevant beat
Small accessories remove if they cause generator inconsistency

Subscene prompts

The --prompts output contains per-subscene video prompts in a four-paragraph cinematic format:

[SHOT / CAMERA]          — framing and camera movement
[SETTING / ATMOSPHERE]   — environment, lighting, mood
[CHARACTERS & ACTION]    — who does what, in what order
[DRAMA / CUT]            — what the scene is building toward

Clip modes:

Mode Boundary rule Best for
per-speaker (default) New clip per speaker change Kling and similar
timed Drama-aware 5–10 second windows Strong-consistency generators

2024-01-08

Richard Matheson and "The man who invented the world" (1954)

Richard Matheson (1923-2013) is one of the most well-known of modern American writers. Matheson wrote novels and short stories in the genres science fiction, horror, fantasy, and suspense.
Richard Matheson in 2008 (age 85), from wikipedia

Many of his stories were adapted for film, such as "Twilight Zone" TV episodes (like "Nightmare at 20,000 Feet"), Steven Spielberg's "Duel" (1971) was based on his short story of the same title, "The Last Man on Earth" (1964) (two later adaptations were "The Omega Man" (1971) and "I Am Legend" (2007)), and "Legend of Hell House" (1973), based on his novel "Hell House" (1971).

Matheson also published, in 1954, a short screenplay, "The man who invented the world", which has lapsed into the public domain. In case anyone want to stage it as a play or shoot it as a short, I typed up the screenplay in standard format and posted it here: pdf, fountain. Download and best of luck! (For typos, please email me at fablestofilm@gmail.com.)

2023-01-06

Ernest Lehman and “Sabrina”

Ernest Lehman co-wrote the screenplay for Sabrina (1954) with Billy Wilder. The story is based on the 1953 play “Sabrina Fair” by Samuel A. Taylor.
There’s an anecdote that says that Wilder’s version of the screenplay diverged so much from the play that Taylor was fired due to his objections. It was at this point that Lehman, who had just written the excellent Executive Suite (also starring William Holden) was brought on. I don’t know how true that is.

Another anecdote says that Humphey Bogart was only brought on because Cary Grant was either unavailable or turned it down. In my opinion, Humphey Bogart’s subdued approach to the role is what makes the film work. William Holden, while excellent and perfectly cast, has an acting style too similar to Cary Grant’s. Humphey Bogart provides the perfect contrast to the part.

While similar in some ways to Wilder’s Love in the Afternoon (1957), this film is (IMHO) much much better. Clever twists and turns keep this screenplay moving. I’ve retyped the entire screenplay (the October 7,1953 draft of “Sabrina Fair” called “Final White Script”) in fountain. It is copyrighted and property of Paramount Studios, but if you would like a copy for educational purposes only, feel free to email me at fablestofilm AT gmail DOT com. Hopefully the study of the screenplay will encourage you to rewatch this terrific film.

For more on Ernest Lehman, read the excellent book "Ernest Lehman: The Sweet Smell of Success" by Jon Krampner.

2019-07-02

More lessons from the script for "His Girl Friday" (1940)

I've blogged before, here and also here, about one of my favorite films, His Girl Friday. This film, and its script, are in the public domain. The film screenplay was written by Charles Lederer, a friend of the great writer Ben Hecht, based on the play The Front Page, co-written by Hechtand Charles MacArthur (brother of "genius grant" creator, John D MacArthur).

The script and film largely tell the same story. However, the film changed some character names and also had a different (and better, IMHO) ending than the screenplay. Here is the list of characters:
  • Walter Burns (Cary Grant), head of a newspaper, once married to former newspaper reporter Hildy and still in love with her. He is the antagonist.
  • Hildegard "Hildy" Johnson (Rosalind Russell), once a newspaper reporter who worked for Burns. She is the protagonist.
  • Bruce Baldwin (Ralph Bellamy), Hildy's fiancee, who will give her all she thinks she wants - a house, a normal marriage, etc.
  • Mrs Baldwin (Alma Kruger), Bruce's mom
  • Duffy (Frank Orth), as assistant editor to Burns
  • Louie (Abner Biberman), a gangster friend of Burns
  • Earl Williams (John Qualen), a pitiful (mentally handicapped?) who's on death row, and the one Hildy is trying to save
  • Mollie Malloy (Helen Mack) a young woman who's taken pity on Earl, befriending him.
  • Mayor (Clarence Kolb), he uses Earl's executon to garner votes for his re-election.
  • Sheriff Hartwell (Gene Lockhart), the bumbling sheriff that allows Earl to escape.
  • Joe Pettibone (Billy Gilbert), the messanger carrying a reprieve from the governor, which the mayor and sheriff try to bribe to go away.
    (Pettibone is Pinkus in the script)
  • And several minor characters who play reporters:
    Porter Hall as Murphy,
    Ernest Truex as Bensinger,
    Cliff Edwards as Endicott,
    Roscoe Karns as McCue,
    Frank Jenks as Wilson, and
    Regis Toomey as Sanders (Sanders is Schwartz in the script?, if so, he's also a reporter).
    Pat West as Warden Cooley.
  • Edwin Maxwell as Dr. Eggelhoffer, psychiatrist who interviews Earl to see if he's crazy.
  • Marion Martin as Evangeline (the blonde girlfriend of Louis)

The script is available in various places on the internet as a pdf. It is worth studying. Threads to pay attention to:

  1. The camera directions add a visual feel. Note:
    1. These camera directions take a lot of space on the page, and are considered my many as excessive by today's script standards. Such directions usually are left to the director, besides taking up space on the page.
    2. Today, camera directions are sometimes included, but in an abbreviated fashion. For example, the original
      CLOSE SHOT OFFICE BOY as he bends over paper. We catch a glimpse of the squares of a crossword puzzle.
      
      might be rewritten today as
      OFFICE BOY (15) bends over the crossword puzzle page in a newspaper.
  2. The actor parentheticals add a blocking/physical feel.
    Note:
    These actor directions are considered as excessive by today's script standards. These are usually dropped altogether, but if they are included they're sometimes given in an action line. For instance
    HILDY 
        (with a smile) 
       Hello, Skinny. Remember me?
    
    would simply be
    HILDY 
       Hello, Skinny. Remember me?
    
    Perhaps her happy demeanor would be indicated during her character introduction. But
    WILLIAMS 
         (putting out hand to stroke her hair)
       Don't cry, Mollie, there's nothing to cry about.
    
    might be rewritten today as
    Williams puts out his hand to stroke Molly's hair. 
                 WILLIAMS 
       Don't cry, Mollie, there's nothing
       to cry about.
    
    Usually parentheticals are reserved for tone, eg, if a line is to be read sarcastically. However, one modern script with lots of parentheticals is the script for Saw (2004, written by Wan and Whanell and available online).
  3. The changing dynamic between what Hildy wants externally (husband, house, kids) and what Hildy needs internally (to make a difference, to be respected, to be independent as a professional).
  4. Keep an eye on the dynamic between Walter Burns and Bruce Baldwin, Hildy's two love interests in the story. Observe how their different personalities represent Hildy's different wants. (Energetic, driven and self-confident Burns connects to her internal want of being a good reporter. Shy, legalistic, and conservative Bruce connects to her external want of wanting a stable home and family.)
  5. Pay attention to the changing romantic connection between Hildy and Bruce vs Hildy and Burns.
  6. The lack of "intercuts" wastes a lot of space on the page in the phone conversations between Hildy and Burns. (The others are covered as a one-way dialog, but they involved minor characters.)

Here is a plot summary, based on the script.

A scene of a busy newsroom, one end an elevator and stairs, the other end the windowed-off office of the managing editor, and inbetween a bullpen of activity (called the "City Room"):
* telephone switchboard operators,
* office boys running errands,
* reporters in a hurry.

The elevator doors open and Hildy emerges with her fiancee Bruce. She greets the office boys and operators with a friendly smile and kind words. Bruce is sweet towards Hildy, then she leaves him to wait while she talks to Walter. In her walk along the length of the City Room, the greetings she receives makes it clear she is much loved.

The first scene between Burns and Hildy. They are much more alike than Hildy and Bruce. Burns and Hildy are both fast-talking, tough-minded reporters, with a nose for news. We learn they were once married and that Burns is bothered by the fact that Earl Williams (a criminal with some sympathetic aspects) is to be executed tomorrow. Then they start to bicker over things Burns did that caused Hildy to divorce him (not taking his marriage seriously - allowing the newspaper to take precedence, a curtailed honeymoon, no house that he promised her, etc). Hildy wants him to stop "phoning me a dozen times a day -- sending twenty telegrams ...". Burns wants to get married again.

More wonderful banter. Hildy's insistent she won't return. Burns makes up a lie that Sweeney won't be a work today since his wife is delivering a baby. He begs her to come back to work and offers a raise. She reveals that she's engaged, and to be married tomorrow. She wants to quit the newspaper business. He says she'll be unhappy doing anything else. Burns insists on meeting Bruce.

Burns and Hildy walk the length of the City Room, everyone's quit listening to their banter. Burns whispers to an operator to have his assistant editor call him in the restaurant in 20 minutes. As Hildy’s about to introduce Burns to Bruce, Burns intentionally mistakes Bruce with an elderly office “boy”, profusely flattering him. When Bruce tries to tell Burns that he is the real Bruce, Burns gets rude. When Burns recognizes the real Bruce he insults him snidely and insists on taking Hildy and Bruce to lunch.

At the restaurant, Hildy is warmly greeted by the staff. Burns asks Bruce about the wedding. It’s revealed that his mother will join them and Mom with live with them for the first year. Burns is called away to the phone booth. There he tells the newspaper than Hildy is returning. He returns to the table and fakes being crushed by sudden bad news about his reporter Sweeney. He tries to convince Hildy to help him out this afternoon to help write an article what Sweeney was supposed to write. She refuses. Burns says if she’ll help him, he will buy a $100000 life insurance policy from Bruce. She agrees, with Bruce’s encouragement, provided that it is paid with a certified check.

In the press room of the criminal courts building, reporters are playing cards while waiting for court news. There is a bank of phones at one end of the room for them to use once something happens. They are especially interested in the Earl Williams case, where he may get the death sentence carried out. Hildy enters. They all greet her warmly. "No, I'm not back for good. I'm just covering the Earl Williams story for Mr. Sweeney who had a sudden attack of something but will be all right by tomorrow. No, I haven't made up with Walter Burns...." She learns by talking to the reporters that Williams is delusional and hid out at Molly Molloy. The Mayor orders him arrested. The cop that arrives is killed by Early because he (in his delusional state) assumed he was there to murder him.

Hildy learns that a new psychiatrist (called an "alienist" in the script), Dr. Max J. Egelhoffer, is going to interview Williams. The execution by hanging is creating a big controversy (told in a darkly humorous way by the reporters).

Burns and Bruce have a discussion of the life insurance policy. Burns still loves Hildy and wants her to be his beneficiary of his policy.

On the phone, Hildy warns Bruce not to put the certified check in his wallet, but to put it in his hat instead. (She knows Louis can pick his pocket.) Louis follows Bruce anyway and scams a cop to arrest Bruce claiming Bruce stole his (Louis') watch. Bruce goes to jail, but at least he keeps his hat.

Hildy interviews Earl Williams in his jail cell. He believes the Golden Rule means to "do away with the profit system and have production for use only. There's enough food and clothing and shelter for everybody if we'd use some sense. ... Food was meant to be eaten, not stored away in restaurants while poor people starved; clothing was meant to be worn, not piled up in stores while people went naked." In this way, Hildy established that he lacks the ability to understand the consequences of his actions. Hildy then asks "Is that how you came to shoot the policeman?" Earl answers "Sure. You see, I'd never had a gun in my hand before and I didn't know what to do with it. Well, when I get stuck, I know that there's an answer for everything in production for use. So it came to me in a flash: what's a gun for? To shoot! So I shot. Simple isn't it?"

Back in the press room of the courthouse, Mollie Malloy shows up to berate the reporters for their slanders against Earl. She says "I never said I loved Earl Williams and was willing to marry him on the gallows! You made that up!" Hildy shows up and starts typing up her interview with Earl. Finally, Hildy says "Come on, Mollie. This is no place for you" leading Mollie toward door. Mollie says "They're not human!" Hildy says "They're newspaper men, Mollie. They can't help themselves. The Lord made them that way."

Mollie and Hildy leave together. Bruce calls for her. When she returns she speaks to him and learns he's in jail. She goes to the jail. Convinces the police lieutenant in charge to release him, or else "the Post will run the story of that roulette game on 43rd Street that you brother-in-law runs." The LT lets Bruce out. Bruce tells Hildy he lost his wallet but has his hat.

Hildy and Bruce go back to the press room in a cab. Hildy leaves Bruce in the cab, intent on finishing the interview, then taking the cab directly to the train. Hildy goes back to the press room by herself, types up the interview then takes it to the phone, asks for Burns, and tears it up over the phone. "ear that? That's the interview I wrote... Yes, I know we made a bargain. I just said I'd write it -- I didn't say I wouldn't tear it up." She hangs up.

Earl Williams is being questions by the incompetent Dr Egelhoffer and the Sheriff. Earl escapes just as Hildy is about to storm out of the press room. The reporters rush to the window to watch police search for Earl, gunshots being clearly heard, some even hitting the windows of the press room. Each reporter quickly calls his newspaper, sends in a report by phone, then leaves the press room (presumably to watch the action on the street).

Hildy calls Burns backs and tells him the news about Earl's escape an that she's back on the job. Hildy runs downstairs and corners Cooley, a policeman who witnessed the escape. Hildy brides Cooley (with 450 dollars) to tells her how Earl escaped. Colley agrees.

Reports return to the press room, including Hildy. Some file more reports but they don't know how Earl got his gun. Hildy does (but it hasn't been yet revealed to the audience). They ask Hildy how Earl escaped and she jokingly says "the Sheriff let him out so's he could vote for him." More machine gun fire downstairs and the reporters rush out of the room again. Hildy and Burns have a phone conversation taking 3 pages (at the time, intercuts were not used). We learn that "The Sheriff gave his gun to the Professor, the Professor gave it to Earl, and Earl gave it right back to the Professor -- right in the stomach! Who? No, Egelhoffer wasn't hurt badly. They took him to the County Hospital where they're afraid he'll recover." Burns promises to join her there in the press room. She tells him to hurry, as Bruce is downstairs in a cab. Burns hangs up and tells Louis and his blonde girlfriend to play a trick on Bruce in the cab.

A reporter comes in and files another report by phone. Hildy gets another phone call from Bruce, in jail again. Hildy rushes out again to help get Bruce out of jail.

The Mayor enters the press room looking for Sheriff Hartman. Hartman enters and tells the reporters how to find Earl (at Mollie's). They all run out, leaving the Mayor and Sheriff alone. Another reporter enters and makes fun of both of them, also making clear that the Governor doesn't like the Mayor and conversely, files a report then leaves.

Mayor and Sheriff leave to find a more private room to discuss something important. They go to Sheriff's office and agree that if they don't hang Earl, they will lose the upcoming election. A messenger Pinkus (Pettibone in the film) comes to tell them that Earl has a reprieve from the Governor. The Mayor bribes Pinkus to leave, to return the next day, hoping he can capture Earl before Pinkus returns.

Hildy is in the press room when Louis shows up with $450 in counterfeit bills. She also demands Louis returns Bruce's wallet, which he does then leaves. Hildy is alone when Earl crawls through the window. She gets the gun from him and calls Burns, telling him to hurry over. She gets a call from Bruce and asks him to wait more. Bruce hangs up on her. Mollie shows up and gives Earl moral support.

The reporters want to get in but the door is locked. Hildy hides Earl in the rolltop desk. She asks Mollie to pretend to have fainted, as a distraction. Mollie lays does, closes her eyes and Hildy unlocks the door. Mrs Bardwin (Bruce's mom) shows up and berates Bruce. Mollie recovers and the reporters grill her so heatedly she goes crazy and jumps out the window (Mollie doesn't die). Mrs Baldwin faints. Burns arrives and Mrs Baldwin recovers, very upset. Burns tells Louis to take her out of the room. Burns talks Hildy into focusing on the story and to ignore Bruce for the moment. Hildy begins typing up the story furiously.

Bruce shows up, having been released from jail again. (He bailed himself out.) She keeps typing. Bruce asks for the money she owes him. She gives him $450 (in counterfeit bills), as well as his wallet. He tells her he's going on the 9pm train and tells her to meet him there. Bruce leaves. Burns and Hildy lock the door again. A reporter shows up, demanding to be let in. Burns offers him a job at his paper, tells him to go talk to Duffy right away. Reporter leaves. Burns calls Duffy and tells him to "Stall him along until the extra comes out." Hildy finished her article. Burns kisses her.

Louis returns, says his cab crashed into a police car and he lost Mrs Baldwin. The implication is that Mrs Baldwin is dead. Hildy wonders how she will tell that to Bruce. Burns tells Louis to get some men to haul the desk with Earl in it out of there. Having called the local hospitals with no luck, Hildy gets ready to leave to search for Mrs Baldwin.

The Sheriff shows up with the reporters and demand that Hildy tell them where Earl is. He's about to arrest Hildy and Burns and confiscate the desk when Mrs Baldwin enters, with two deputies. Bruce is there as well, but she has him stay outside the press room. Mrs Baldwin and Burns argue over who kidnapped her. Burns insults her and she leaves. The Sheriff discovers Earl hiding in the desk, then takes him out. The reporters all run for their phone and file a report. The Sheriff returns and puts Burns and Hildy in handcuffs.

Pinkus returns, drunk, and mentions the reprieve to Burns and Hildy and the bride the Mayor gave him. Burns and Hildy use this information to get the Sheriff to release them.

Burns reminds her that Bruce is expecting to meet Hildy at the train station to take the 9pm train and that he (Burns) promised she'd be there. Burns asks Hildy to stay another hour to finish the article, telling her she can make the 10pm train instead. Conflcted, she flips a coin: Heads she goes, tails she stays to write the story. She stays and wires Bruce to call off their engagement. Burns proposes again. She excepts (under pressure from Louis, who kidnaps a judge to perform their marriage ceremony.

After they are married, Hildy learns that Bruce has been arrested again, this time for passing counterfiet money (the money Burns gave him via Louis). As she chases Burns around the table, Louis has the last line, said to the judge: "I think it's going to work out all right this time." (This is not the ending of the movie.)





2016-09-05

Parsing fountain files, 2

This is a continuation of my earlier post, Parsing fountain files. In this post, we show how to use Python to parse a fountain file into a latex file using John Pate's screenplay latex class.

First, we need this code:

def fountain2latex(input_fntn_file, name=""):
    """
    Assumes John Pate's screenplay template is loaded.

    INPUT:
       input_fntn_file could be "/home/wdj/my-script.fountain"
       name could be "draft-2016-08-26"

    OUTPUT:
       latex file of script

    EXAMPLE:

    """
    script_list = character_dialog_list(input_fntn_file)[1]
    dones = []
    output_latex_file = input_fntn_file[:-10]+"-"+name+".tex"
    r = open(output_latex_file,"w")
    char_list = character_list(input_fntn_file)
    f = open(input_fntn_file,'r')
    lines = f.readlines()
    N = len(lines)
    for j in range(6):
        x = lines[j]
 if x[:6] == "Title:":
     title = x[6:]
     dones.append(j)
 if x[:7] == "Author:":
     author = x[7:]
     dones.append(j)
 if "Draft date:" in x:
     script_list[j] = "date"
     dones.append(j)
 if "Contact:" in x:
     script_list[j] = "email"
     dones.append(j)
    # start latex header
    r.write("\\documentclass{screenplay}\n")
    #r.write("\\usepackage{article}\n")
    #r.write("\\makeatletter{}\n")
    #r.write("\\g@addto@macro\\quote\\flushleft\n")
    #r.write("\\makeatother\n")
    r.write("\\begin{document}\n")
    r.write("\\title{%s}\n"%title)
    r.write("\\author{%s}\n"%author)
    r.write("\\maketitle\n")
    r.write("\\newpage")
    r.write("\\vskip .2in\n")
    # finish latex header     
    for j in range(6,N):
        x = lines[j]
 if x[0]=="#":
     r.write("%"+x)
     dones.append(j)
 if x[:3].upper() == "INT" and ("DAY" in x or "day" in x):
            r.write("\intslug[day]{"+x[4:-4]+"}")
     dones.append(j)
 if x[:3].upper() == "INT" and ("NIGHT" in x or "night" in x):
            r.write("\intslug[night]{"+x[4:-6]+"}")
     dones.append(j)
 if x[:3].upper() == "EXT" and ("DAY" in x or "day" in x):
            r.write("\extslug[day]{"+x[4:-4]+"}")
     dones.append(j)
 if x[:3].upper() == "EXT" and ("NIGHT" in x or "night" in x):
            r.write("\extslug[night]{"+x[4:-6]+"}")
     dones.append(j)
        for c in char_list:
            if c in x and len(x)==len(c)+1:
         dones.append(j)
         r.write(" \n")
         r.write("\\begin{dialogue}{"+c+"}")
  for i in range(1,N):
      if j+i"#":
   r.write(lines[j+i])
   dones.append(j+i)
      else:
          break
  r.write("\\end{dialogue}")
  r.write(" \n")
 if x[0]==".":
            r.write("\\noindent \n"+x[1:].replace("#","\#")+"\n")
     dones.append(j)
 if not(j in dones):
            r.write(x+"\n")
    f.close()
    # start latex footer
    r.write("\end{document}\n")
    r.close()
    return "finished writing: %s"%output_latex_file

This will parse a large subset of fountain into LaTeX, using John Pate's template. For example, comments must be entered with a "#" at the beginning. Secondary slugs can't be used, "DAY" or "NIGHT" must be at the end of the line. There are other features lacking. None-the-less, Big Fish is rendered as latex which compiles almost without errors:-).

Works fine under linux, which is the main thing for me. I wrote this over the labor day weekend for fun and don't plan to improve it more, but if you have suggestions, I'm happy to hear them.