Invetory = Yes/No Do This/That Script Not Working

Started by ScottDoom, Thu 01/07/2004 11:51:42

Previous topic - Next topic

ScottDoom

Ã,  // 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 }"

Ishmael

check with the room script that the function's end } has not gotten lost anyhow...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

ScottDoom

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.

Ishmael

That's where we all start, asking n00bish questions, and learning. :)
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

InCreator

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?

Scorpiorus

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.

SMF spam blocked by CleanTalk