Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
Kun
- Newbie
- Posts: 19
- Joined: Sun Dec 27, 2020 4:22 am
- Projects: Hana's Campus Life (limitedfactory.info)
- Organization: Limited Factory
-
Contact:
#1
Post
by Kun » Fri Jan 08, 2021 2:59 pm
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
-
Alex
- Lemma-Class Veteran
- Posts: 2981
- Joined: Fri Dec 11, 2009 5:25 pm
-
Contact:
#2
Post
by Alex » Fri Jan 08, 2021 3:10 pm
Put the label name in quotes, otherwise Ren'Py treat it as a variable named 'sien_hana_dscg'.
-
Kun
- Newbie
- Posts: 19
- Joined: Sun Dec 27, 2020 4:22 am
- Projects: Hana's Campus Life (limitedfactory.info)
- Organization: Limited Factory
-
Contact:
#3
Post
by Kun » Sun Jan 10, 2021 9:48 am
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"
-
Kun
- Newbie
- Posts: 19
- Joined: Sun Dec 27, 2020 4:22 am
- Projects: Hana's Campus Life (limitedfactory.info)
- Organization: Limited Factory
-
Contact:
#4
Post
by Kun » Sun Jan 10, 2021 9:54 am
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?
-
_ticlock_
- Veteran
- Posts: 391
- Joined: Mon Oct 26, 2020 5:41 pm
-
Contact:
#5
Post
by _ticlock_ » Sun Jan 10, 2021 1:58 pm
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()
-
Kun
- Newbie
- Posts: 19
- Joined: Sun Dec 27, 2020 4:22 am
- Projects: Hana's Campus Life (limitedfactory.info)
- Organization: Limited Factory
-
Contact:
#6
Post
by Kun » Mon Jan 11, 2021 12:53 am
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
Users browsing this forum: No registered users