Cutscene problem

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Cutscene problem
Infiltrator
Member # 4826
Profile #0
I have a problem with this cutscene I've just begun to make (code below). Whenever I test it and start the cutscene, it relocates the characters, but then ends the cutscene and gives me an error message saying,"Improper command in line 0." Now, if I've made a clumsy mistake, laugh all you want, but please just help me.

begintownscript;

variables;
short i;

body;

beginstate INIT_STATE;
set_name(6,"Prophet");
break;

beginstate START_STATE;
break;

beginstate EXIT_STATE;
break;

beginstate 10;
if (get_flag(0,0) == 0) {
force_view_center(25,21);
relocate_character(0,23,23);
relocate_character(1,24,23);
relocate_character(2,25,23);
relocate_character(3,26,23);
force_instant_terrain_redraw();
pause(4);

text_bubble_on_char(6,"");
text_bubble_on_char(6,"There was once a");
force_instant_terrain_redraw();
pause(4);

text_bubble_on_char(6,"");
text_bubble_on_char(6,"terrible conflict between");
force_instant_terrain_redraw();
pause(4);

text_bubble_on_char(6,"");
text_bubble_on_char(6,"sliths and nephil.");
erase_text_bubbles();
force_instant_terrain_redraw();
pause(4);

force_view_center(33,22);
i = 7;
while (i <= 26)
{set_character_pose(i,2);
i = i + 1; }
force_instant_terrain_redraw();
pause(4);

set_flag(0,0,1);
message_dialog("What a good story!","Now leave to the south!");
end();
}

break;


--------------------
Bring back TM or [i]DIE.[/i]

To spread the hype, as well as cause your crush's name to appear on the screen, copy this into your signature.
Posts: 458 | Registered: Friday, August 6 2004 07:00
Law Bringer
Member # 4153
Profile Homepage #1
I doubt this, but maybe it's the space before "begintownscript;"

Honestly, I can't see what would give an Improper Command error... but here's one unrelated pointer, regarding this bit of code:
text_bubble_on_char(6,"");
text_bubble_on_char(6,"sliths and nephil.");
erase_text_bubbles();
force_instant_terrain_redraw();
pause(4);
As is, the code will erase the new bubble before the player ever sees it. It should read:
text_bubble_on_char(6,"");
text_bubble_on_char(6,"sliths and nephil.");
force_instant_terrain_redraw();
pause(4);
erase_text_bubbles();
force_instant_terrain_redraw();
pause(4);


--------------------
Gamble with Gaea, and she eats your dice.

I hate undead. I really, really, really, really hate undead. With a passion.
Posts: 4130 | Registered: Friday, March 26 2004 08:00
The Establishment
Member # 6
Profile #2
Generally such an error is due to some unmatched overlapping bracketing, weird parenthesis, or some overlapping syntax error that the engine cannot detect.

In your case, be sure to put a bracket { to enclose the while loop (in other words immediately after your while command). You end bracket terminates the if statement and your second one terminates the while loop which is, well, strange. See if this fixes it.

Also, use some spacing for every conditional/loop block. It makes your code easier to read.

[ Thursday, December 29, 2005 07:20: Message edited by: *i ]

--------------------
Your flower power is no match for my glower power!
Posts: 3726 | Registered: Tuesday, September 18 2001 07:00
Infiltrator
Member # 4826
Profile #3
quote:
In your case, be sure to put a bracket { to enclose the while loop (in other words immediately after your while command). You end bracket terminates the if statement and your second one terminates the while loop which is, well, strange. See if this fixes it.

There is already an end bracket. Thanks for trying though.

EDIT: Strange, it works now that I've put the same script into a new TextEdit file and changed the name of the script. Must've just been a nasty bug.

[ Thursday, December 29, 2005 09:25: Message edited by: Fire Shards ]

--------------------
Bring back TM or [i]DIE.[/i]

To spread the hype, as well as cause your crush's name to appear on the screen, copy this into your signature.
Posts: 458 | Registered: Friday, August 6 2004 07:00
Master
Member # 5977
Profile Homepage #4
No, what he/she (I'm sorry, but I don't know you're gender, *I) means, is that you should do the following:

Your code:
i = 7;
while (i <= 26)
{set_character_pose(i,2);
i = i + 1; }
Your modified code by me:
i = 7;
while (i <= 26) { // This what *I meant, i think
set_character_pose(i,2);
i = i + 1;
}
*I, this is what you eamnt, didn't you? otherwise i didn't understand it.

[ Thursday, December 29, 2005 09:30: Message edited by: Thralni, chicken god prophet ]

--------------------
Play and rate my scenarios:

Where the rivers meet
View my upcoming scenario: The Nephil Search: Escape.

Give us your drek!
Posts: 3029 | Registered: Saturday, June 18 2005 07:00
Infiltrator
Member # 4826
Profile #5
quote:
Originally written by Fire Shards:

There is already an end bracket.
Sorry, I meant starting bracket.
Thralni, I think *i just didn't see the first bracket after the while statement.

--------------------
Bring back TM or [i]DIE.[/i]

To spread the hype, as well as cause your crush's name to appear on the screen, copy this into your signature.
Posts: 458 | Registered: Friday, August 6 2004 07:00
Master
Member # 5977
Profile Homepage #6
No, i think you really have to put the starting bracket directly after the while statement, so like this:

while (your statement here) {

I'm not for 100% sure of this, but I'm quite certain it has to be done this way.

--------------------
Play and rate my scenarios:

Where the rivers meet
View my upcoming scenario: The Nephil Search: Escape.

Give us your drek!
Posts: 3029 | Registered: Saturday, June 18 2005 07:00
The Establishment
Member # 6
Profile #7
Thralni is correct about what I meant:

begintownscript;

variables;
short i;

body;

beginstate INIT_STATE;
set_name(6,"Prophet");
break;

beginstate START_STATE;
break;

beginstate EXIT_STATE;
break;

beginstate 10;
if (get_flag(0,0) == 0) {
force_view_center(25,21);
relocate_character(0,23,23);
relocate_character(1,24,23);
relocate_character(2,25,23);
relocate_character(3,26,23);
force_instant_terrain_redraw();
pause(4);

text_bubble_on_char(6,"");
text_bubble_on_char(6,"There was once a");
force_instant_terrain_redraw();
pause(4);

text_bubble_on_char(6,"");
text_bubble_on_char(6,"terrible conflict between");
force_instant_terrain_redraw();
pause(4);

text_bubble_on_char(6,"");
text_bubble_on_char(6,"sliths and nephil.");
erase_text_bubbles();
force_instant_terrain_redraw();
pause(4);

force_view_center(33,22);
i = 7;
while (i <= 26) {
set_character_pose(i,2);
i = i + 1;
}
force_instant_terrain_redraw();
pause(4);

set_flag(0,0,1);
message_dialog("What a good story!","Now leave to the south!");
end();
}

break;
This is the way I would write it and it usually works. It's also easier to see for debugging. I read through line by line, and couldn't find anything obvious, but I have a couple comments:

1) Avoid using flag 0,0 its use tends to be troublesome in BoE and I have suspicions about it in BoA.

2) A pause of 4 might be a bit too short, keep in mind that 4 means 0.4 seconds which is quite fast. I would recommend 10 for non-native English speakers. Ideal would be allowing the user to set cutscene speed. Consult the abilities of Bahssikava and some of TMs scenarios to understand the implementation.

3) The end() command is a bit redundant unless you have more coding you are not showing us in this state. You can probably eliminate it.

Oh yes, sometimes text editors will create goofy characters at the beginning of a file for purposes of keeping track of things. I would suggest using the simplest text editor you can find for this sort of stuff.

[ Thursday, December 29, 2005 12:02: Message edited by: *i ]

--------------------
Your flower power is no match for my glower power!
Posts: 3726 | Registered: Tuesday, September 18 2001 07:00
Off With Their Heads
Member # 4045
Profile Homepage #8
Placement of the brackets doesn't matter. I used to put brackets in the places where Fire Shards is putting them, and it worked just fine.

Alint gives me nothing. I'm pretty sure the syntax here is correct, although some of the effects (erase_text_bubbles, as mentioned above) will not be the ones desired.

Is there more to the script than this?

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Infiltrator
Member # 3040
Profile #9
Is it possible that line endings are the problem? Similar to what *i mentioned about bad characters, I've had problems with line endings where the game didn't recognize them. Are you using a Mac or a PC? If you're on a Mac, are you using TextEdit?

--------------------
5.0.1.0.0.0.0.1.0...
Posts: 508 | Registered: Thursday, May 29 2003 07:00
Infiltrator
Member # 4826
Profile #10
Yes, I'm on TextEdit, and I don't really need pointers because I'm not releasing this scen, but this friend of mine loves BoA and wanted me to make a cool cutscene for him.
Just making things clear to those who are hoping for new scenario releases.

--------------------
Bring back TM or [i]DIE.[/i]

To spread the hype, as well as cause your crush's name to appear on the screen, copy this into your signature.
Posts: 458 | Registered: Friday, August 6 2004 07:00
Infiltrator
Member # 3040
Profile #11
The issue I had with TextEdit was actually from mucking around with the A4 scripts rather than BoA, but it might be the same. Basically, I found that a new line in TextEdit (by hitting the "return" key) had hex value 0x0A, while the original line breaks in the scripts had hex value 0x0D. Changing the edited line breaks to the original ones (by copying and pasting) solved the issue.

I don't know how you can fix it, but try editing it in a different text editor, and use a find and replace to change all the original line breaks to new ones. Does that make sense? I hope I'm being clear.

--------------------
5.0.1.0.0.0.0.1.0...
Posts: 508 | Registered: Thursday, May 29 2003 07:00
Law Bringer
Member # 4153
Profile Homepage #12
That's odd... TextEdit has always worked fine for me.

--------------------
Gamble with Gaea, and she eats your dice.

I hate undead. I really, really, really, really hate undead. With a passion.
Posts: 4130 | Registered: Friday, March 26 2004 08:00
Infiltrator
Member # 3040
Profile #13
Well then that's probably not the problem. I was just offering a possible solution; if it's worked for you in the past, probably nothing has changed.

--------------------
5.0.1.0.0.0.0.1.0...
Posts: 508 | Registered: Thursday, May 29 2003 07:00
Master
Member # 5977
Profile Homepage #14
I once used Simpletext, but stopped using it as it was to unclear. tabs didn't show up right and it was a pain to use. Therefor i decided to use "BBedit lite 6.1." The best thing is, that 6.1, as its an outdated version, can be downloaded for free. You ca do that on any free software download website, like twucows (or something like that, i can't really remember what it was called). Try that.

--------------------
Play and rate my scenarios:

Where the rivers meet
View my upcoming scenario: The Nephil Search: Escape.

Give us your drek!
Posts: 3029 | Registered: Saturday, June 18 2005 07:00