intfiction.org

The Interactive Fiction Community Forum
It is currently Mon Nov 12, 2018 4:13 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Enter Room Code
PostPosted: Wed Sep 05, 2018 8:40 pm 
Offline

Joined: Wed Feb 24, 2016 10:27 pm
Posts: 134
Hello,

I'm trying to trigger some code when entering a room. I've done something like this before, but it's not working with morePrompt(). I'd like to use clear screen and show some cutscene text. Right now I have to press enter for every prompt and then it all shows at the end.

Code:

talbinLivingRoom: Room 'Living Room'
    "Brown stonework lines the walls wherever it can be seen. Faded stones sit among colorful ones. Oak book shelves
    clutter the back of the room. Leather and paper scents mingle with potpourri. A fresh  bowl of scented flowers
    sits atop a little cedar stand in the middle of the room. A brown fur rug sits below. A small stone fireplace stands in the northeastern corner. It hasn't
    flickered since the winter months. Two paintings hang on either side of the hallway entrance. The kitchen sits to the north.
    The washroom to the west, between two walls of packed book shelves. The front door sits to the south."
    east = talbinHall3
    enteringRoom(me)
    {
     
        "<q>There you are, <<me.name>>!</q> \n\b";
        morePrompt();
        "<<me.name>><<me.charPossessive>> mother paces a few steps.\n\b";
         morePrompt();
        "<q>How could you sleep all day?</q> She asks worriedly. <q>You know it's Adryx's retirement today.</q>\n\b";
        morePrompt();
        "<q>Oh no...</q> <<me.now>> says. <q>I almost forgot.</q>\n\b";
        morePrompt();
        "<q>You did forget.</q> She sighs. <q>No worries, I have plenty of time to finish the flowers.</q> An look draws across her
         face. <q>Can you get me some flowers from the forest?</q> She asks.\n\b";
         morePrompt();
        "<q>I only need a few, and then Sarah wants to see you. She left a note.</q> She cracks into a smile, <q>But the flowers
        first, okay?</q>\n\b";
        morePrompt();
        "<q>Alright.</q> <<me.name>> replies.\n\b";       
       
    }
;



Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Enter Room Code
PostPosted: Thu Sep 06, 2018 1:52 am 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:48 pm
Posts: 1033
Location: Greece
You should use the inputManager.pauseForMore() method for this. morePrompt() is a low-level function that will not flush text to the screen.

inputManager.pauseForMore() takes an argument that must be either true or nil. It states whether realtime events should be paused. Usually you want this to be the case, so just use this:

Code:
inputManager.pauseForMore(true);

_________________
@realnc


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Enter Room Code
PostPosted: Thu Sep 06, 2018 2:08 am 
Offline

Joined: Wed Feb 24, 2016 10:27 pm
Posts: 134
Works perfect. Too bad there wasn't a cook book of this stuff. Most of the books go into some depth, but not these other functions.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Enter Room Code
PostPosted: Thu Sep 06, 2018 2:41 am 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:48 pm
Posts: 1033
Location: Greece
Yeah, the adv3 API is kind of big. I don't think there's a shortcut for learning how things work. Looking and searching in the adv3 source files helps though. There's also a reference for these files here:

http://www.tads.org/t3doc/doc/libref/index.html

Over time you start to learn where things are and how to search for them.

_________________
@realnc


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group