Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_follower_into_actor

(view raw script w/o annotations or w/e)
1
function scr_follower_into_actor
scr_follower_into_actor

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