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.
The RunDialog function is obsolete. It's called Dialog.Start() - in your case dPhil.Start or whatever the dialog is called.
dDialog0.Start() from what it looks like.
D'oh. Of course...
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 ( ?
There's a brace or several missing from the function before that one.
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();
}
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
You've forgotten the closing brace } for the function btnDeleteSave_OnClick...
It should be:
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!
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.
That means that you're missing a closing parenthesis.
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! :)
So, I'm missing a second parentheses? I don't know exactly :P
Terran is saying to change:
SaveGameSlots[1stSaveGameList.SelectedIndex]
to
SaveGameSlots(1stSaveGameList.SelectedIndex)
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 ).
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.
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. ;)
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!
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... (http://img217.imageshack.us/img217/4594/error2v.th.jpg) (http://img217.imageshack.us/i/error2v.jpg/)
I AM SO CONFUSED! CAN SOMEONE HELP ME? THANKS!
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?
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!
To leave a dialog, replace "return" with "stop".
And if you really only want the character to say a single line, why not use a simple
player.say("FooBar, now with extra fruit!")
and unlock the actual dialogue later?