Scripting Trials - GameGrumpsJointJustice/courtengine GitHub Wiki

Definitions

Similar to Initializations, these must be configured prior to their use.

Trial Fail Condition

Every trial must have TRIAL_FAIL defined at the start of the trial; this determines what happens when the player runs out of exclamation points.

DEFINE_TRIAL_FAIL
    [Actions that should happen]
    GAME_OVER

END_DEFINE

Example:

DEFINE TRIAL_FAIL
    JUMPCUT COURT_JUDGE
    SPEAK Judge
        "yooooooo phoenix you lost bro"

    GAME_OVER
END_DEFINE

Display full courtroom background with talking heads animation

This animation displays the sprites/TalkingHead_#.png files, while playing mutter.wav.

WIDESHOT

Pound Gavel

This animation displays the sprites/Gavel_#.png files, while playing triplegavel.wav.

GAVEL

Pan the camera from one location to another

This is a court-specific panning animation that supports the following locations:

  • COURT_DEFENSE (far left)

  • COURT_WITNESS (middle)

  • COURT_PROSECUTION (far right)

    PAN [locationToPanFrom] [locationToPanTo]

Example:

// Pan from the middle to the left side of the screen
PAN COURT_WITNESS COURT_DEFENSE

Shout (E.g., Objection, Hold It, etc.)

SHOUT [characterName] [shoutFileName]
 
    characterName - The character that is doing the shouting. This is used to identify the corresponding sound.
    shoutFileName - The file name of the PNG in `/sprites/shouts` that should be displayed during the shout.

Example:

// Will display `/sprites/objection.png` while playing `/characters/phoenix/objection.wav`
SHOUT Phoenix Objection

// Will display `/sprites/shouts/holdit.png` while playing `/characters/edgeworth/holdit.wav`
SHOUT Edgeworth Holdit

Issue Penalty

This command will issue a penalty to the player, deducting 1 from the total penalties allowed. If the player reaches 0, the TRIAL_FAIL definition will automatically be run (so it must be defined before this can happen in the game).

ISSUE_PENALTY

Add Evidence to Court Records

The COURT_RECORD_ADD EVIDENCE [evidenceName] command will add evidence to the player's inventory to be viewable from Court Records UI. However, this will be done "silently", AKA without informing the player of the change.

To add the item along with the corresponding animation, use the following command instead:

COURT_RECORD_ADD_ANIMATION [evidenceName]

Define Presses

The Cross Examination phase of the game requires a "Press" to be defined for each statement given by the witness.

If the press is considered valid (i.e., it won't issue a penalty), you can define it as follows:

DEFINE [internal name for this Press]
    HOLD_IT [character name]
    [Actions that should happen]
END DEFINE

Example:

DEFINE Press1
    HOLD_IT Phoenix
    JUMPCUT COURT_DEFENSE
    SPEAK Phoenix
        "Are you sure it was 4:30PM?"

    JUMPCUT COURT_WITNESS
    SPEAK Gumshoe
        "The time sounds about right, pal. the body was still slightly warm when we got there"

    JUMPCUT COURT_DEFENSE
    SPEAK Phoenix
        "When did you get there?"

    JUMPCUT COURT_WITNESS
    SPEAK Gumshoe
        "Just before 4:45, and you won't believe this..."
END_DEFINE

Note: The "Press" actions should end with the camera on the court witness, so that the cross examination should continue.

Presenting Evidence

Presenting the wrong evidence will warrant a penalty, and this action is defined as follows:

DEFINE [internal name for this Press]
    OBJECTION [character name]
    [Actions that should happen]

    ISSUE_PENALTY
    JUMPCUT COURT_WITNESS
END_DEFINE

Note: You probably want dialogue from the defense for the actual "objection".

Example:

DEFINE CrossExamineFail
    OBJECTION Phoenix
    JUMPCUT COURT_DEFENSE
    SPEAK Phoenix
        "i uhhhh object to that!"

    JUMPCUT COURT_JUDGE
    SPEAK Judge
        "hahaha phoenix you wrong"

    ISSUE_PENALTY
    JUMPCUT COURT_WITNESS
END_DEFINE

Witness Event (I.e., Witness Testimony, Cross-Examination)

Events in which the witness is the main focus, such as when giving their testimony or being cross-examined, will be block formatted with the WITNESS_EVENT command, followed by the type of event, WitnessTestimony or CrossExamination, and additional parameters as follows:

Witness Testimony

WITNESS_EVENT [type] [witness name] "[initial text]"
    "[statement 1]"
    // Additional statements follow the same formatting as statement 1

Example:

WITNESS_EVENT WitnessTestimony Sahwit "-- Witness's Account --"
    "I was going door-to-door, selling subscriptions when I saw a man fleeing an apartment."
    "I thought he must be in a hurry because he left the door half-open behind him."
    "Thinking it strange, I looked inside the apartment." 
    "Then I saw her lying there... A woman... not moving... dead!"
    "I quailed in fright and found myself unable to go inside."
    "I thought to call the police immediately!"
    "However, the phone in her apartment wasn't working."
    "I went to a nearby park and found a public phone."
    "I remember the time exactly: It was 1:00 PM."
    "The man who ran was, without a doubt, the defendant sitting right over there."

Note: At present, WITNESS_EVENT does not support changing the background for a given statement.

Cross-Examination

Cross-examinations follow the same formatting as a witness's testimony, but with additional parameters, namely the failure definition, presses, and conflicting evidence (that is, the evidence needed to successfully end the cross-examination).

WITNESS_EVENT CrossExamination [name] "[initial text]" [name of failure definition]
    "[statement 1]" [name of corresponding Press] [conflicting evidence (or 0 if none)]
    // Additional statements follow the same formatting as statement 1

Example:

WITNESS_EVENT CrossExamination Sahwit "-- Witness's Account --" CrossExamFail
    "I was going door-to-door, selling subscriptions when I saw a man fleeing an apartment." PressA1 0
    "I thought he must be in a hurry because he left the door half-open behind him." PressA2 0
    "Thinking it strange, I looked inside the apartment." PressA3 0
    "Then I saw her lying there... A woman... not moving... dead!" PressA4 0
    "I quailed in fright and found myself unable to go inside." PressA5 0
    "I thought to call the police immediately!" PressA6 0
    "However, the phone in her apartment wasn't working." PressA7 0
    "I went to a nearby park and found a public phone." PressA8 0
    "I remember the time exactly: It was 1:00 PM." PressA9 BlackoutRecord
    "The man who ran was, without a doubt, the defendant sitting right over there." PressA10 0

Once the correct conflicting evidence is presented, the script will continue on past the WITNESS_EVENT.