Very stumped: incorrectly terminated character constant?

Started by , Thu 17/06/2004 07:28:23

Previous topic - Next topic

Ric Carnahan

Hey there,

I searched the knowledge base, forums, and even did a scan on Google, but I couldn't come up with anything. Here's my dilemma.

I have a ton of descriptions in my game. We're trying to get a description for everything on-screen, and we're going a really, really good job at it. (We're big fans of Josh Mandel and Callahan's Crosstime Saloon.) I was inputting all of the descriptions for one of the rooms tonight, and when I saved the room, I got this error message:

There was an error compiling your script. The problem was:
In: 'Main script'
Error (line 210): incorrectly terminated character constant

I can't see a thing wrong with anything in the description. It's not too long. It doesn't use any different characters. I didn't use anything more than "Run script" from the Interaction editor. The syntax is spot-on. Can anybody please help me? I was on such a roll...

Thanks in advance. Love AGS.

Ric Carnahan

Er, sorry for the double post, but I just realized that I forgot to put my code up, and I'm a guest because I'm too lazy to register in this awful heat. Here's lines 206-211:

#sectionstart hotspot8_b  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot8_b() {
  // script for hotspot8: Interact hotspot
 
Display("What? You want me to do some lawn work in this scorching weather? As much as I'd love to break out the lawn tools and take a crack at it, I'm, er, that is, just far too famished to EVER be able to muster the energy to be able to savor such an exciteable task.");
}

Gilbert

It's probably because the string was longer than 200 characters, try shortening it.

Ric Carnahan

That worked, though I was hoping for something more dramatic. You know, so I don't feel like such a newbie. Ah well. Sorry to waste time and forum space with my meager request.

By the way. Everyone give El Ravager an expensive gift. But be sure to include a mechanical hand that throws pies at him.

TerranRich

BFAQ'ed: http://www.rain-day.com/harbinger/faq/#coding10

Yeah sometimes a solution is very simple. That's why the BFAQ exists. Every time a new common problem pops up, we can display the solution for the AGS World. :P

And the limit is 200 characters? I thought it was 255 or something.
Status: Trying to come up with some ideas...

Scorpiorus

Quote from: Moebius 5.18 on Thu 17/06/2004 13:16:26And the limit is 200 characters? I thought it was 255 or something.
Yes, in AGS all the string variables can hold up to 200 characters (including 'zero' termination symbol), thus the maximum number of characters tot up to 199.
The global messages and labels can be longer though.

ryan

 ??? excuse me for the bump, but i also need help with this problem:

ok, so, i get this same exact error when i try to save a certain room. but my line is below 200 chars (in fact, its more like 100 chars). heres the code that I get the error with:

Display ('Dark Wizards Monthly: New black magic spell which currently has no name    has been invented by an elderly sorcerer.')

??? can ne1 help me?


ryan


ryan

but now i have the same thing, but i have no idea what the problem is.

Code:
Display (Morning in Reality)

thats the line that gets the error.  ??? ??? ???

ryan

i'm so sorry for so many posts (this board has no edit button, so i couldn't do nething), but that last code was near the beginning, so it took in the "terminated constant" thing, now i get something else. ill post it separate tho.



Barbarian

Hi Ryan. You should really register and then log in, then you will be able to "modify" your posts. I don't think you get the "modify" options on your posts when your posting as a Guest.

Anyways, I think you should use "quotes" in that command, and a semicolon, so it should look like

Display ("Morning in Reality");


   Try that and see if it works.
Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

TerranRich

#11
Try to learn the basics of programming in general, you will know this plus many other things about programming and scripting. I'm not trying to be rude or anything, but it will help greatly, and it might answer many questions you might still have. :)
Status: Trying to come up with some ideas...

ryan

Quote from: Barbarian on Mon 19/07/2004 03:11:42
Hi Ryan. You should really register and then log in, then you will be able to "modify" your posts. I don't think you get the "modify" options on your posts when your posting as a Guest.

Anyways, I think you should use "quotes" in that command, and a semicolon, so it should look like

Display ("Morning in Reality");


Ã,  Ã, Try that and see if it works.

sorry for not registering, i was a bit lazy  ;). and i couldn't seem to get that to work when i used the " and ;, but thank you neway.

SMF spam blocked by CleanTalk