Re: SCI1.1: Speech balloons on actors and such

Yeah, I just did that myself... Here is an alternative way to accomplish the same scenario, at least from what I could trace by looking at some of what Phil has done... I'll try to spell out all of the steps from ground 0

First go into the Messages for a script that you plan to fire this off in and add a new global talker... In my case, I wanted the scientist to talk so that is what I named it "SCIENTIST"

Then I went to the specific message that I wanted to appear inside the speach bubble and changed the talker value from Narrator to my new scientist talker.

Then in the SpeakWindow script, I added thought to the list of properties for the speakWindow class

Code: [Select]
       thought 0

and slightly further down in the open method of the the speakWindow class, I included this just above the not isBottom if statement.

Code: [Select]
        (if (thought)
        = temp3 (+ temp3 8)
        )

Next, I went to the room script of where this talker is going to be used, in my case room 66, and I added two use statements up top with the other use statements.

Code: [Select]
(use "Talker")
(use "SpeakWindow")

Then at the bottom of the script, I made a public instance of a Narrator. In my case, since it is the scientist, I named it scientistTalker and in the tailX tailY attributes, I pointed it to the scientist Actors position.

Code: [Select]
(instance public scientistTalker of Narrator
    (properties
        talkWidth 120
    )

    (method (init param1)
        = font gFont
        = gWindow SpeakWindow
        (send gWindow:
            tailX((scientist:nsLeft))
            tailY((scientist:nsTop))
            xOffset(-50) // Offset from tail.
            thought(FALSE) // Speach Bubble, TRUE for thought
        )
        (super:init(rest param1))
    )

    (method (dispose param1)
        = gWindow gWindow2
        (super:dispose(rest param1))
    )
)

Also, since I made it a public instance, I added in the instance name to the export list back up at the top of the room script.

Code: [Select]
(exports
    0 rm066
    1 scientistTalker
)

and finally, I added the SCIENTIST case to the findTalker method of the testMessager of Messager instance found in the Main script real close to the bottom.

Code: [Select]

            (case SCIENTIST
                ScriptID(66 1) // Script 66, export 1
            )

Compiled everything and fired it up, everything seems to work.

Notes on usage...
In order to switch between the tails. When setting the xOffset in the room script instance.
   Negative, uses the tail which points to the right...
   Zero, uses the tail which points straight down...
   Positive, uses the tail which points to the left...

Moving and adjusting the windows location is done with the xOffset, but moving the tails position can be handled with the tailX and tailY values. You can always just hard code them if you want or do some math on them to tweak them to just the right position.

Code: [Select]
            tailX(10)
            tailY(105)
Code: [Select]
            tailX(- (scientist:nsLeft) 20)
            tailY(- (scientist:nsTop) 10)

So all of that said and done, these settings give me the attached result. The only thing left to do is figure out how to center the text inside the speach bubble.

Code: [Select]
            tailX(- (scientist:nsLeft) 20)
            tailY(- (scientist:nsTop) 10)
            xOffset(-45) // Offset from tail... tail points right
            thought(FALSE) // Speach Bubble, TRUE for thought