Devlog #10 - How OTAOD Parses its Script
Hi, everybody! There's been a lot of development work going on behind the scenes, but not a ton that I'm able to show at this moment. So with that in mind, I thought this might be a good opportunity to delve into one of the more technical aspects- how One Thousand Acts of Decency parses the script to make the magic happen. Pose changes, text colors, visual effects, music cues, sound effects, etc, all these are handled by a script I wrote that allows these effects to be integrated seamlessly into the dialogue that's displayed, all without interrupting the actual text being written. Let's dig in to a few examples!
5|<char=5><evidenceshow=22><pose=6><sound=0>Whatever the story is, it's not like any of us could unlock it.
Looking at the code written above, it contains the exact same text depicted in the gif, but with some additional pieces. What do these extra strings mean?
Firstly, the number and the vertical line at the beginning- this is used to determine which character the text box is attributed to. When displaying a line of test, OTAOD's text parser will split up the string- one half is before the vertical line, and the other is after. The first half will always consist of a number which corresponds to a character index (in this case, index number 5, which is Jerry.) The second half will determine what's displayed in the text box.
After the vertical line, we come to a series of strings in triangular brackets. As you've probably surmised, nothing in these brackets is displayed to the player. Instead, the contents are read by the game in order to determine what actions it should take. <char=5>
tells the game to display character 5 (Jerry) on screen if he isn't already. <evidenceshow=22>
directs OTAOD to display the evidence window in the top left, specifically evidence index 22, which is a cell phone. (By the way, the evidence window can be sent away with <evidenceshow=-1>
) <pose=6>
tells the game to make the current character change poses. For this operation, the game will reference whichever character is on screen and choose the pose from that character that corresponds with the specified index (and in that case, it's Jerry's frustrated pose.) Finally <sound=0>
will play the sound that matches index zero. You can't hear it in a gif, obviously, but it's the question-sounding, keyboard-playing-an-augmented-chord sound effect.
0|... <pose=1><prefabbottom=2>I left shortly after it began, likely before he arrived. I had only a few questions to ask.
This snippet is very similar, but there are some key differences I want to point out. Namely, that the <pose=1>
command doesn't appear until a bit through the line. All this means is that the previous pose will be retained until that point. As we can tell from the gif, that's Orville's neutral pose. It's only as he says "I left shortly..." that he switches to his thinking pose. There's also a new command here: <prefabbottom=2>
. This command creates a prefabricated game object, which in this case is a spawner for sparkles. When in this pose, I want the brooch on his scarf to visibly sparkle, so I have the game instantiate a special 'sparkle spawner' that does just that. (And when I no longer need it, it can be instantly deleted with <removeprefabs>
.)
2|Prosecutor DeJure, are you behind the Dome, in any capac-}]
3|<char=3><pose=7>A<sound=9><shake>ctually, Chive, she's <color=1>Chief Prosecutor<color=0> DeJure. <wait=0.2><char=9><pose=2>Please make sure you show her respect.
Finally, we have those two lines. There's a bit more going on, but let's begin with Chive's line. Here, we don't want him on screen, so we do not specify a pose or a character (he's talking to Bertha, so she's free to remain as she is.) Then we come to the end of the line, marked by a closing curly bracket and a closing square bracket. What this ending means is that the game will automatically advance to the next line once it reaches this point as long as the auto-advance setting is on. As for other lines that I always want to advance regardless of the settings (usually timed animations or transitions,) I can omit the square bracket and it will not check for the player's settings before advancing.
Next up is Oscar's line where he chides Chive. There's a command, <shake>
. This one doesn't require a number or any additional argument- it just plays a brief shaking animation through the camera. Then, we see two sets of tags, <color=1>
and <color=0>
. <color=1>
tells the game to write all text from that point in color number 1, which is red.
<color=0>
is similar, telling the game to use color number 0, which is the standard text color. The next command, <wait=0.2>
tells the text crawl to pause for a product of the text speed setting and the number indicated in the command. The game automatically pauses briefly after every punctuation mark (with some exceptions,) but I wanted to add an additional pause before Oscar continues speaking in order to give more room for the player to turn their attention to Bertha.
Another teensy detail that you might have noticed is that the <sound=9>
and <shake>
strings both come between the "A" and "c" in "Actually" rather than before the word entirely. This is because I want to ensure these effects are triggered only after Oscar has fully transitioned to the center of the screen and began talking. Otherwise, they would activate during his appearance, slightly before he started speaking.
I'm not sure how interesting that was, but hopefully you were able to get some enjoyment out of seeing behind the proverbial curtain and getting a glimpse of how the game script works. I'll catch back up with you in a few weeks with another look at the development of One Thousand Acts of Decency. Take care!
Get One Thousand Acts of Decency
One Thousand Acts of Decency
Trapped in a Dome with eight hours to catch a killer
Status | In development |
Author | domedev |
Genre | Visual Novel, Puzzle |
Tags | 3D, Crime, Furry, Mystery, Text based, Unity |
Languages | English |
More posts
- Devlog #9 - Now With a 10x Seating Capacity!14 days ago
- Devlog #8 - The Curious Case of Case Four29 days ago
- Celebrating One Year of One Thousand Acts of Decency!45 days ago
- Case 3 and One Thousand Acts of Decency Mobile are Here!65 days ago
- Devlog #7 - The Home Stretch + A Big Announcement75 days ago
- Devlog #6 - Case Three ProgressNov 19, 2024
- Case 3 Announcement and Teaser TrailerSep 13, 2024
- Case 2 Release - 103,484 Words!Apr 30, 2024
- "One Thousand Acts of Decency HD" AnnouncementApr 01, 2024
Leave a comment
Log in with itch.io to leave a comment.