Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Bartimaeus on Thu 01/09/2005 17:43:35

Title: Error: "macro 'NARRATOR' already defined" (SOLVED)
Post by: Bartimaeus on Thu 01/09/2005 17:43:35
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
Title: Re: Interaction with an Object: Error.
Post by: Rui 'Trovatore' Pires on Thu 01/09/2005 18:54:05
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.
Title: Re: Interaction with an Object: Error.
Post by: Pumaman on Thu 01/09/2005 19:10:14
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.
Title: Re: Interaction with an Object: Error.
Post by: Bartimaeus on Thu 01/09/2005 21:41:38
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