Author Topic: A Talker for Ego/Print & "modeless" questions  (Read 1294 times)

0 Members and 1 Guest are viewing this topic.

Offline MusicallyInspired

A Talker for Ego/Print & "modeless" questions
« on: April 28, 2019, 04:06:33 PM »
Okaaaaaayyy! So this is a headache. I want a talking dialogue portrait for my Ego but it doesn't look like Template game is set up for it. I'm trying to create its instance in Main.sc. Is that the right way to go about it seeing as it needs to be available from everywhere? Or should I make it its own Script? What I was attempting to do besides just having a general Ego Talker is to have it also appear and animate when the player opens the Quit dialog and saying a line, which I'm sure is a can of worms unto itself because it needs to stay on the screen to press the Yes or No buttons.
« Last Edit: May 24, 2019, 11:50:13 PM by MusicallyInspired »


Brass Lantern Prop Competition

Offline Kawa

Re: A Talker for Ego
« Reply #1 on: April 28, 2019, 05:48:00 PM »
For the first part of your post, the template game not being set up for an Ego talker, that part's easy. By default, it's set up to only have a Narrator.

Talkers generally each get their own scripts simply so they're only loaded while they're actually talking. In Main, findTalker merely links talker numbers to objects, usually via ScriptID commands except for 99, which is the Narrator:
Code: [Select]
(switch talkerNumber
  (NARRATOR gNarrator)
  ; Add more cases here for different narrators
  ; (8 (ScriptID 109 7)) ;cadetsTalker in SQ5's starCon.sc
)
99 being the Narrator and 1 being Ego is just tradition, just like how they all get their own scripts. You might notice that the template's narrator is in Main, by the way.

I don't know about having an active Talker in a button-filled Print though...

Offline lskovlun

Re: A Talker for Ego
« Reply #2 on: April 28, 2019, 07:01:43 PM »
What I was attempting to do besides just having a general Ego Talker is to have it also appear and animate when the player opens the Quit dialog and saying a line, which I'm sure is a can of worms unto itself because it needs to stay on the screen to press the Yes or No buttons.
For this part you need to look at the class DCIcon, or rather at games that use it. It is an animating version of DIcon, which is the ordinary, static thing available in Print. Unless you somehow need a full Talker (Sierra didn't do that).
« Last Edit: April 28, 2019, 07:03:35 PM by lskovlun »

Offline lskovlun

Re: A Talker for Ego
« Reply #3 on: April 28, 2019, 07:16:14 PM »
And here, a bit from Pepper, which has this in its about screen (death handlers are usually in asm, but this is not a death handler):
Code: [Select]
(if
(not
(Print
width: 230
x: 30
addText: 1 0 2 4 0 0 884
addText: 1 0 2 5 0 13 884
addText: 1 0 2 6 0 26 884
addIcon: (artIcon view: temp302 cel: 0 loop: 0 yourself:) 0 0 20 40
init:
)
)
(self dispose:)
(return)
)
and artIcon is defined as:
Code: [Select]
(instance artIcon of DCIcon
(properties
cycleSpeed 15
)
)
You can have an init method on DCIcons instead if you prefer - it does get called, and several games do that. You can also set their view/loop/cel properties directly.
In that case the addIcon call is simply:
Code: [Select]
addIcon: artIcon 0 0 20 40
or whatever.
« Last Edit: April 28, 2019, 07:22:39 PM by lskovlun »

Offline MusicallyInspired

Re: A Talker for Ego
« Reply #4 on: April 28, 2019, 08:00:29 PM »
Say the game is fully voiced. How best would it be to go about having an animated dialogue portrait speaking in lip sync? Space Quest 4 CD did this now that I think of it. With Restart too.

Actually, I could just check out SQ4's source now that I've thought of it.
« Last Edit: April 28, 2019, 08:19:25 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline Kawa

Re: A Talker for Ego
« Reply #5 on: April 29, 2019, 04:23:33 AM »
SQ4's Two Guys:
Code: [Select]
(instance babbleIcon of DCIcon
(properties)

(method (init)
(super init: &rest)
(if (== gOldMsgType 2)
((= cycler (MouthSync new:))
init: self 0 99 0 global201 1
)
(DoAudio 2 0 99 0 global201 1)
else
((= cycler RandCycle) init: self 20)
)
)
)

Offline MusicallyInspired

Re: A Talker for Ego
« Reply #6 on: May 16, 2019, 11:12:10 PM »
Ok, couple more questions. I'm putting the talker for quit/restart dialogues on the back burner and I'm just trying to figure out how to Print some text on the screen with Narrator. I'm designing the introduction sequence.

1) How do you use a Talker with recorded speech audio in a Print command rather than as a VERB or whatever from clicking an interaction on something? As in, in an environment where each state is cued and narrator boxes triggered.
2) How do you Print this message box on the screen and still allow animation to continue? In SCI0 this used to be done by invoking "dispose" right? That doesn't seem to work this time.

This is what I've got in my changeState right now.

Code: [Select]
(Print
font: gFont
addText: 0 0 0 1
posn: 67 16
init:
dispose:
)
« Last Edit: May 16, 2019, 11:13:43 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline lskovlun

Re: A Talker for Ego
« Reply #7 on: May 19, 2019, 10:06:58 PM »
2) How do you Print this message box on the screen and still allow animation to continue? In SCI0 this used to be done by invoking "dispose" right? That doesn't seem to work this time.
Try the modeless property (set it to true). After doing so, you'll need to dispose the dialog manually, then reset the modeless property. Now, a number of games do this by setting the modeless property of each narrator... but even the standard Print should work in this manner...

Offline MusicallyInspired

Re: A Talker for Ego
« Reply #8 on: May 20, 2019, 01:33:38 AM »
That worked. I'm trying to figure out how to remove the Print box now though. I don't know how to reset the modeless property. (Print modeless: TRUE) does nothing. Also, the "ticks" property doesn't seem to do anything. I thought it'd keep the Print box up for a number of cycles or something.
Brass Lantern Prop Competition

Offline lskovlun

Re: A Talker for Ego
« Reply #9 on: May 20, 2019, 04:02:29 PM »
That worked. I'm trying to figure out how to remove the Print box now though. I don't know how to reset the modeless property. (Print modeless: TRUE) does nothing. Also, the "ticks" property doesn't seem to do anything. I thought it'd keep the Print box up for a number of cycles or something.
The open dialog is stored away in the gDialog variable and you can call its dispose method to get rid of it. I'm not sure why the ticks property doesn't do anything, but you can always handle that in your own script.

EDIT: Oh, and the default value of the modeless property is FALSE, so that's what you reset it to when you're done.
« Last Edit: May 20, 2019, 04:08:57 PM by lskovlun »

Offline MusicallyInspired

Re: A Talker for Ego
« Reply #10 on: May 20, 2019, 11:05:17 PM »
Got it to work. However, it won't trigger speech associated with the message being Printed.

I wonder, would gMessager be better suited to use for this? The only problem I have found so far is that there doesn't seem to be a way to set the message window position. It's always in the middle of the screen. And I can't enable modeless to allow animation to continue while the message is displayed/speaking.

EDIT: Also, ticks does work. I had thought that a tick was a cycle. But apparently it's a full second. I had it up to like 20 ticks lol. So I never waited long enough to see it close the window on its own. So that works.
« Last Edit: May 21, 2019, 01:14:31 AM by MusicallyInspired »
Brass Lantern Prop Competition

Offline Kawa

Re: A Talker for Ego
« Reply #11 on: May 21, 2019, 02:32:25 AM »
If you want speech in a Print, DoAudio right before you show it. Larry 6 does that in its death handler.

Offline MusicallyInspired

Re: A Talker for Ego
« Reply #12 on: May 21, 2019, 09:57:40 AM »
Right before as in one state before? Or one line before in the same state?
Brass Lantern Prop Competition

Offline Kawa

Re: A Talker for Ego
« Reply #13 on: May 21, 2019, 10:31:53 AM »
One line before, in the same state. Notice in the Larry 6 death handler that it's a procedure, not a changeState method.

Offline MusicallyInspired

Re: A Talker for Ego
« Reply #14 on: May 21, 2019, 10:52:55 AM »
Ok. That page didn't show the code line where DoAudio was. It just mentioned it in the following paragraph so just wanted to be sure. I also notice in the documentation that you can get the tick length of a speech line with DoAudio as well, so that'll be great for setting the tick length of the Print window too.

However, I did a quick test this morning before I went in to work and it didn't seem to trigger the sound. I'll have to do more tests later.

Also, can "ticked Print windows" cue the state? Seems like every time and everywhere I try to add "self" it just crashes the game.
Brass Lantern Prop Competition


SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.168 seconds with 23 queries.