Page 1 of 1

Letting player stay at area without dialogue

Posted: Fri Feb 03, 2017 6:25 pm
by TheKiwi
I made a pretty functional exploration feature within my VN, but I'm having trouble just allowing players to stay in area.
They're not very visible right now, but in the future I'll have the textbuttons that say PDA and MOVE replaced with icons. After a player moves into an area, they can just stay there if they want and look over their notes in their PDA and whatnot. The problem is, I can't figure out how to make the game essentially wait for them to use those buttons.

What I could do is put a hard pause that lasts 99999999999999 minutes, but I feel like there's an easier way.

I've tried putting in a variable to do this:

Code: Select all

label start:
$nothingtodo = True
label place1:
while nothingtodo == True:
     pass
And it stops, but then it freezes up and I can't open up the PDA or move menu.

Here's an image as an example of what I want to happen. (The text buttons are a little light)
Image
Any ideas? All help is super appreciated. Thanks for reading.

Re: Letting player stay at area without dialogue

Posted: Fri Feb 03, 2017 6:39 pm
by Woozical
You're crashing your game with an infinite while loop. If you want the player to stay in the "place1" label while "nothingtodo" is true, try this:

Code: Select all

label place1:
	if nothingtodo:
		jump place1

Re: Letting player stay at area without dialogue

Posted: Fri Feb 03, 2017 6:46 pm
by TheKiwi
That works, as long as I have dialogue in the bottom. But when I don't, ren'py crashes and tells me I have an infinite loop.

Re: Letting player stay at area without dialogue

Posted: Fri Feb 03, 2017 8:05 pm
by Woozical
Try slapping a 1 second pause before the if statement.

Re: Letting player stay at area without dialogue

Posted: Sat Feb 04, 2017 12:33 am
by Sleepy
I also have exploration levels in my game. How I keep players in an 'explorable' section is I just have an exploration screen which contains things like the image/text buttons for that area. So for ex:

Code: Select all


label area1:
    "blahblahbetter check my pda"
call screen area1_explore

screen area1_explore:
    #Area Move 
    textbutton "Move" action Show("move_menu") align (#insert alignment)

    #PDA Use    
    textbutton "PDA" action [#insert display method here] align (#insert alignment)
If you want to have a text button visible all the time, though, like the PDA, you might considering making that it's own screen and using 'show' instead of 'call'. But something in this format should keep players in the explorable area without being stuck in an infinite loop.

Re: Letting player stay at area without dialogue

Posted: Sat Feb 04, 2017 8:45 pm
by TaoistFruitbat
You can try creating the screen you need and sticking it out of the viewing area. I had to do a similar thing to display an empty choice menu.

Code: Select all


screen choice(items):

    window:
        style "menu_window"

        if show_menu:  # This is a variable you set elsewhere  
            # normal menu code here

        # If we don't show the menu then we do a dirty hack
        # and stick a single 1x1 button off the screen.
        # From the players perspective there is no menu.
        else: 
            for i in items:
                button:
                    area (-1, -1, 1, 1)

You could do a similar trick for a text screen, or whatever screen you want.

Re: Letting player stay at area without dialogue {SOLVED}

Posted: Mon Feb 06, 2017 11:53 pm
by TheKiwi
Hey, I figured out a super easy way to do it in case anyone needs this. Thank you for the input everyone!

Code: Select all

define emptytext = Character(None,window_background=None)
I have no idea why I didn't figure this out earlier, but yeah. I made an empty character and make it work by just giving it an empty text and making it jump back to the label.

Code: Select all

label endscene1:
    emptytext ""
    while nothingtodo == True:
        jump endscene1

Re: Letting player stay at area without dialogue

Posted: Tue Feb 07, 2017 2:44 am
by ISAWHIM
Hide Window
Scene Something_here
Pause

or

Window Hide
Scene Something_here
Pause

That will hide the text-box... Then PAUSE until they still have to click to continue, which will then take them to the next part. (Or, if you have a button, they click that.)

The text-box is set to AUTO, by default. That makes it pop-up, if there is something to display. When there is nothing, it does not show. However, when changing a scene, it auto-loads your next box... Since that is what you are use to doing...

Code: Select all

Scene ....
Guysays "something"
The box pops-up, because you told it to, after displaying the scene...

Do this instead...

Code: Select all

OldStuffSaid "something"

Hide Window
Scene ... (What you want to pause at.)
Pause
Narrator "You exit the waiting-area"
You told it to hide the textbox, after displaying the scene... (Though, it should disappear anyways, but it may not, in AUTO.)

PAUSE without any number, will just pause forever.

As a repeatable function...

Code: Select all

label myWaitingArea():
    Hide Window
    Scene cargo_area with dissolve
    Pause
    Narrator "You exit the waiting-area"
    return

label start:
    You "Hello"
    call myWaitingArea

    You "Still nothing"
    call myWaitingArea