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.

A DEX file is split up into a number of blocks. Each block is simply a list of commands that run in order. Every block also has an ID number, but it's not stored in the DEX file1.

There are many different commands, and each one takes a different number of arguments. There are multiple types of arguments, such as a character, a line of dialogue, or a sound effect. Each command has an ID number associated with it.

Argument types

Argument type Description
<boolean> Either <true> or <false>
<character> A character
<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 a character, like "haha" or "ugh"
<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 a character 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 whos 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

1 dialogue <dialogue>
Show example
2 centered dialogue <dialogue>
Show example
3 unknown 3 <flag>
4 clear flag <flag>
5 set flag <flag> to true
6 set flag <flag> to false
7 spawn <entity> in <map> at <vector> facing <degrees>
9 spawn <entity> in slot <integer> facing <degrees>
There are many 'slots' in various places across the game's maps, which are specific locations a character can be spawned at. For example, the place you stand in the Fossil Stadium lobby after successfully leveling up is one such slot.
10 teleport <entity> to <entity>
14 despawn <entity>
20 fade out <frames>
21 fade in <frames>
22 fade out to white <frames>
23 fade in from white <frames>
32 unowned dialogue <dialogue>
Show example
33 dialogue with choice <dialogue>, storing result at <flag>
Show example
34 turn <entity> to <degrees>
35 turn1 <entity> to <degrees> over <frames>, unknown: <unknown>
36 turn <entity> towards <entity> over <frames>, unknown: <unknown>
37 turn2 <entity> to <degrees> over <frames>, unknown: <unknown>
38 turn <entity> towards <entity> over <frames>, unknowns: <unknown> <unknown>
39 move <entity> to <entity> over <frames>, unknown: <unknown>
43 move <entity> to position <vector> over <frames>, unknown: <unknown>
44 unknown 44: <entity> <vector> <frames> <unknown>
45 move <entity> by <vector> over <frames>, unknown: <unknown>
47 turn <entity> by <degrees>, then move by <fixed-point> over <frames>. unknown: <unknown>
50 smoothes out movement or something for <entity>
51 control <entity>
Causes the player to control a different character!!! Normally this is used during cutscenes to move the camera's focus without moving Hunter, but it still works when not in a cutscene >:)
55 dialogue <dialogue> with choice, storing result at <flag>, unknown: <unknown>
Show example
56 delay <frames>
Simply does nothing for a number of frames. Fossil Fighters runs at 60fps, so delay <60 frames> delays for one second.
57 battle <integer>, storing result at <flag>
58 clean1 <fossil>, unknown: <unknown>
59 clean2 <fossil>, unknown: <unknown>
60 clean3 <fossil>, unknown: <unknown>
61 angle camera from <vector> at distance <fixed-point> with fov: <fixed-point> over <frames>, unknown: <unknown>
62 unknown 62
63 unknown 63
70 set flag <flag> to <integer>
71 add <integer> to flag <flag>
72 subtract <integer> from flag <flag>
75 set flag <flag> to flag <flag>
80 make <entity> follow <entity>
82 make <entity> wander randomly, waiting between <frames> and <frames>, walking speed <fixed-point>, distance up to <fixed-point>
86 make <entity> chase player, detection range <fixed-point>, run distance <fixed-point>, chasing speed <fixed-point>, returning speed <fixed-point>, cooldown <frames>
90 set fighter level to <integer>
91 set case page count to <integer>
97 set <vivosaur> fossil scores to <integer> <integer> <integer> <integer>
102 open fossil rock buying shop
103 open fossil rock selling shop
104 open mask buying shop
106 open mask wearing shop
107 give <fossil>, dark: <boolean>, red: <boolean>
Fossil rocks given by this command have their names shown in the case
108 give <fossil> without message, dark: <boolean>, red: <boolean>
Fossil rocks given by this command are called "New Fossil Rock" in the case
112 play animation <integer> on <entity>
113 loop animation <integer> on <entity>
114 set <entity> body model variant to <integer>
115 set <entity> head model variant to <integer>
117 start music <music>
118 start ambient music
119 start music 2 <music>
124 fade music <frames>
125 play sound <sound effect>
128 unknown 128, unknowns: <unknown> <frames>
129 effect <effect> on <entity>
131 clear effects on <entity>
134 wait for a-press
135 movement <movement> on <entity>
136 unknown 136: <entity> <unknown>
138 shake screen for <frames> with intensity: <integer>, gradual intensity: <integer>
142 modify player name
143 set player name
144 dialogue <dialogue> with choice <dialogue>, storing result at <flag>
Show example
145 dialogue <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.

150 level-up animation
153 fade in image <image> over <frames> on bottom screen, unknown: <unknown>
154 fade out image over <frames>, unknown: <unknown>
155 slide in image <image> over <frames>, unknowns: <unknown> <unknown>
156 slide out image over <frames>, unknowns: <unknown> <unknown>
157 fade in image <image> over <frames>, unknowns: <fixed-point> <unknown>
159 fade in image <image> over <frames> on top screen, unknown: <unknown>
180 disable sonar over <frames>
190 access fossil museum
191 show revival screen for <vivosaur>
194 unknown 194: <entity>
200 start turning <entity> to follow <entity>
201 stop turning <entity>
202 show G banner
203 hide G banner
206 set <vivosaur> battle points to <integer>

FFC Commands

71 dialogue <dialogue>
107 unowned dialogue <dialogue>

  1. The ID number for a given block is only found in the matching DEP file, which has its own set of matching blocks