Displaying text lines in a screen one at a time
Posted: Fri Mar 25, 2022 11:47 pm
Hi there!
This might be a basic fix, it might not be, but I'm looking to display a bunch of lines inside a screen one by one instead of all at once.

When the player clicks "roll dice" all this text is displayed at once, but I would like the lines of text to be displayed one at a time with some sort of wait or pause command if this exists.
My code follows, and I thank you for your consideration.
This might be a basic fix, it might not be, but I'm looking to display a bunch of lines inside a screen one by one instead of all at once.

When the player clicks "roll dice" all this text is displayed at once, but I would like the lines of text to be displayed one at a time with some sort of wait or pause command if this exists.
My code follows, and I thank you for your consideration.
Code: Select all
screen hazard:
modal True
frame:
xpadding 20
ypadding 20
xalign 0.5
yalign 0.5
side ("c r"):
area (1,0,280,600)
viewport id "my_scroller":
draggable True mousewheel True
textbutton "{image=close.png}" action [Play("sound", "audio/pageturn.ogg"), Return()] at topright
vbox:
spacing 10
null height 40
text "[player_name] rolls, with the main of [hazard_main]."
if Dicerolled == False:
textbutton "Roll Dice." action [Play("sound", "audio/diceroll.ogg"), SetVariable("d6One", renpy.random.randint(1,6)), SetVariable("d6Two", renpy.random.randint(1,6)), SetVariable("Dicerolled", True)]
else:
text "[player_name] has rolled {image=[d6One]_dice.png} and {image=[d6Two]_dice.png}."
null height 10
if d6One + d6Two == hazard_main or d6One + d6Two + 1 == hazard_main or d6One + d6Two - 1 == hazard_main:
text "[player_name] has rolled well, and is near the chosen main!"
$ hazard_victory_flag = 1
null height 10
else:
text "[player_name] has rolled poorly. The pot goes to [caster]."
null height 10
if hazard_victory_flag == 1:
$ hazard_npc_main = renpy.random.randint(5,9)
text "[caster] rolls, with the main of [hazard_npc_main]."
null height 10
$ d6One_npc = renpy.random.randint(1,6)
$ d6Two_npc = renpy.random.randint(1,6)
text "[caster] has rolled {image=[d6One_npc]_dice.png} and {image=[d6Two_npc]_dice.png}."
null height 10
if d6One_npc + d6Two_npc == hazard_npc_main or d6One_npc + d6Two_npc == hazard_npc_main or d6One_npc + d6Two_npc + 1 == hazard_npc_main or d6One_npc + d6Two_npc - 1 == hazard_npc_main:
text "[caster] has rolled well, and is near the chosen main! The pot goes to [caster]."
null height 10
else:
text "[caster] has rolled poorly. The pot goes to [player_name]."
null height 10
vbar value YScrollValue("my_scroller")