I have a problem. I have made a hotspot over a door which i had drawn. I have made the walkable areas and all. And now i want the character to change room when the hotspot is interacted with. (the door) I have tried the Character.ChangeRoom (int room_2); line in the script editor but it doesnt work. Anyone have any tips?
use:
player.ChangeRoom(2);
I did, an error says: There were compilation errors, see the output window for details.
Well, what does the output window say?
I dont know where it is.
It should be right below the main screen (the script or the room or any other view)..
Are you using version 3.x?
The output window normally points to a specific line in the script where the error is located.
Oh right, that one. It says: Failed to save room room1.crm; Details below
Error (Line1): unexpected '}'
Yes, i use version 3.0
Well, then please post your script here (not only line 1).
Probably there's a '}' too much or at a wrong position, but maybe something else is wrong.
}
player.ChangeRoom (2);
{
Haha. It's supposed to be { } and not } {
I think that should do it..
Don't know about the other parts of your script, but braces are arranged as {} NOT }{ :P. So, instead:
{
player.ChangeRoom (2);
}
However, as it's reported that the } appears in line 1 of the script, you probably didn't put that part of the codes into a function of the desired event, so it probably won't work anyway. You need to put it inside the function generated by the interact hotsport event (as you mentioned in the first post).
Matt beated me but I'll just post anyway.
I still dont get it to work, same error message.
Like Gilbot said:
Quote from: Gilbot V7000a on Tue 29/04/2008 13:40:00
you probably didn't put that part of the codes into a function of the desired event, so it probably won't work anyway. You need to put it inside the function generated by the interact hotsport event (as you mentioned in the first post).
So it should look like that (in the ROOMSCRIPT):
interact_hotspot...()
{
player.ChangeRoom (2);
}
I inserted that piece of code but it still wont work. Im sorry if i appear dumb but im a total newbie to AGS and dont have any coding experience.
Perhaps it would help if you could post the WHOLE roomscript.
Infact your hotspot-interaction can't be line ONE of your roomscript..
Oh now i got it! Thanks everyone for helping! Oh by the way, where should i look for the .exe file i get when i click "build exe" I looked in the same folder as AGS is in, but didnt find it.
The .exe-file is in your game's folder which is usually in the AGS-folder..
Please modify your first post and put (solved) behind the title so everyone knows that there's no problem here anymore..