Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: ScottDoom on Thu 01/07/2004 11:51:42

Title: Invetory = Yes/No Do This/That Script Not Working
Post by: ScottDoom on Thu 01/07/2004 11:51:42
Ã,  // script for room: Player enters screen (after fadein)
if (character[GetPlayerCharacter()].inv[1] > 0) {Ã, 
Ã,  Ã, Display("Jeremy, I believe you have everything.");
Ã,  Ã, }
if (character[GetPlayerCharacter()].inv[1] == 0) {
Ã,  Display("Jeremy, I think you missed something.");
Ã,  }
if (character[GetPlayerCharacter()].inv[1] == 0) {
Ã,  Display("If only there were some way you could go back in time and get what you needed...");
Ã,  }

Maybe I'm blind, but I'm getting this error: "Function still open, missing }"
Title: Re: Invetory = Yes/No Do This/That Script Not Working
Post by: Ishmael on Thu 01/07/2004 11:55:31
check with the room script that the function's end } has not gotten lost anyhow...
Title: Re: Invetory = Yes/No Do This/That Script Not Working
Post by: ScottDoom on Thu 01/07/2004 12:02:06
Hahah. I looked at the room script, and added a } at the end and it works now. I noticed before that it usually added one at the end. I wonder how it got lost this time...

Sorry for being such a n00b at scripting. I'm just trying to script every type of situation possible in my mini/test-game thing before I start on my real game.
Title: Re: Invetory = Yes/No Do This/That Script Not Working
Post by: Ishmael on Thu 01/07/2004 12:15:59
That's where we all start, asking n00bish questions, and learning. :)
Title: Re: Invetory = Yes/No Do This/That Script Not Working
Post by: InCreator on Thu 01/07/2004 15:04:51
This happens... when you make a mistake, try to save a room and AGS suggests you to fix the script. then it goes to the room's whole script, not to particular object/hotspot's one.

And this is where all hotspot/object scripts are, in extra brackets to separate each other, which you may accidentally erase and get this otherwise strange looking error.
Right?
Title: Re: Invetory = Yes/No Do This/That Script Not Working
Post by: Scorpiorus on Sat 03/07/2004 11:03:19
There is a wonderful 'Match brace' feature in the AGS script editor. Just put a cursor near a brace and choose from the menu Edit > Match brace (or simply hit Ctrl-B). It will mark the text and show you the whole block.