Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Gepard on Mon 10/11/2008 18:18:55

Title: script problem?
Post by: Gepard on Mon 10/11/2008 18:18:55
I created a room and added some hotspots. That was yesterday. Today, when I wanted to edit those hotspots (some scripts added to them), this came up:

---------------------------
AGS Editor Error
---------------------------
An attempt was made to edit a script function '#sectionstart hotspot3_c ' that does not exist. Ensure you have not manually deleted any automatically-created script functions.

And I dont have to say, that I did nothing. I also tried to create a new script function for those hotspots, but that doesnt work either. I mean I can add some function, but not script function. Scripts in the other rooms works just fine.

When I run game, it crashes and this comes up:

---------------------------
Adventure Game Studio
---------------------------
An internal error has occured. Please note down the following information.
If the problem persists, contact Chris Jones.
(ACI version 2.72.920)

Error: prepare_script: error -18 (no such function in script) trying to run 'hotspot6_a'   (Room 26)

Anyone please help me? I spend months on this game.

Thx!
Title: Re: script problem?
Post by: paolo on Mon 10/11/2008 20:17:10
Gepard,

Try opening the room script directly from the "Rooms" menu. It looks like you might have accidentally deleted the lines it is complaining about. Can you find them in the file (using F3)? If they are missing, you can type them back in.

Just for the record, your script should look like this:


#sectionstart hotspot3_c  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot3_c()
{
  //your code here
}
#sectionend hotspot3_c  // DO NOT EDIT OR REMOVE THIS LINE


and similarly for the other code it is complaining about.
Title: Re: script problem?
Post by: Dualnames on Fri 14/11/2008 12:08:10
I get those kind of errors, when I've done something like: You have declared a function for the sixth hotspot, but you've erased the code..? I have to see it, I'll kill it in no time. But I'm far from help this way.


EDIT: I'm talking about seeing the game via AGS editor not the code script.