Im back, question about Dialog_requests. Parse error.

Started by Mr Jake, Tue 03/06/2003 16:35:59

Previous topic - Next topic

Mr Jake

What does Parse error mean, Ive programmed it as best I can from  the manual, (no example and very little on it :( ), but here is the selection of script
function dialog_request (int 1)
{
 Playmusic(3);
}

plz help :)
thxs in advance

Scorpiorus

check this thread: http://www.agsforums.com/yabb/index.php?board=2;action=display;threadid=6151;

it should be:

function dialog_request (int parameter)
{
if (parameter == 1) {Playmusic(3);}
}

-Cheers

Mr Jake

ok, thxs

I did it and now it says nesting function not supported???
and how do I add after this with the line 'else if'

Proskrito

the "nested function" stuff is often related to a missing } (at least for me) so i would check the { and }.
for the else if it should be something like:

function dialog_request (int parameter){
 if (parameter == 1) {
    Playmusic(3);
 }
 else if (parameter == 2) {
    yourscript;
 }
 else if .....
}



Mr Jake

it works now apart from it says undefined tokens, playsound!

thxs for the help.. any ideas about this one?

Scorpiorus

PlaySound()

remember AGS script language is case-sensitive. ;)

-Cheers

Mr Jake

opps... thxs alot :)
AAAAAAAAAAHHHHHHHHHH!!!!!!!1 now its doing the nesting function thing again! Will this night mare never end :)

Scorpiorus

hehe, remembering the old basicA times it was a real tragedy when a "close bracket" is missing somewhere. ;D

ok, post the new function code for us to find the problem.

Mr Jake

Will do tomorrow.... Im tired now and my sis it bugging me to ue the PC.... sry :)

Mr Jake

sry about bump....
this is how I would type waht I wanted to happen

function dialog_request (int parameter){
if (parameter == 1) {
PlaySound(3);
}
else if (parameter == 2) {
character[zom].room (3);
}

I get nesting funtion errors

Scorpiorus

function dialog_request (int parameter) {
if (parameter == 1) {
PlaySound(3);
}
else if (parameter == 2) {
character[ZOM].room = 3; //<--- not sure if this is what you want :P
}

} //<---- the function needs to be closed ;)

-Cheers

Mr Jake

#11
Thanks I couldnt remember the exact command to add my char to the room :)
EDIT: Checked it and it works!!!
thxs all... hope to be finished soon. about 20% done so far (I think)

SMF spam blocked by CleanTalk