Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Wizzard on Sun 12/06/2011 15:29:00

Title: Error with ChangeRoom script
Post by: Wizzard on Sun 12/06/2011 15:29:00
Using the script:

player.ChangeRoom(1, 40, 198) with a leave from right edge, causes the player to go back to the wrong room!!##***
Title: Re: Error with ChangeRoom script
Post by: Matti on Sun 12/06/2011 15:42:30
Make sure that 40, 198 aren't placed on an edge/region in room 1 that causes the player to change the room again.
Title: Re: Error with ChangeRoom script
Post by: Wizzard on Sun 12/06/2011 16:54:30
Oh blast!, I've just installed v 3.1.2 and no problems. I've deleted the game files from the 3.2.1 version and started making another game. Unfortunately the game files wont run on both versions.
I'll re-install the latest version again and make a note of your comments about the x,y positions clashing.
Dummies were flying everywhere!! ::)

Thanks for your help :)

EDIT: I've changed my mind, I'll stick with 3.1.2. It's got everything I need and no hiccups so far. :D
Title: Re: Error with ChangeRoom script
Post by: monkey0506 on Sun 12/06/2011 22:47:36
There's not any changes to the behaviour of Character.ChangeRoom between AGS 3.1.2 and 3.2.1 that I'm immediately aware of off the top of my head. This was almost certainly a case of user-error and didn't actually have anything to do with the AGS version.

You can certainly use 3.1.2 if you want, but downgrading the AGS version isn't always going to be a solution for this type of problem.
Title: Re: Error with ChangeRoom script
Post by: dbuske on Mon 13/06/2011 16:23:51
It happens to me once in a while that I put the character on the edge of a changeroom hotspot and then end up in the wrong room.
Title: Re: Error with ChangeRoom script
Post by: Wizzard on Mon 13/06/2011 18:19:57
I've now re-installed 3.2.1 and being very careful about returning to hot spots etc. I definitely messed up somewhere to make it happen in the first place. Thanks everybody for your input.
Now going ahead with a game I've been planning for a while. There's a lot of scripting stuff to learn but there's a lot of fun to be had in the process.

Best Wishes to all

Mike
Title: Re: Error with ChangeRoom script
Post by: monkey0506 on Mon 13/06/2011 19:59:07
dbuske, you seem to be describing both the problem and the solution pretty effectively. If you're sending the character to a room at coordinates at which you're telling the game, if the player is at these coordinates, send him to another room, then it's doing exactly what you're telling it to do. Just be aware of what coordinates you're sending the player to when changing rooms and you can avoid this problem.