Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Jakerpot on Tue 27/01/2009 16:23:19

Title: Buffer exceeded problem
Post by: Jakerpot on Tue 27/01/2009 16:23:19
Hello everybody! I can't figure this out:


function oLock_UseInv()
{
if (player.ActiveInventory == iRustyOldKey){
Display("Ops!");
Display("Dammit! The key is broken!");
player.LoseInventory(iRustyOldKey);
player.AddInventory(iHalfKey);
oLock.Visible = false;
oLock2.Visible = true;
}
}


the problem is:
Failed to save room room3.crm; details below
room3.asc(138): Error (line 138): buffer exceeded: you probably have a missing closing bracket on a previous line

WHY ??
please help me fast!
J-
Title: Re: Buffer exceeded problem
Post by: Matti on Tue 27/01/2009 16:38:59
Can you post the whole room 3 script? And did you have a look at line 138 and everything relevant before that?
Title: Re: Buffer exceeded problem
Post by: Jakerpot on Tue 27/01/2009 17:11:09

// room script file

function oSteelBar_PickUp()
{
player.Move(180, 165);
oSteelBar.Visible = false;
player.AddInventory(iSteelBar);
}

function oObject1_Interact()
{
int RandomInteract=Random(2);
if (RandomInteract==0)
  dRandomInteract1.Start();
if (RandomInteract==1)
  dRandomInteract2.Start();
else
  dRandomInteract3.Start();
}

function oObject1_Look()
{
cCharacter.Say("It's a blue screwdriver");
}

function oObject1_PickUp()
{
dCantReach.Start();
}

function oObject1_Talk()
{

    int RandomTalk=Random(2);
if (RandomTalk==0)
  dRandomTalk1.Start();
if (RandomTalk==1)
  dRandomTalk2.Start();
else
  dRandomTalk3.Start();

}
function oObject1_UseInv()
{
player.Move(50, 206);
  if (player.ActiveInventory == iGrabber){
Display("Yes! I got it!");
player.AddInventory(iScrewdriver);
oObject1.Visible = false;
}}

function oSteelBar_Look()
{
cCharacter.Say("It's a broken steel bar.");
}

function oSteelBar_UseInv()
{
dUseInv.Start();
}

function oObject0_Interact()
{
  int RandomInteract=Random(2);
if (RandomInteract==0)
  dRandomInteract1.Start();
if (RandomInteract==1)
  dRandomInteract2.Start();
else
  dRandomInteract3.Start();
}

function oObject0_Look()
{
cCharacter.Say("It's a brick almost falling from the wall.");
}


function oObject0_PickUp()
{
dBrickOnWall.Start();
}

function oObject0_UseInv()
{
if (player.ActiveInventory == iScrewdriver){
player.Move(123, 165);
Display("I got it from the wall!");
player.AddInventory(iBrick);
oObject0.Visible = false;
oHole.Visible = true;
  }
}

function oHole_Look()
{
cCharacter.Say("Its a hole on the wall.");
}

function oHole_PickUp()
{
   int RandomPickUp=Random(2);
if (RandomPickUp==0)
  dRandomPickUp2.Start();
if (RandomPickUp==1)
  dRandomPickUp2.Start();
else
  dRandomPickUp3.Start();
}

function oHole_UseInv()
{
cCharacter.Say(That won't work.)
}

function oHole_Talk()
{
     int RandomTalk=Random(2);
if (RandomTalk==0)
  dRandomTalk1.Start();
if (RandomTalk==1)
  dRandomTalk2.Start();
else
  dRandomTalk3.Start();
}

function oHole_Interact()
{
Display("I can feel a table.");
Display("And that's something there.");
Display("Got it!.");
player.AddInventory(iRustyOldKey);
oHole.Visible = false;
}

function oLock_UseInv()
{
if (player.ActiveInventory == iRustyOldKey){
Display("Ops!");
Display("Dammit! The key is broken!");
player.LoseInventory(iRustyOldKey);
player.AddInventory(iHalfKey);
oLock.Visible = false;
oLock2.Visible = true;
}
}

function oLock2_Interact()
{
  int RandomInteract=Random(2);
if (RandomInteract==0)
  dRandomInteract1.Start();
if (RandomInteract==1)
  dRandomInteract2.Start();
else
  dRandomInteract3.Start();
}

function oLock2_Look()
{
cCharacter.Say("It's an old lock.");
}

function oLock2_PickUp()
{
    int RandomPickUp=Random(2);
if (RandomPickUp==0)
  dRandomPickUp2.Start();
if (RandomPickUp==1)
  dRandomPickUp2.Start();
else
  dRandomPickUp3.Start();
}

function oLock2_Talk()
{
     int RandomTalk=Random(2);
if (RandomTalk==0)
  dRandomTalk1.Start();
if (RandomTalk==1)
  dRandomTalk2.Start();
else
  dRandomTalk3.Start();
}

function oLock2_UseInv()
{
if (player.ActiveInventory == iImprovisedKey){
   Display("Got it! Finnaly i will escape from that dungeon!");
   oLock2.Visible = false;
   oLock3.Visible = true;
   oDoor.Visible = true;
}}
function hDoor_Look()
{
cCharacter.Say("It's an old steel door.");
}

function hDoor_Interact()
{
cCharacter.Say("That door needs a key.");
}

function hDoor_PickUp()
{
   int RandomPickUp=Random(2);
if (RandomPickUp==0)
  dRandomPickUp2.Start();
if (RandomPickUp==1)
  dRandomPickUp2.Start();
else
  dRandomPickUp3.Start();
}

function hMetaltube_Interact()
{
  int RandomInteract=Random(2);
if (RandomInteract==0)
  dRandomInteract1.Start();
if (RandomInteract==1)
  dRandomInteract2.Start();
else
  dRandomInteract3.Start();
}

function hMetaltube_PickUp()
{
   int RandomPickUp=Random(2);
if (RandomPickUp==0)
  dRandomPickUp2.Start();
if (RandomPickUp==1)
  dRandomPickUp2.Start();
else
  dRandomPickUp3.Start();
}

function hMetaltube_Look()
{
cCharacter.Say("This is the damn thing that made me get in there.");
}

function hMetaltube_Talk()
{
    int RandomTalk=Random(2);
if (RandomTalk==0)
  dRandomTalk1.Start();
if (RandomTalk==1)
  dRandomTalk2.Start();
else
  dRandomTalk3.Start();
}

function hMetaltube_UseInv()
{
cCharacter.Say("I have 100% of certain that this will not work.");
}

function hCage_Look()
{
cCharacter("It's a metal cage used to trap animals.");
}

function hCage_Interact()
{
int RandomInteract=Random(2);
if (RandomInteract==0)
  dRandomInteract1.Start();
if (RandomInteract==1)
  dRandomInteract2.Start();
else
  dRandomInteract3.Start();
}

function hCage_PickUp()
{
  int RandomPickUp=Random(2);
if (RandomPickUp==0)
  dRandomPickUp2.Start();
if (RandomPickUp==1)
  dRandomPickUp2.Start();
else
  dRandomPickUp3.Start();
}

function room_RepExec()
{
}

function oDoor_AnyClick()
{

}

function oDoor_Interact()
{
Display("I hope that door leave's to an exit.");
FadeOut(10);
player.ChangeRoom(4, 50, 190);
}



this is the full code, and well, i never got that error message! And if i delete some of the script that i think its causing the error, the error appear in another string!
Help Me!
J-
Title: Re: Buffer exceeded problem
Post by: Khris on Tue 27/01/2009 17:17:56
In line 113 you have:
cCharacter.Say(That won't work.)

Title: Re: Buffer exceeded problem
Post by: Jakerpot on Tue 27/01/2009 18:30:24
oops...
well, i putted a ; on it and still don't fixed...
Help!
Title: Re: Buffer exceeded problem
Post by: Pumaman on Tue 27/01/2009 18:31:17
If you look in your oHole_UseInv function, you'll see the line that Khris is talking about. It is missing speech marks around the text.
Title: Re: Buffer exceeded problem
Post by: Jakerpot on Tue 27/01/2009 18:37:51
Oh YEAH! Now i got it! it have MUCH errors on the talking lines! I corrected them all!
Thanks!