Author Topic: Must Print pause the game in SCI.?  (Read 320 times)

0 Members and 1 Guest are viewing this topic.

Offline scott_furphies

Must Print pause the game in SCI.?
« on: January 20, 2021, 02:46:54 AM »
Hey everyone,
I've taken it for granted that the game must pause when dialogue is being displayed, but I wonder if this is necessarily the case?
I'm sure there's moments in Leisure Suit Larry 3 and Space Quest 3 when dialogue is displayed while either character animation and/or ego movement is going on.

Does anyone have any idea if there's a way to toggle this? It would be awesome to get some animation while a character is talking!



Offline Kawa

Re: Must Print pause the game in SCI.?
« Reply #1 on: January 20, 2021, 09:27:17 AM »
It's their use of #dispose and #time. One keeps the window open without blocking, the other eventually closes it again.

Here's how LSL3 does it. In the Vista Point screen, the roomscript does the following:
Code: [Select]
(1
(Format @plot "My, how this island has changed! yadda yadda")
(= seconds (PrintPlot))
)
where the local function PrintPlot is this:
Code: [Select]
(procedure (PrintPlot &tmp t)
(= t (PrintDelay @plotString))
(Print @plotString #at 10 5 #width 290 #time t #dispose)
(return (+ 3 t))
)
and PrintDelay over in main is this:
Code: [Select]
(procedure (PrintDelay theString)
(return (+ 3 (/ (StrLen theString) 146)))
)
The Print command's #time closes the window, but this happens independently from the roomscript. It just runs on the same time value, plus another three seconds.

Offline scott_furphies

Re: Must Print pause the game in SCI.?
« Reply #2 on: January 21, 2021, 05:38:12 PM »
Thanks Kawa! This is very useful.
Maybe I could get a global procedure going for dialogue.
I'll report back if/when I get it to work!

Offline Kawa

Re: Must Print pause the game in SCI.?
« Reply #3 on: January 21, 2021, 06:20:17 PM »
If you want a whole conversation, you might consider using a script object and states, like the LSL3 plot dump does. That way you can time it all properly.

Offline gumby

Re: Must Print pause the game in SCI.?
« Reply #4 on: January 21, 2021, 08:25:28 PM »
For completeness, in SCI1.1 you can get the desired result by setting the window to modeless.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline scott_furphies

Re: Must Print pause the game in SCI.?
« Reply #5 on: January 22, 2021, 10:07:50 PM »
I've been banging my head against the wall trying to figure out that LSL3 code, then I just started trying random things.
it turns out if I add #time 3 and #dispose 0, the print window will linger on the screen for 3 seconds as the gameplay continues.
This seems like a pretty simple way of doing this?

Offline Kawa

Re: Must Print pause the game in SCI.?
« Reply #6 on: January 23, 2021, 09:05:41 AM »
I've been banging my head against the wall trying to figure out that LSL3 code, then I just started trying random things.
it turns out if I add #time 3 and #dispose 0, the print window will linger on the screen for 3 seconds as the gameplay continues.
This seems like a pretty simple way of doing this?
That's exactly right. The LSL3 code calls it in a state machine so that state machine can then also wait long enough and pop up the next plot dump, and the PrintPlot wrapper returns how long it told Print to wait plus another three seconds. That's what the roomscript then uses as a delay until the next state/plot dump.

Offline scott_furphies

Re: Must Print pause the game in SCI.?
« Reply #7 on: January 24, 2021, 03:06:17 AM »
I see!
I ended up making a local procedure which handles the delay, the character animation, the placement of the text and the title, so in each case all i need to type is:
(1
AlGoreSpeech("You are hearing me talk" 3) ;the text will end up in a text resource
=seconds 3
)
(2
JoeySpeech("Woah.." 2)
=seconds 2
)
(3
Shutup() ;this procedure stops both characters mouths flapping so they can awkwardly state at each other for a moment.
)

This is much neater and faster! This is the first time I've created custom procedures like this so I will probably be re-examining some of my old code yet again!

update:
I've added several other functions to handle animation, now the faces and bodies are separate so I can call in different facial expressions and gestures whenever I want, eg:

(1
     JoeySpeech(803 4 4) //Whoa! for 4 seconds
     JoeyFace("surprise")
     JoeyBody("armWaving")
)
(2
    JoeyBody("beStill")
    RonaldSpeech(803 5 2) //that's a what I'm talkin' about!
    RonaldFace("angry")
    RonaldBody(''handsOnHips")
)
And so on... It's a lot of fun, kind of like puppetry,  this really brings the characters to life.
« Last Edit: January 25, 2021, 07:29:33 PM by scott_furphies »


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

Page created in 0.124 seconds with 23 queries.