TADS3 Adv3: Problem with sound tags and RealTimeDaemons

Okay, see how this works for you. Start by copying the library code for getInputLineExt

modify inputManager
  getInputLineExt(defObj)
    {
           /* add this line at beginning of method */
        local skipInputBegin = nil;
        ...
        for (;;)
        {
            ...
              /* make this modification where
               * inputLineBegin is called
               */
			if(!skipInputBegin)
               inputLineBegin(defObj);
			skipInputBegin = nil;

        getInput:
            ...
            case InEvtTimeout:
               
/* if you wanted some normal/textual realtime events, you would
 * enter a block here that contains the library logic. Otherwise if
 * you determine that you're dealing with a sound event, you
 * would enter a block that contains the following logic: (and just
 * use as-is if you're only doing sounds)
 */

                // "<.commandint>";  // remove this
				skipInputBegin = true;
				flushOutput();
                break;
            ...
            [rest of method]
;

I haven’t tested this for robustness such as processing multiple ready events in the same cycle and such, but sure enough I could get:

>ring bell
[sound actually plays here, no additional command line]
2 Likes

Awesome! This works like a dream!
Thanks again, so much! This solves the problem completely. :smile:

1 Like

Great! The key I was missing was to call flushOutput. It was fun to tinker with!

2 Likes

Glad yr here but dude, you have a sickness! :stuck_out_tongue_winking_eye:

2 Likes

Well, programming first captured my interest because it was like a new form of logic problem… and a lot of times it turns out that stuff I do in TADS scratches my logic problem itch where real-life coding doesn’t. :man_shrugging: It was only a few minutes’ investigation when I was sitting not doing anything else!

3 Likes