Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: supercage82 on Sun 16/11/2014 20:45:52

Title: Problem with character leaving room
Post by: supercage82 on Sun 16/11/2014 20:45:52
I have just recently decided to try building something with AGS.

I added script to get my character to move from room 1 to room 2.  As soon as leaves room 1 I get the following error message:

Error: prepare_script: error-18 (no such function in script) trying to run 'room_Leave (Room 1)

What do I do to fix it?

Thanks very much for your help.
Title: Re: Problem with character leaving room
Post by: Cassiebsg on Sun 16/11/2014 21:31:33
Well, seems like you created a function(?) called room_Leave (Room 1) that you linked to somewhere, but you don't really have that function name on the script...

Posting your relevant code could probably help us to track down exactly what you did wrong though.
Title: Re: Problem with character leaving room
Post by: supercage82 on Mon 17/11/2014 12:14:21
The script I have in is:

function soulroom1_LeaveTop()
{
  DD.ChangeRoom(2);
}

Title: Re: Problem with character leaving room
Post by: Gurok on Mon 17/11/2014 12:21:04
You can do one of two things.

1. Add a new function to the room script of room 1 called room_Leave:
function room_Leave()
{
}


2. Delete the binding for "Leaves room". You can find it in the events tab of the properties pane (click the lightning bolt). Make sure room 1's "Leaves room" is blank, like so:
(http://i.imgur.com/6ABYrB6.png)
You can just click in the text field and delete the text that's there to remove the binding.
Title: Re: Problem with character leaving room
Post by: supercage82 on Wed 19/11/2014 19:52:22
Thanks very much guys.  The game is now working.