Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_cutscene_follower_into_actor

(view raw script w/o annotations or w/e)
1
function cutscene_follower_into_actor() //gml_Script_cutscene_follower_into_actor
2
{
3
    if (global.party_member == noone)
4
    {
5
        cutscene_advance()
6
        return false;
7
    }
8
    actor_follower = instance_create(global.party_member.x, global.party_member.y, global.party_member.npc_actor)
9
    with (global.party_member)
10
    {
11
        switch sprite_index
12
        {
13
            case up_sprite:
14
            case up_sprite_idle:
15
            case up_sprite_run:
16
                other.actor_follower.npc_direction = "up"
17
                other.actor_follower.sprite_index = other.actor_follower.up_sprite
18
                break
19
            case down_sprite:
20
            case down_sprite_idle:
21
            case down_sprite_run:
22
                other.actor_follower.npc_direction = "down"
23
                other.actor_follower.sprite_index = other.actor_follower.down_sprite
24
                break
25
            case left_sprite:
26
            case left_sprite_idle:
27
            case left_sprite_run:
28
                other.actor_follower.npc_direction = "left"
29
                other.actor_follower.sprite_index = other.actor_follower.left_sprite
30
                break
31
            case right_sprite:
32
            case right_sprite_idle:
33
            case right_sprite_run:
34
                other.actor_follower.sprite_index = other.actor_follower.right_sprite
35
                break
36
        }
37
38
        other.actor_follower.depth = depth
39
        instance_destroy()
40
    }
41
    cutscene_advance()
42
    return true;
43
}