Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: pakolmo on Fri 25/11/2016 22:30:56

Title: Room2 is not responding
Post by: pakolmo on Fri 25/11/2016 22:30:56
I have 2 rooms in my new game. I can view room2, but I don't know how did to do something in room2. Which are the functions to start room2?

I have at room1.
Code (ags) Select

function room_FirsLoad()
{
player.ChangeRoom(2);
}


And now in room2?
Title: Re: Room2 is not responding
Post by: Slasher on Sat 26/11/2016 05:08:44
You should use the built in function for the room and not just type it in (and you missed out the t):

Code (ags) Select

function room_FirstLoad()
{
player.ChangeRoom(2);
}
Title: Re: Room2 is not responding
Post by: pakolmo on Sat 26/11/2016 05:23:18
I'm sorry. Is First_Load. I writed bad, but:

I put in room2:
Code (AGS) Select

function room_FirstLoad()
{
    aSound1.Play(); //or something else
}


The game show room 2, but, my game desn't reconize any function in room 2. Which is the function that I have to use?
Title: Re: Room2 is not responding
Post by: Mandle on Sat 26/11/2016 14:56:09
Any time you want a room function to work you must link it to the room:

Go to the room in the editor, and then on the bottom right you will see a panel where you can select room functions via the lightning bolt button.

Click on that and then click on the "Room First Load" option. Now click on the little square box icon to the far right of that.

This should take you into the room script where your function is and now you have linked the room and that function to each other.