Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Mon 23/08/2004 13:31:28

Title: Variable won't initialize?
Post by: on Mon 23/08/2004 13:31:28
Hi there, I use a variable to determine if you talked to your mum. In the main script
#sectionstart game_startÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function game_start() {
int mum_talk
}

I put this, and in interact with mum I have something liket his.

if(mum_talk==0)
{
(events)
mum_talk=1
}


But when I want to test, it says unexpected }
Title: Re: Variable won't initialize?
Post by: Ashen on Mon 23/08/2004 14:19:03
You've missed the ; off the end of the line, which is probably why you get the error - the engine doesn't know that the line has finished, so the } is unexpected. You've done the same with the game_start line as well.

Also, the mum_talk variable hasn't been created properly, which will cause an error too. It needs to be declared outside all functions, exported from the Global Script, and imported in the Script Header (look up export and import in the manual for more details).

Hope this helps.