Cutscenes (DEX)

DEX files are used to store cutscenes and scripted events. They're found in the episode/ folder, specifically the files starting with e (episode/e0001, episode/e0046, etc). They're closely related to DEP files, which control the triggers for cutscenes/scripted events. For each DEX file, there's a matching DEP file with the same name, minus the e.

Carbonizer exports DEX files as .dex files, which are written in a custom language. If you use Notepad++, you can install this custom syntax highlighting file for it in Language > User Defined Language > Define your language... > Import.... From then on, it'll show up in the Language menu for you to use.

Events

A DEX file is split up into a number of events. Each event is simply a list of commands that run in order, from start to end. Each event also has an ID number, stored in the matching DEP file.

Events are the building blocks that make up cutscenes. They can be as short as a single command, or as long as an entire cutscene. Cutscenes are usually made up of more than one event though, because an event always plays from start to finish. If a cutscene has a dialogue choice, or a different line of dialogue depending on a condition, it needs to be broken up into multiple events, for each possible case.

An example of this is fossil battles. When a Fighter challenges you to a battle, there are 5 different events involved:

Commands

There are many different commands, each one having an ID number and a list of arguments. Each command does something unique, like showing a line of dialogue, moving a character, or triggering a battle.

Argument types

Argument typeDescription
<boolean>Either <true> or <false>
<degrees>An angle. <0 degrees> is facing right and <90 degrees> is facing down
<dialogue>A line of dialogue
<effect>An animated effect that pops up on an entity, like "haha" or "ugh"
<entity>An entity
<fixed-point>A fixed-point number, which can have a fractional component
<flag>See Flags
<fossil>A particular fossil (see Fossils)
<frames>A number of frames
<image>An image
<integer>A whole number
<map>An area of the world, like a room or digsite
<movement>An animated motion an entity can make, like spinning around or falling over
<music>A music track
<sound effect>A sound effect, like a chime or ding
<unknown>An argument whose type is unknown
<vector>This is techncally two arguments, but they make a pair together, like coordinates (for example, <50, 181>)
<vivosaur>A vivosaur

FF1 Commands

1dialogue <dialogue>
Show example
2centered dialogue <dialogue>
Show example
3unknown 3 <flag>
4clear flag <flag>
Used to wipe data for dialogue answers, and possibly mark events as having not played? i'm not sure what the difference is between this and set false (or set 0).
5set flag <flag> to true
6set flag <flag> to false
7spawn <entity> in <map> at <vector> facing <degrees>
8spawn <entity> at region <integer>
The map files define a bunch of 'regions' where an entity can spawn at. For example, the place you stand in the Fossil Stadium lobby after successfully leveling up is one such region.
9spawn <entity> at region <integer> facing <degrees>
10teleport <entity> to <entity>
14despawn <entity>
20fade out <frames>
21fade in <frames>
22fade out to white <frames>
23fade in from white <frames>
26disable episode file <integer>
Each episode file is enabled or disabled individually. When a new save is created, only episode 1 is enabled, and it has to enable whatever other files it wants to run.
27enable episode file <integer>
32unowned dialogue <dialogue>
Show example
33dialogue with choice <dialogue>, storing result at <flag>
Show example
34turn <entity> to <degrees>
35turn1 <entity> to <degrees> over <frames>, unknown: <unknown>
36turn <entity> towards <entity> over <frames>, unknown: <unknown>
37turn2 <entity> to <degrees> over <frames>, unknown: <unknown>
38turn <entity> towards <entity> over <frames>, unknowns: <unknown> <unknown>
39move <entity> to <entity> over <frames>, unknown: <unknown>
40unknown 40: <entity>, <entity>, <frames>, <unknown>
41unknown 41: <entity>, <unknown>, <frames>, <unknown>
43move <entity> to position <vector> over <frames>, unknown: <unknown>
44unknown 44: <entity> <vector> <frames> <unknown>
Probably something related to moving or turning the entity.
45move <entity> by <vector> over <frames>, unknown: <unknown>
47turn <entity> by <degrees>, then move by <fixed-point> over <frames>. unknown: <unknown>
50smoothes out movement or something for <entity>
51control <entity>
Causes the player to control a different entity!!! Normally this is used during cutscenes to move the camera's focus without moving Hunter, but it still works when not in a cutscene >:)
55dialogue <dialogue> with choice, storing result at <flag>, unknown: <unknown>
Show example
56delay <frames>
Simply does nothing for a number of frames. Fossil Fighters runs at 60fps, so delay <60 frames> delays for one second.
57battle <integer>, storing result at <flag>
58clean1 <fossil>, unknown: <unknown>
59clean2 <fossil>, unknown: <unknown>
60clean3 <fossil>, unknown: <unknown>
61angle camera from <vector> at distance <fixed-point> with fov: <fixed-point> over <frames>, unknown: <unknown>
62unknown 62
63unknown 63
70set flag <flag> to <integer>
71add <integer> to flag <flag>
72subtract <integer> from flag <flag>
75set flag <flag> to flag <flag>
80make <entity> follow <entity>
82make <entity> wander randomly, waiting between <frames> and <frames>, walking speed <fixed-point>, distance up to <fixed-point>
The entity waits a random number of frames within a given range, then walks to a random position within a certain distance of their 'home', which is just wherever they were when this command was executed.
86make <entity> chase player, detection range <fixed-point>, run distance <fixed-point>, chasing speed <fixed-point>, returning speed <fixed-point>, cooldown <frames>
This is used for Denture Sharks and BB Bandits. They'll start chasing the player when they're within the detection range, but won't run farther than a certain distance before turning back. After they give up on chasing the player, they have a cooldown before they'll start chasing again.
90set fighter level to <integer>
91set case page count to <integer>
97set <vivosaur> fossil scores to <integer> <integer> <integer> <integer>
99disable dino medals
100enable dino medals
102open fossil rock buying shop
103open fossil rock selling shop
104open mask buying shop
106open mask wearing shop
107give <fossil>, dark: <boolean>, red: <boolean>
Fossil rocks given by this command have their names shown in the case. A message is shown to the player that they have recieved a new fossil rock.
108give <fossil> without message, dark: <boolean>, red: <boolean>
Fossil rocks given by this command are called "New Fossil Rock" in the case.
112play animation <integer> on <entity>
113loop animation <integer> on <entity>
114set <entity> body model variant to <integer>
Each entity actually has two models: one for the head, and one for the body. Each model can have multiple variants, like the player character's different outfits, or Dr. Diggins's caveperson outfit.
115set <entity> head model variant to <integer>
117start music <music>
118start ambient music
This starts whatever the default music is for the current room/area.
119start music 2 <music>
124fade music <frames>
125play sound <sound effect>
128unknown 128, unknowns: <unknown> <frames>
129effect <effect> on <entity>
131clear effects on <entity>
134wait for a-press
135movement <movement> on <entity>
136unknown 136: <entity> <unknown>
137unknown 137: <entity>
138shake screen for <frames> with intensity: <integer>, gradual intensity: <integer>
142modify player name
Allows quitting out of the dialog without changing the player's name.
143set player name
Requires the player to submit a non-blank name to exit the dialog.
144dialogue <dialogue> with choice <dialogue>, storing result at <flag>
Show example
145dialogue <dialogue> with choice <dialogue>, storing result at <flag>, unknown: <unknown>
Show example

Note that the G banner in the corner is unrelated to this command, it's controlled by commands 202 and 203.

150level-up animation
153fade in image <image> over <frames> on bottom screen, unknown: <unknown>
154fade out image over <frames>, unknown: <unknown>
155slide in image <image> over <frames>, unknowns: <unknown> <unknown>
156slide out image over <frames>, unknowns: <unknown> <unknown>
157fade in image <image> over <frames>, unknowns: <fixed-point> <unknown>
159fade in image <image> over <frames> on top screen, unknown: <unknown>
180disable sonar over <frames>
Command 181 enables the sonar, but its <frames> argument is optional, which carbonizer doesn't support yet, so it's considered 'unknown' for now.
190access fossil museum
191show revival screen for <vivosaur>
194unknown 194: <entity>
200start turning <entity> to follow <entity>
201stop turning <entity>
202show G banner
203hide G banner
206set <vivosaur> battle points to <integer>

FFC Commands

71dialogue <dialogue>
107unowned dialogue <dialogue>