Help... error with line 525 about Undefinedtoken "Rundialog"

Started by Atrocious Toaster, Tue 30/06/2009 23:13:21

Previous topic - Next topic

Atrocious Toaster

Here's what I put in the last 5 lines of the script for Phil Nihilist about talking to him and activating the dialogue:


function cPhil_Talk()
{
RunDialog(dDialog0);
}

This is what it said about "Compilation Errors"

Error (line 525): Undefined Token 'RunDialog':P. I am in serious need of help urgently.

Matti

The RunDialog function is obsolete. It's called Dialog.Start() - in your case dPhil.Start or whatever the dialog is called.

TerranRich

Status: Trying to come up with some ideas...


Atrocious Toaster

Now it says: "Error (Line 524): Nested functions not supported (You may have forgotten closing a brace)."

This is Line 524: function cPhil_Talk()

Now I know that bracket at the end of cPhil_Talk is closed. What, did I forget a space between k and ( ?

Ishmael

There's a brace or several missing from the function before that one.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Atrocious Toaster

Here's the btnDeleteSave_OnClick Function, the cPhil_Talk Function, and the cPhil_Look Function, in order on the global script.

function btnDeleteSave_OnClick(GUIControl *control, MouseButton button)
{
  if (lstSaveGamesList.SelectedIndex >= 0)
  {
    DeleteSaveSlot(lstSaveGamesList.SaveGameSlots[lstSaveGamesList.SelectedIndex]);
    lstSaveGamesList.FillSaveGameList();
  }



function cPhil_Talk()
{
dDialog0.Start();
}

function cPhil_Look()
{
dDialog1.Start();
}

Ryan Timothy B

Code: ags
function btnDeleteSave_OnClick(GUIControl *control, MouseButton button)
{
  if (lstSaveGamesList.SelectedIndex >= 0)
  {
    DeleteSaveSlot(lstSaveGamesList.SaveGameSlots[lstSaveGamesList.SelectedIndex]);
    lstSaveGamesList.FillSaveGameList();
  }
} //<-----this bracket


function cPhil_Talk()
{
 dDialog0.Start();
}

function cPhil_Look()
{
 dDialog1.Start();
}


Brace was missing. The one before the cPhil_Talk() function.

edit: oh and I beat monkey :p

monkey0506

You've forgotten the closing brace } for the function btnDeleteSave_OnClick...

It should be:

Code: ags
function btnDeleteSave_OnClick(GUIControl *control, MouseButton button)
{
  if (lstSaveGamesList.SelectedIndex >= 0)
  {
    DeleteSaveSlot(lstSaveGamesList.SaveGameSlots[lstSaveGamesList.SelectedIndex]);
    lstSaveGamesList.FillSaveGameList();
  }
}


function cPhil_Talk()
{
 dDialog0.Start();
}

function cPhil_Look()
{
 dDialog1.Start();
}


EDIT: Ryan got there first! But yes!

Atrocious Toaster

I am cursed by a non-bug continuous super-repeated message of death. Now it's this!
Error (Line 521): PE04: parse error ar ')'

And to confirm suspicions, this is line 521:

)

The one you told me to bracket. So, I'm at a loss here, folks! PLEEZ try to help. Oops! Pardon the first word on that last sentence. Please, okay? Thank you.

TerranRich

That means that you're missing a closing parenthesis.

Code: ags
DeleteSaveSlot(lstSaveGamesList.SaveGameSlots(lstSaveGamesList.SelectedIndex));


You had ]) instead of )).

Remember, if it says there's an error with a '(' or a ')', then check all parentheses! :)
Status: Trying to come up with some ideas...

Atrocious Toaster

So, I'm missing a second parentheses? I don't know exactly :P

Scummbuddy

Terran is saying to change:

SaveGameSlots[1stSaveGameList.SelectedIndex]

to

SaveGameSlots(1stSaveGameList.SelectedIndex)
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Khris

No, SaveGameSlots is an array property, so square brackets are correct there.

AtrociousToaster, you were meant to place a "curly" bracket } at line 521, not a standard one ).

TerranRich

Square brackets [ ] are for index arrays. â€" MyArray[SomeIndexNumber]
Curly braces { } are for blocks of code, especially contained within if, while, and function blocks. â€" if (SomeVar == 7) { DoCode(); }
Parentheses ( ) are for parameters sent to a function, as well as grouping expressions within if and while blocks. â€" while (SomeVar < 10) { SomeVar++; }

Always make sure each ( [ { has an ending } ] ) and that they match up perfectly. It's always a good idea to work from the outside in, matching up blocks of brackets/braces/parentheses.

And sorry about the mix-up with the SaveGameSlots array.
Status: Trying to come up with some ideas...

monkey0506

And just in case you get lost or confused trying to match up your braces {}, brackets [], and parentheses (), you can always highlight the brace/bracket/parenthesis in question (works for both opening and closing) then press Ctrl+B which will highlight the matching brace/bracket/parenthesis.

If you see that Ctrl+B is obviously selecting the wrong brace/bracket/parenthesis, that means that you're missing one somewhere. ;)

Atrocious Toaster

Of course *slap myself in the face* I used a Parentheses where it was not supposed to be used! I overlooked what I didn't need because I was looking for what I didn't have! Ow, my brain hurts. I'll check back to say what happens!

Atrocious Toaster

HOORAY! It works, but now A: I can't leave the chat with Phil when I click on Bye (I am SO NEW to this program :P!) And B: Every time I use Dialog1 for the LookatPhil Sequence it goes...

I AM SO CONFUSED! CAN SOMEONE HELP ME? THANKS!

Matti

It seems that you turned all the dialog options off (forever), so that the dialog can't be started. Don't know why this gives an error message though.

Can you post the code where you want to start the dialog and perhaps the dialog too?

Atrocious Toaster

Well, I want one character to say one line without the menu, not that Display stuff. You know, the words over his head. I tried dialogue, but it still wouldn't go through!

 
SMF spam blocked by CleanTalk