Settextoverlay and 300 char script line problem

Started by Hollister Man, Fri 16/04/2004 04:58:17

Previous topic - Next topic

Hollister Man

Okay, I am trying to make a "prologue" type room before my game starts.  I do something like this:

Code: ags


Createtextoverlay(20, 20, 180, 100, 0, "blah");



That works fine.  Now, if I want to add a full screen, or almost, I just replace "blah" with my text.  The issue is that if the line is longer than 300 chars, the script won't compile.  So... I add in line breaks (just press enter at a reasonable place)  NOW it compiles and looks beautiful...except a few strangenesses.

I get a character between the last word of the first line and the first word of the next line that looks very strange, but its NOT in the font panel (see below) and in two instances, "I" is replaced by "-09000".  Weird huh?



Is there an official way I'm supposed to be doing this?  I tried using a string as a buffer:

Code: ags

string blah;
StrCopy(blah, "blah blah");
Createtextoverlay(20, 20, 180, 100, 0, blah);


BUT strings have a limit of 200 which is even more of a constraint.

HELP (and please don't say RTFM, I have been reading it for most of the evening, no luck)
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Pumaman

You're seeing the carriage return character because your string has a line break in it.

I really wouldn't recommend doing this, strings over 200 characters are not supported. The workaround is to create two overlays, each with half the text in.

Hollister Man

Dang it, I supposed there was a cleaner way.  Its just harder to make it look neat and harder on my code.  This screen was supposed to be a quick and dirty replacement for a cutscene that isn't ready yet.  The strnage thing is that one overlay works and dows not show the carriage return, and the other does.

The script is ALREADY pretty messy, bad enough that I have trouble finding things. :)  Oh well
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Scummbuddy

then you should break now, and clean it up and work on keeping better code. Youll be happier and set for later.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Kweepa

It's just a standin for a cutscene?
What's wrong with just writing "TODO: CUTSCENE"? That's less than 200 characters. :)
Seriously though, why not just break it into two boxes which are displayed sequentially?
Still waiting for Purity of the Surf II

Hollister Man

Scummbuddy: I didn't mean MY script was messy, its just a PITA to get it the way I want.  I'll use the code again elsewhere, if I can ever get it right.

The concept was to make it a story, and fade it in and out a page at a time.  It could be reused for credits, another part of the story, etc.  

Steve: A: Basically, this is part of a VERY large project.  I am TRYING to get a demo together, but this cutscene won't be ready, it needs four BGs, at LEAST one character, and music as well.  This way it looks nice, but it isn't taking much time away from stuff that will make it into the final project. B:  200 chars is only a couple of sentences, and it just doesn't fit my purpose to do it that way.  It would result in FAR too many "pages," I have four already.


Thanks for trying guys, I'm surprised that this hasn't come up before.  Can anyone think of a good way to do this without overlays maybe?  Perhaps I should just use several backgrounds? (as a lightbulb goes on over my head)  
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Kweepa

Sounds like you have your answer!

About the original problem,
I don't mean to sound like an arse, but there's nothing wrong with multiple pages. It breaks the text up into manageable chunks for people to read. I think they are more likely to read 5 sequential text boxes than an entire screenful of text.

Also, I don't know what the demo is for, but you could consider waiting until the cutscene was finished. I presume it will make for a more representative demo.

Cheers,
Steve
Still waiting for Purity of the Surf II

Hollister Man

I tried breaking it up.  The ONLY thing on the screen is that little 200 char bit of text.  Its like, three lines.  

I did find the answer I guess, but now I can't find a decent font to use to simulate the effect, problems, problems.

The cutscene isn't really so important, just a prologue to the game.  The problem is that I am depending on another member to get the characters finished, and I know that its hard to make characters (and his are HIGH quality).
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

SMF spam blocked by CleanTalk