Variable won't initialize?

Started by neopolis3, Mon 23/08/2004 13:31:28

Previous topic - Next topic

neopolis3

Hi there, I use a variable to determine if you talked to your mum. In the main script
Code: ags
#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.

Code: ags
if(mum_talk==0)
{
(events)
mum_talk=1
}


But when I want to test, it says unexpected }

Ashen

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.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk