Author Topic: Multiple text lines in one Print window  (Read 14856 times)

0 Members and 1 Guest are viewing this topic.

Offline MusicallyInspired

Multiple text lines in one Print window
« on: September 16, 2011, 12:14:30 PM »
I'm transferring all my text to text resources now and some of them are too long to fit on a single line in a TEXT. Is there a way that Print() can display two text lines in the same window? I've tried these and they don't work:

Code: [Select]
Print(49 3+
49 4)

Code: [Select]
Print(49 3 49 4)

Any ideas? Is this possible?


Brass Lantern Prop Competition

Offline Collector

Re: Multiple text lines in one Print window
« Reply #1 on: September 16, 2011, 05:53:38 PM »
It doesn't wrap if it is too long?
KQII Remake Pic

Offline MusicallyInspired

Re: Multiple text lines in one Print window
« Reply #2 on: September 16, 2011, 06:51:23 PM »
Not in the TEXT resources. It stops short after a certain character limit. It works in lines. I can put the rest of it onto the next TEXT line but I still come back to the problem of how to print them both within the same Print window box.
Brass Lantern Prop Competition

Offline gumby

Re: Multiple text lines in one Print window
« Reply #3 on: September 17, 2011, 12:12:38 AM »
How about creating a third text resource that combines 49 3 and 4 (say 5)?  Unless you need something more dynamic...
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: Multiple text lines in one Print window
« Reply #4 on: September 17, 2011, 12:32:22 AM »
How would that work?
Brass Lantern Prop Competition

Offline gumby

Re: Multiple text lines in one Print window
« Reply #5 on: September 17, 2011, 08:57:23 AM »
So you'd have a third text resource consisting of the combined first and second, and when you needed to print both, you'd use it.

For example, in text resource 49, you might have:
3 - You open the little cupboard
4 - and find a small steel box
5 - You open the little cupboard and find a small steel box

So instead of this:
Code: [Select]
Print(49 3+
49 4)

Code: [Select]
Print(49 3 49 4)

You would just do this:
Code: [Select]
                                Print (49 5)

Does this make sense?
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: Multiple text lines in one Print window
« Reply #6 on: September 17, 2011, 10:40:49 AM »
That won't work. The line of text is too long to fit on one line in a TEXT resource. There's a character limit. That's my whole problem. The only way to do it seemingly right now is to just write the whole text right in the script instead.
Brass Lantern Prop Competition

Offline gumby

Re: Multiple text lines in one Print window
« Reply #7 on: September 17, 2011, 01:21:31 PM »
I see.  How about this, create a function that accepts 4 parameters (the text resource #'s and the indexes of the values you want to pull - i.e. 49 3 49 4).  Then pull the values from the text resources using the GetFarText() function, concatenate them together & return the resulting string which you can feed into a Print() call.

Just out of curiosity, what did you find the text resource max to be?
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: Multiple text lines in one Print window
« Reply #8 on: September 18, 2011, 03:25:21 AM »
Is there a new line command?
KQII Remake Pic

Offline gumby

Re: Multiple text lines in one Print window
« Reply #9 on: September 18, 2011, 08:58:20 AM »
Is there a new line command?
Yeah, there is - it's '\n'.

It doesn't wrap if it is too long?

Not in the TEXT resources. It stops short after a certain character limit. It works in lines. I can put the rest of it onto the next TEXT line but I still come back to the problem of how to print them both within the same Print window box.

Is this an issue that text resources don't automatically wrap, or is this a an issue of there is limit as to the number of characters a text resource can hold?  I could have sworn that the text resources automatically wrap in a Print().  Maybe I'm thinking of Display().
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: Multiple text lines in one Print window
« Reply #10 on: September 18, 2011, 11:51:06 AM »
This is an issue of there being a limit as to the number of characters a single text resource LINE can hold. Text lines do not wrap because that defeats the whole purpose. Each line has to be referenced individually by the interpreter. It automatically wraps that text when Print displays it on screen in-game. The problem is that text lines are not infinite. Whereas if I put the text right in the script file as a string instead I can write as much as I want. I wonder if that's just a IDE limitation of the TEXT resource editor? I could try editing the TEXT file itself and extending it to see if that works.

EDIT: The character limit seems to be 259 characters per TEXT line in SCI Companion.

EDIT 2: This seems to be a Companion-only limitation as the TEXT editor in SCI Studio has no such character limit. Still haven't tried to see if it works in game or not.

EDIT 3: Editing the text resource manually or with SCI Studio's text editor and appending the text to the text resource works fine. This is a major issue with SCI Companion that needs to be rectified. The only major one I've come across.
« Last Edit: September 18, 2011, 12:24:10 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline Collector

Re: Multiple text lines in one Print window
« Reply #11 on: September 18, 2011, 01:01:17 PM »
Is there a new line command?
Yeah, there is - it's '\n'.
Then fairly standard.

I suspected that it could be an IDE issue. It is too bad that no one is at least actively maintaining or developing Companion or Studio. Omni has not posted in quite a while.
KQII Remake Pic

Offline gumby

Re: Multiple text lines in one Print window
« Reply #12 on: September 18, 2011, 06:52:17 PM »
Bother all.  I can run Companion in Win 7, but I can't seem to launch SCIV.exe.  Anyone able to do this?  I tried compatibility mode, but no go.  Probably should start a new thread regarding this.

MI, I did hit the wall with the text resource as well within Companion & concur with the number of characters.  I now understand the problem you are having.  You need more space within a single text line resource within Companion.

In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: Multiple text lines in one Print window
« Reply #13 on: September 18, 2011, 11:14:09 PM »
Bother all.  I can run Companion in Win 7, but I can't seem to launch SCIV.exe.  Anyone able to do this?  I tried compatibility mode, but no go.  Probably should start a new thread regarding this.
Why are you not just using DOSBox? x64 cannot run most 16-bit code. If we had someone developing Companion or Studio, it would be nice to have it configurable to run DOSBox with a specified conf file from the run button. You could place another executable named SCIV.EXE that would start DOSBox with a custom conf and rename SCIV.EXE to say SIERRA.EXE. Let me play with it and see if I can come up with a solution to do this. Should be relatively easy.
KQII Remake Pic

Offline Collector

Re: Multiple text lines in one Print window
« Reply #14 on: September 19, 2011, 01:22:48 AM »
Sorry, no delete button
« Last Edit: September 19, 2011, 01:47:31 AM by Collector »
KQII Remake Pic


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.085 seconds with 23 queries.