My cXXX_Talk function gone rouge

Started by Sensei, Thu 26/04/2012 12:18:23

Previous topic - Next topic

Sensei

Something is wrong with this script:

function cLoring_Talk()
{
  if (cSydny.Room == 1)
  {
    if (Game.DoOnceOnly ("TalkLoringCell") == true)
    {
      cSydny.Walk (600,  590, eBlock, eWalkableAreas);
      cSydny.FaceCharacter (cLoring, eBlock);
      cLoring.Say (" Dress yourself girl. We havent got all day. ");
      cSydny.Say ("But i wanna kno...");
      cLoring.Say ("You can ask qestions once we get out of here.");
    }
  }
}

Error: Nested functions not supported (You may have forgotten a closing brace)

Can somebody tell me what´s wrong? This script accualy worked already. I´m sure i didn´t make any changes in it, but in one moment ags just started to write this error. Only thing i changed since i tested this script was few changes in other scripts whitch aren´t related with this one.
I´ll be glad for any suggestios how to solve it.

Khris

If you're getting the "nested functions" error in line X, that means you forgot a closing brace somewhere above line X.

For instance, this:
1  function Hello() {
2    player.Say("Hello!");
3
4
5  function Bye() {
6    player.Say("Bye!");
7  }
will tell you about an error in line 5. (Since in line 5, the function keyword was found, but inside another function.)

To check braces, you can move your cursor directly after one, then hit Ctrl+B and it will show the corresponding one.

Sensei

Above that line? Good to know. ;)

Got it!
Thanks again.


Khris

Btw, please use the forum search before opening a thread.
Searching the technical forums for posts with "nested functions" in the subject line yielded lots of relevant hits, including for instance:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=44387

SMF spam blocked by CleanTalk