Scripting Characters - GameGrumpsJointJustice/courtengine GitHub Wiki
Character Commands
Assign Character to Location
CHARACTER_LOCATION [characterName] [backgroundFileName]
characterName - Character to be assigned
backgroundFileName - File name of the PNG background the character is assigned to
Pick Pose for Character
POSE [characterName] [poseFileName]
characterName - Character whose pose is being assigned
poseFileName - File name of the PNG pose spritesheet in the /characters/[characterName] folder to use
Play Character Animation
ANIMATION [characterName] [animationFileName] [speed?]
characterName - Character whose animation is being played
animationFileName - File name of the animation to be played. This is not expected to include the `_ani` suffix.
speed - Optional number parameter to include how quickly the animation should be played. Default is 10.
Combining Commands
The above commands are typically used together like the following:
// First, assign Dan to /backgrounds/lobby.png
CHARACTER_LOCATION Dan LOBBY
// Next, assign Dan to display the /characters/dan/happy.png spritesheet the next time we see him
POSE Dan Happy
// Finally, let's go to the lobby, which should now display Dan with the Happy pose.
JUMPCUT LOBBY
When utilizing multiple locations, you do not have to re-assign the character locations when jumping between them. For example:
// Assign Phoenix and Edgeworth to two different backgrounds
CHARACTER_LOCATION Phoenix COURT_DEFENSE
CHARACTER_LOCATION Edgeworth COURT_PROSECTUION
// We want Phoenix to be Sweaty and Edgeworth to be Confident when we see them
POSE Phoenix Sweaty
POSE Edgeworth Confident
JUMPCUT COURT_PROSECUTION
// Edgeworth should say this next line with the ConfidentTalking.png spritesheet
SPEAK Edgeworth
"Look at me!"
JUMPCUT COURT_DEFENSE
// Phoenix should say this next line with the SweatyTalking.png spritesheet
SPEAK Phoenix
"No, me!"