Community
SCI Programming => SCI Syntax Help => Topic started by: MusicallyInspired 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:
Print(49 3+
49 4)
Print(49 3 49 4)
Any ideas? Is this possible?
-
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.
-
How about creating a third text resource that combines 49 3 and 4 (say 5)? Unless you need something more dynamic...
-
How would that work?
-
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:
Print(49 3+
49 4)
Print(49 3 49 4)
You would just do this:
Print (49 5)
Does this make sense?
-
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.
-
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?
-
Is there a new line command?
-
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().
-
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.
-
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.
-
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.
-
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.
-
Sorry, no delete button
-
I've found that companion's text editor has other issues as well. Besides this limitation that Brandon found, I haven't run into it myself, there is also the fact that It won't let you duplicate a text line. At first this may seem like a good thing, but by default in my pnc junk I use the first four lines as my defaults for look talk get and use... I'm not always sure what I want to put in them right off so I try to leave them blank and move on down the list. It appears to take them just fine, but when you close the screen and come back to it later, you will find that everything in the list has been shifted up as only one blank line is saved, the others disappear. This happens not only with blank lines, but also duplicate text which companion sees the multiple blank lines as. So for instance if line 1 you type "hi" and then again in line 2 "hi" and say in line 3 you type "there" once it is saved and reopened you will find that line 1 says "hi" and line 2 says "there"... the duplicate "hi" that was typed into 2 originally is removed and everything else slides up. Doesn't really help with displaying multiple lines of text, but it seems to me Brandon has found the fix, use scistudio to create the text resource when necesary :P
I'll bet though that a little fiddling with formatprint could actually allow multiple lines of text to be printed at same time. Saving each line as a variable, then printing out the multiple variables...
-
When I've got an environment to test again with, I'll happily hack together a function that will support printing multiple text resources at once, if the need still exists.
-
It would seem a welcome ability at times. Especially if one is using only Companion's text editor.