Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: guybrush on Sat 23/07/2005 19:00:42

Title: Error messages(scriptin problem) [SOLVED]
Post by: guybrush on Sat 23/07/2005 19:00:42
Hi! I don't know what's wrong, I did a little scripting, then, when I Test the Game, game loads and then i get this error message:
(http://img320.imageshack.us/img320/3790/error8la.jpg)
I really don't know what's the problem. Usually i get these kind of error messages before the game loads. It looks like it's the problem just in this one room. If i will have to, I'll post the script here, so you can see what's wrong. Thank you.
Title: Re: Error messages(scriptin problem)
Post by: Ishmael on Sat 23/07/2005 19:04:47
Mm... I interpret that message as that you have a Run Script interaction even in the room interactions, but there is no corresponding function to that script, or it is corrupted in some way, for that run script command. I suggest you post the room script, and a snapshot or laydown of your interaction editor view for the room...
Title: Re: Error messages(scriptin problem)
Post by: guybrush on Sun 24/07/2005 10:20:51
OK!
(http://img349.imageshack.us/img349/7716/lowdown6hl.jpg)
You see there are a lots of functions there. At first, I've put it all in just one "Run Script" fuction, but then i got the same error message as now. I though it will change something if I just do it like this, but it all stayed the same. In "Run Script", there is only "setbackgroundframe".

Here's the script:

/ room script file


#sectionstart hotspot1_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot1_a() {
Ã,  // script for Hotspot 1 (Bathroom mat): Interact hotspot
cMark.ChangeView(19); // or whatever the view's name is
Ã,  cMark.SpeechView = 19 ; // so you don't have to do it in the dialog script
Ã,  RunDialog(2); // start the dialog

Ã, 
}
#sectionend hotspot1_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart hotspot1_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot1_b() {
Ã,  // script for Hotspot 1 (Bathroom mat): Interact hotspot
// this code will be executed after the dialog ends:
Ã,  cMark.ChangeView(1);
Ã,  cMark.SpeechView = 2;Ã, 
}
#sectionend hotspot1_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE



#sectionstart room_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
Ã,  // script for Room: Player enters screen (before fadein)
#sectionend room_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE



#sectionstart hotspot9_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot9_a() {
Ã,  // script for Hotspot 9 (Keyhole): Use inventory on hotspot
SetBackgroundFrame(1);
WaitKey(100);Ã, 
}
#sectionend hotspot9_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart hotspot9_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot9_b() {
Ã,  // script for Hotspot 9 (Keyhole): Use inventory on hotspot
SetBackgroundFrame(0);
}
#sectionend hotspot9_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart hotspot5_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot5_a() {
Ã,  // script for Hotspot 5 (Beam of light): Use inventory on hotspot
SetBackgroundFrame(2);Ã, 
}
#sectionend hotspot5_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart hotspot5_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot5_b() {
Ã,  // script for Hotspot 5 (Beam of light): Use inventory on hotspot
Wait(156);Ã, 
}
#sectionend hotspot5_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE

I doubt that will help.
Title: Re: Error messages(scriptin problem)
Post by: Ishmael on Sun 24/07/2005 10:41:50
Actually I meant room interactions, not hotspot. As the error refers to failure running a room function, but it doesn't appear in the room script.
Title: Re: Error messages(scriptin problem)
Post by: guybrush on Sun 24/07/2005 10:55:55
Oh, OK:
(http://img331.imageshack.us/img331/1052/down24ur.jpg)
I think I know what's the problem; when i dobleclick on the "Run Script" Fuction above, I get this:
(http://img338.imageshack.us/img338/4610/bigerror7qr.jpg)
WHAT!!??
Title: Re: Error messages(scriptin problem)
Post by: Ishmael on Sun 24/07/2005 11:20:17
Delete the Run Script command and re-add it, see what happens.
Title: Re: Error messages(scriptin problem)
Post by: guybrush on Sun 24/07/2005 15:05:49
Yeah, i tought about that. And it worked. Thank you!
Title: Re: Error messages(scriptin problem)
Post by: strazer on Sun 24/07/2005 16:26:02
The problem was probably this:


#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
  // script for Room: Player enters screen (before fadein)
#sectionend room_a  // DO NOT EDIT OR REMOVE THIS LINE


As you see the function header
  function room_a() {
and the closing
  }
are missing. You probably accidently deleted it.

To remove a room function, always delete the corresponding "Run script" action in the interaction editor instead of just deleting the code from the room script. Otherwise the "Run script" action is linked to a non-existing function which can lead to these kind of problems.
Title: Re: Error messages(scriptin problem)
Post by: TerranRich on Wed 27/07/2005 06:06:27
Glad it worked. Also, keep in mind that Error message reports go in the main Technical Forum. Thank you.