I'm having a bit of trouble with dialog. It seemed to run fine, the only problem being that I couldn't get it to quit. I tried reformatting my script, as per the example given in the engine's help file, but something appears the matter. My script: function dialog_request(int dr); {
dDialog1.Start()
if (dr==5) {
cCoop.AddInventory(iBridgeKey);
StopDialog();
}
The error I am receiving: GlobalScript.asc(523): Error (line 523): Nested functions not supported (you may have forgotten a closing brace)
Basically, what I'm trying to do is run the dialog, and when the stereotypical "Goodbye" is selected, give the player an item and exit the dialog GUI.
Maybe you just clipped off part of the code but it looks like you are, indeed, forgetting a brace. i only count 3, you need one more.
Uh... Where?
function dialog_request(int dr); {
dDialog1.Start()
if (dr==5) {
cCoop.AddInventory(iBridgeKey);
StopDialog();
}
right after the last brace. add one more after your final brace and see if that fixes it. your first brace, "(int dr); {" at this point, should connect to the brace at the end of "StopDialogue();". however, that last brace connects to "(dr==5)". just add another one. trust me.
Nope, still getting the same error. New script: function dialog_request(int dr); {
Dialog.Start()
if (dr==5) {
cCoop.AddInventory(iBridgekey);
StopDialog();
}
}
take out the semicolon in your first line of code.
It didn't work. I'm still receiving the same error.
the only other thing i could guess is your dialogue properties. is the name of your dialogue, "dialogue" or is it something else? you might need to specify a dialogue.
but for all you're trying to do with it, you might as well run the dialogue, and then have a separate function in either the room script, or the dialogue script, to give you the key. if the dialogue is not conditional on your choice of accepting the key or not, you might as well take the easy way out with this.
Well, my main problem is that I can't get the dialog to close after I select "Goodbye".
did you check the dialogue script? does it say "stop" instead of "return"?
THANK YOU! I didn't think it was that simple! You deserve a pizza trophy. (http://fc04.deviantart.net/fs11/i/2006/242/e/3/Trophy_for_You_by_gdflgum.jpg)
;D happy to help. but...don't be offended if i wind up eating the trophy.