Page 1 of 1

Action Call() cannot find the label

Posted: Fri Jan 08, 2021 2:59 pm
by Kun
So have this code

Code: Select all

        imagebutton:
            idle "view"
            hover "view"
            action Call(sien_hana_dscg)
            xpos 1750
            ypos 170
            
the problem is that even though the sien_hana_dscg label is defined. It comes with the name error.
When I try to jump from the screen, it works fine as well.

Any idea?

thanks!

Kun

Re: Action Call() cannot find the label

Posted: Fri Jan 08, 2021 3:10 pm
by Alex
Put the label name in quotes, otherwise Ren'Py treat it as a variable named 'sien_hana_dscg'.

Code: Select all

action Call('sien_hana_dscg')

Re: Action Call() cannot find the label

Posted: Sun Jan 10, 2021 9:48 am
by Kun
hmm.. seems like the button itself is not working anymore.

Code: Select all

        imagebutton:
            idle "view"
            hover "view"
            action Call('sien_hana_dscg')
            xpos 1750
            ypos 170
The button is pressing, but not 'action'ing anything.
and, I do have 'sien_hana_dscg' label as this

Code: Select all


label sien_hana_dscg:
    call black from _call_black_29
    play ambient home
    call living_jump(time="          8:00 AM (Morning)", night=False) from _call_living_jump_2
    
    s "heya"


Re: Action Call() cannot find the label

Posted: Sun Jan 10, 2021 9:54 am
by Kun
ohh no. it works.... kinda

So the problem next is that I am calling this from the main menu title.
and when I press the button. It calls that and just goes into the first line of the game.

Any way we can solve this?

Re: Action Call() cannot find the label

Posted: Sun Jan 10, 2021 1:58 pm
by _ticlock_
Hi, Kun,

If you are trying to call label from inside the main or game menu, you should consider using Replay:

Code: Select all

        imagebutton:
            idle "view"
            hover "view"
            action Replay('sien_hana_dscg')
            xpos 1750
            ypos 170
And add $ renpy.end_replay() to the label to return back to the main or game menu:

Code: Select all

label sien_hana_dscg:
    call black from _call_black_29
    play ambient home
    call living_jump(time="          8:00 AM (Morning)", night=False) from _call_living_jump_2
    
    s "heya"
    $ renpy.end_replay()

Re: Action Call() cannot find the label

Posted: Mon Jan 11, 2021 12:53 am
by Kun
right! thanks for the Replay function.

But somehow, it is still not working...
I think this is due to my weird way of constructing this screen.

Is there any definition that I have to set to create Replay?

Right now, my screens are like this
main menu -> Extra -> dscg_gallery -> dscg viewer (the button to replay)
all of them are not set as <tag menu>

Thanks

Kun