Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_factory_02_controller_02_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
switch scene
4
{
5
    case 0:
6
        if (obj_pl.y < 340 && obj_pl.x < 520)
7
            cutscene_advance()
8
        break
9
    case 1:
10
        scr_cutscene_start
scr_cutscene_start

function scr_cutscene_start() //gml_Script_scr_cutscene_start { global.cutscene = true obj_pl.state = gml_Script_scr_frozen_state obj_pl.image_index = 0 obj_pl.image_speed = 0 }
()
11
        cutscene_advance()
12
        with (obj_factory_02_conveyor_indicator)
13
            sprite_index = spr_conveyor_indicator_idle
14
        break
15
    case 2:
16
        cutscene_follower_into_actor()
17
        instance_create(obj_pl.x, obj_pl.y, obj_player_npc)
18
        break
19
    case 3:
20
        var arrive = 0
21
        if (cutscene_npc_walk(1168, 350, 300, 3, "x", "up") || (obj_player_npc.x == 350 && obj_player_npc.y == 300))
22
        {
23
            arrive += 1
24
            scene = 3
25
        }
26
        if (cutscene_npc_walk(actor_follower, 370, 300, 3, "x", "up") || (actor_follower.x == 350 && actor_follower.y == 300))
27
        {
28
            arrive += 1
29
            scene = 3
30
        }
31
        if (arrive >= 2)
32
            scene = 4
33
        break
34
    case 4:
35
        cutscene_wait(0.5)
36
        break
37
    case 5:
38
        cutscene_camera_move(360, 210, 2)
39
        break
40
    case 6:
41
        cutscene_wait(1)
42
        break
43
    case 7:
44
        cutscene_dialogue()
45
        with (msg)
46
        {
47
            talker[0] = 1161
48
            message[0] = "* What the"
49
            prt[0] = 393
50
            if (message_current == 0)
51
            {
52
                with (obj_steamworks_factory_02_face)
53
                {
54
                    sprite_index = spr_steamworks_38_face_hello
55
                    image_speed = 1
56
                }
57
                skippable = false
58
                if (cutoff >= string_length(message[message_current]))
59
                {
60
                    global.dialogue_open = false
61
                    instance_destroy()
62
                    other.scene++
63
                }
64
            }
65
        }
66
        break
67
    case 8:
68
        cutscene_music_start(65, 100)
69
        break
70
    case 9:
71
        cutscene_dialogue_special("shake", 65280)
72
        if (obj_steamworks_factory_02_face.sprite_index != spr_steamworks_38_face_talking)
73
        {
74
            obj_steamworks_factory_02_face.sprite_index = spr_steamworks_38_face_talking
75
            obj_steamworks_factory_02_face.image_index = 0
76
        }
77
        with (msg)
78
        {
79
            message[0] = "* Fun!!!"
80
            message[1] = "* Hello again!!"
81
            message[2] = "* The shipment is almost#  complete!!"
82
            message[3] = "* One final step and you may have#  the passcode to exit!"
83
            message[4] = "* All you have to do is   "
84
            if (message_current == 1)
85
                mode = "swirl"
86
            if (message_current == 4)
87
            {
88
                skippable = false
89
                if can_skip
90
                {
91
                    global.dialogue_open = false
92
                    instance_destroy()
93
                    other.scene++
94
                }
95
            }
96
            position = 0
97
        }
98
        break
99
    case 10:
100
        cutscene_dialogue()
101
        with (msg)
102
        {
103
            talker[0] = 1161
104
            message[0] = "* Sort each colored#  package by tilting that#  platform left or right."
105
            message[1] = "* Pretty obvious."
106
            prt[0] = 377
107
            prt[1] = 394
108
            position = 1
109
        }
110
        break
111
    case 11:
112
        cutscene_wait(1)
113
        break
114
    case 12:
115
        cutscene_dialogue_special("swirl", 65280)
116
        with (msg)
117
        {
118
            message[0] = "* Look who paid attention#  learning colors in preschool!"
119
            position = 0
120
        }
121
        break
122
    case 13:
123
        cutscene_dialogue()
124
        with (msg)
125
        {
126
            talker[0] = 1161
127
            message[0] = "* Not by choice."
128
            prt[0] = 382
129
            position = 1
130
        }
131
        break
132
    case 14:
133
        cutscene_npc_direction(obj_ceroba_npc, "left")
134
        break
135
    case 15:
136
        cutscene_dialogue()
137
        with (msg)
138
        {
139
            talker[0] = 1161
140
            message[0] = "* I'll take the#  drop-chute up top, you#  man the platform."
141
            message[1] = "* Good? Good."
142
            prt[0] = 377
143
            prt[1] = 370
144
            position = 1
145
        }
146
        break
147
    case 16:
148
        cutscene_npc_walk(1161, 150, 320, 4, "y", "right", -4)
149
        cutscene_npc_walk(1168, 420, 275, 3, "x", "up", -4, 358, 263)
150
        scene++
151
        break
152
    case 17:
153
        if ((!obj_player_npc.npc_arrived) || (!obj_ceroba_npc.npc_arrived))
154
            return;
155
        cutscene_wait(1.5)
156
        break
157
    case 18:
158
        obj_ceroba_npc.x = 190
159
        obj_ceroba_npc.y = 137
160
        obj_ceroba_npc.npc_dynamic_depth = false
161
        obj_ceroba_npc.depth = 150
162
        cutscene_advance()
163
        break
164
    case 19:
165
        cutscene_npc_walk(1161, 255, 137, 3, "x", "down")
166
        break
167
    case 20:
168
        cutscene_camera_move(360, 170, 2)
169
        scr_audio_fade_out
scr_audio_fade_out

function scr_audio_fade_out(argument0, argument1) //gml_Script_scr_audio_fade_out { var snd = argument0 var fade_len = argument1 if (!audio_is_playing(snd)) return false; audio_sound_gain(snd, 0, fade_len) if instance_exists(obj_audio_fade_helper) { with (obj_audio_fade_helper) { if (audio_to_fade == snd) return false; } } with (instance_create(0, 0, obj_audio_fade_helper)) audio_to_fade = snd }
(cutscene_music, 1000)
170
        break
171
    case 21:
172
        cutscene_dialogue()
173
        with (msg)
174
        {
175
            talker[0] = 1161
176
            message[0] = "* Ready?"
177
            message[1] = "* Here goes nothing!"
178
            prt[0] = 370
179
            prt[1] = 377
180
            position = 0
181
        }
182
        break
183
    case 22:
184
        cutscene_music_start(218, 100)
185
        instance_create(0, 0, obj_factory_02_seesaw_puzzle)
186
        obj_factory_02_seesaw_puzzle.seesaw_puzzle_activate = true
187
        break
188
    case 23:
189
        break
190
    case 24:
191
        cutscene_wait(0.5)
192
        break
193
    case 25:
194
        cutscene_dialogue()
195
        with (msg)
196
        {
197
            talker[0] = 1161
198
            message[0] = "* Phew!"
199
            message[1] = "* Coming back down!"
200
            prt[0] = 394
201
            prt[1] = 370
202
            position = 0
203
        }
204
        break
205
    case 26:
206
        cutscene_npc_walk(1161, 180, 137, 3, "x", "down")
207
        break
208
    case 27:
209
        if (!audio_is_playing(mus_mixin_it_up))
210
        {
211
            with (obj_steamworks_factory_02_face)
212
            {
213
                sprite_index = spr_steamworks_38_face_talking
214
                obj_steamworks_factory_02_face.image_index = 0
215
            }
216
            cutscene_music = audio_play_sound(mus_mixin_it_up, 1, 1)
217
            audio_sound_gain(cutscene_music, 1, 0)
218
        }
219
        cutscene_dialogue_special("swirl", 65280)
220
        with (msg)
221
        {
222
            message[0] = "* Grrreeeat job everyone!!!"
223
            message[1] = "* You can't spell \"Steamworks\"#  without \"teamwork\"!!"
224
            message[2] = "* Can't spell it without \"steak\"#  either but that has absolutely#  no bearing on this situation!"
225
            message[3] = "* Let's see how you did!!"
226
            message[4] = "* Calculating..."
227
            message[5] = "* Aw! You BARELY scraped by but#  that's what performance reports#  are for!"
228
            position = 0
229
        }
230
        break
231
    case 28:
232
        obj_ceroba_npc.x = 180
233
        obj_ceroba_npc.y = 280
234
        obj_ceroba_npc.npc_dynamic_depth = true
235
        cutscene_advance()
236
        break
237
    case 29:
238
        cutscene_npc_walk(actor_follower, 310, 280, 3, "y", "up")
239
        break
240
    case 30:
241
        cutscene_npc_walk(1168, 368, 263, 2, "x", "up")
242
        break
243
    case 31:
244
        obj_ceroba_npc.action_sprite = true
245
        obj_ceroba_npc.sprite_index = spr_ceroba_right_run
246
        obj_ceroba_npc.image_index = 0
247
        obj_ceroba_npc.image_speed = 0
248
        with (obj_ceroba_npc)
249
            path_start(pt_steamworks_factory_02_cerobajump, 4, path_action_stop, false)
250
        cutscene_sfx_play(snd_playerjump, 1)
251
        break
252
    case 32:
253
        with (obj_ceroba_npc)
254
        {
255
            if (path_position >= 1)
256
            {
257
                action_sprite = false
258
                npc_direction = "right"
259
                other.scene++
260
                scr_screenshake
scr_screenshake

function scr_screenshake(argument0, argument1) //gml_Script_scr_screenshake { if instance_exists(obj_screenshake_player) return; with (instance_create(__view_get((9 << 0), 0).x, __view_get((9 << 0), 0).y, obj_screenshake_player)) { alarm[0] intensity = argument1 } }
(1, 1)
261
                audio_play_sound(snd_undertale_thud, 1, 0)
262
            }
263
        }
264
        break
265
    case 33:
266
        cutscene_wait(0.25)
267
        break
268
    case 34:
269
        cutscene_npc_direction(obj_ceroba_npc, "up")
270
        break
271
    case 35:
272
        cutscene_dialogue()
273
        with (msg)
274
        {
275
            talker[0] = 1161
276
            message[0] = "* Hey! It isn't our fault#  this system is so#  impractical!"
277
            message[1] = "* Why does it take two#  giant steps to ship a#  few packages?"
278
            message[2] = "* Why can't we sort the#  colors when boxing them#  in the first room??"
279
            prt[0] = 368
280
            prt[1] = 394
281
            prt[2] = 371
282
            position = 1
283
        }
284
        break
285
    case 36:
286
        cutscene_wait(1)
287
        break
288
    case 37:
289
        cutscene_dialogue_special("default", 65280)
290
        with (msg)
291
        {
292
            message[0] = "* ..."
293
            message[1] = "* Beats me!"
294
            position = 0
295
        }
296
        break
297
    case 38:
298
        cutscene_dialogue()
299
        with (msg)
300
        {
301
            talker[0] = 1161
302
            message[0] = "* You know, for being#  built by such great#  minds..."
303
            message[1] = "* The Steamworks are#  awfully convoluted."
304
            prt[0] = 368
305
            prt[1] = 368
306
            position = 1
307
        }
308
        break
309
    case 39:
310
        cutscene_dialogue_special("swirl", 65280)
311
        with (msg)
312
        {
313
            message[0] = "* It takes a MASSIVE IQ to#  understand the complexities of#  the Steamworks."
314
            message[1] = "* Your brain probably isn't#  advanced enough!"
315
            position = 0
316
        }
317
        break
318
    case 40:
319
        scr_audio_fade_out
scr_audio_fade_out

function scr_audio_fade_out(argument0, argument1) //gml_Script_scr_audio_fade_out { var snd = argument0 var fade_len = argument1 if (!audio_is_playing(snd)) return false; audio_sound_gain(snd, 0, fade_len) if instance_exists(obj_audio_fade_helper) { with (obj_audio_fade_helper) { if (audio_to_fade == snd) return false; } } with (instance_create(0, 0, obj_audio_fade_helper)) audio_to_fade = snd }
(mus_mixin_it_up, 300)
320
        cutscene_dialogue()
321
        with (msg)
322
        {
323
            talker[0] = 1161
324
            message[0] = "* Says the wall-mounted#  GIF comprised of three#  pixels."
325
            message[1] = "* You know what?"
326
            message[2] = "* You can take your little#  \"passcode\" and    "
327
            prt[0] = 366
328
            prt[1] = 366
329
            prt[2] = 754
330
            if (message_current == 2)
331
            {
332
                skippable = false
333
                if (cutoff >= string_length(message[message_current]))
334
                {
335
                    global.dialogue_open = false
336
                    instance_destroy()
337
                    other.scene++
338
                }
339
            }
340
        }
341
        break
342
    case 41:
343
        obj_ceroba_npc.image_alpha = 0
344
        cutscene_npc_action_sprite(1168, 2709, 1, true, 0)
345
        if (obj_player_npc.image_index >= 21)
346
        {
347
            obj_player_npc.image_speed = 0
348
            cutscene_advance(41.2)
349
        }
350
        break
351
    case 41.2:
352
        if cutscene_wait(0.5)
353
        {
354
            obj_player_npc.image_speed = 1
355
            cutscene_advance(41.4)
356
        }
357
        break
358
    case 41.4:
359
        if (obj_player_npc.image_index >= 32)
360
        {
361
            obj_player_npc.image_speed = 0
362
            cutscene_advance(41.6)
363
        }
364
        break
365
    case 41.6:
366
        if cutscene_wait(0.75)
367
        {
368
            obj_player_npc.image_speed = 1
369
            cutscene_advance(41.8)
370
        }
371
        break
372
    case 41.8:
373
        if cutscene_npc_action_sprite(1168, 2709, 1, true, 0)
374
            cutscene_advance(42)
375
        break
376
    case 42:
377
        cutscene_dialogue()
378
        with (msg)
379
        {
380
            talker[0] = 1161
381
            message[0] = "* ...Just give us the code."
382
            prt[0] = 377
383
        }
384
        break
385
    case 43:
386
        cutscene_dialogue_special("swirl", 65280)
387
        with (msg)
388
        {
389
            message[0] = "* Of course!"
390
            message[1] = "* The passcode is " + global.factory_code + "."
391
            message[2] = "* Got it?"
392
            message[3] = "* " + global.factory_code + "."
393
            position = 0
394
        }
395
        break
396
    case 44:
397
        cutscene_dialogue()
398
        with (msg)
399
        {
400
            talker[0] = 1161
401
            message[0] = "* Yeah, thanks."
402
            prt[0] = 394
403
        }
404
        break
405
    case 45:
406
        cutscene_dialogue_special("swirl", 65280)
407
        with (msg)
408
        {
409
            message[0] = "* No, thank you, employees!"
410
            message[1] = "* Thank you for making the#  Underground a little brighter!"
411
            position = 0
412
        }
413
        break
414
    case 46:
415
        obj_player_npc.action_sprite = false
416
        obj_ceroba_npc.image_alpha = 1
417
        obj_ceroba_npc.npc_direction = "up"
418
        cutscene_advance()
419
        break
420
    case 47:
421
        cutscene_wait(0.5)
422
        break
423
    case 48:
424
        cutscene_camera_move(obj_pl.x, obj_pl.y, 3)
425
        break
426
    case 49:
427
        instance_destroy(obj_camera)
428
        camera_set_view_target(view_camera[0], 1031)
429
        cutscene_advance()
430
        break
431
    case 50:
432
        if instance_exists(obj_player_npc)
433
            instance_destroy(obj_player_npc)
434
        obj_pl.direction = 0
435
        cutscene_actor_into_follower()
436
        scr_radio_restart
scr_radio_restart

function scr_radio_restart() //gml_Script_scr_radio_restart { with (obj_radio) event_user(0) }
()
437
        audio_sound_gain(obj_radio.current_song, 1, 0)
438
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
439
        global.sworks_flag[36] = 2
440
        break
441
}
442
443
with (obj_doorway)
444
{
445
    if (collision_rectangle(bbox_left, bbox_top, bbox_right, bbox_bottom, obj_pl, false, true) != -4)
446
        event_perform(ev_collision, obj_pl)
447
}