Error -18 No such function in script? How do I fix this?

Started by cjoleary, Sun 15/03/2009 17:43:53

Previous topic - Next topic

cjoleary

Error Message:

An internal error has occured. Please note down the following
information.
If the problem persists, post the details on the AGS Technical Forum.
(ACI version 3.12.1074)

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

Code:

// room script file
int lighta_fixed=0;
function Light1_Look(){
if (lighta_fixed==0)
  {
  player.Say("My God. It's useless...");
  }
}


Basically, I want my script to create a variable flag to see whether the light is broken, and if so make the player say the line involved when the look cursor is used. The function does exist in the room code, and the events tab of the relevant object names the correct function. So why the error message when I run the game and click on the light with 'look'? I did a search and couldn't find anything.

Khris

Capitalization is important: the function is called "Light1_Look()" but AGS tries to find "light1_Look()".

cjoleary

Thankyou, it works now! The main gimmick of the game is a repair feature, where an object has two states: fixed or broken. I'm doing it as a prototype exe for a university project.

SMF spam blocked by CleanTalk