Error: "macro 'NARRATOR' already defined" (SOLVED)

Started by Bartimaeus, Thu 01/09/2005 17:43:35

Previous topic - Next topic

Bartimaeus

Okay here's my interaction code for opening a door.
The character uses the 'Outhouse', the door opens, a few narrative sounds, the character exits, the door closes.

  // script for Object 3 (Outhouse): Interact object
  MoveCharacter (PETER, 38,157);
  while (character[PETER].walking){Wait(1);}
  AnimateObjectEx(3,eForwards,50,0,0,1);
 
  SetCharacterView(PETER,8);
  AnimateObjectEx(3,eBackwards,50,0,0,1);

  player.x=31;
  player.y=29;
  Wait(10);character[NARRATOR].x=31;
  character[NARRATOR].y=129;
  DisplaySpeech(NARRATOR, "Squelch!");DisplaySpeech(NARRATOR, "SPLAT!");
  Wait(20);DisplaySpeech(PETER,"I think I found something ...");
 
  AnimateObjectEx(3,eForwards,50,0,0,1);
 
  player.x=38;
  player.y=157;

  SetCharacterView(PETER,3);
  AnimateObjectEx(3,eBackwards,50,0,0,1);


When I try to run this in 2.7, this pops up:

  ---------------------------
Compile Error
---------------------------
There was an error compiling your script. The problem was:In: 'Internal character defines'Error (line 26): macro 'NARRATOR'

already definedDo you want to fix the script now? (Your room has not been saved).
---------------------------
Yes   No   
---------------------------


I click on Yes, I get this:

---------------------------
AGS Editor Warning
---------------------------
The error occured in an internal AGS script. This should never happen; try re-installing the latest version of AGS.
---------------------------
OK   
---------------------------


I don't even have a line 26 in my interaction script.

Wazzgoin'on!

~Billy
~The more adventures I go on, the more sand I get in my shoes

Rui 'Trovatore' Pires

I don't think you can have a "Narrator" character, at least not with that name, as that name probably became reserved internally. Try renaming the character and see what happens.

Also, for reference, that line 26 is not line 26 of the INTERACTION SCRIPT, but of the WHOLE SCRIPT which you can access via Ctrl-E or via the appropriate button.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

Ah yes, 'NARRATOR' is a built-in constant and so unfortunately you can't use it as a character script name. You'll need to change the character's script name to something else.

I'll see about updating the editor to prevent you from using this name to make it obvious.

Bartimaeus

Okay thanks alot,
I'm glad it's so simple.

Changed the name to SPEAKER and it all works fine now - well, my scriptings screwed but there are no errors and nothing I can't fix.

Cheers,
~Billy
~The more adventures I go on, the more sand I get in my shoes

SMF spam blocked by CleanTalk