SSH Productions: Module documentation for ChangeRoomFixed.zip

Module: ChangeRoomFixed 1.00, by SSH

Fix the broken ChangeRoom in AGS 3.0

Download ChangeRoomFixed as a zip file

Author

Andrew MacCormack (SSH)

Please use the messaging function on the AGS forums to contact

me about problems with this module

Abstract

Fix the broken way in which player.ChangeRoom moves the

player *before* changing room in AGS 3.0

Dependencies

AGS 3.0 only: should be natively fixed in v3.01

Functions

Character.ChangeRoom(int room_number, optional int x, optional int y)

Changes the room that the character is in.

If you call this on the player character, then the current room is unloaded

from memory and ROOMx.CRM is loaded instead, where X is room_number.

IMPORTANT

This command does not change the room immediately; instead, it

will perform the actual room change once your script function has finished

(This is to avoid problems with unloading the script while it is still

running). This means that you should not use any other commands which rely

on the new room (object positionings, and so on) after this command within

the same function.

If you call this on a non-player character, then they are instantly

transported to the new room number.

Example

   // instead of:
   player.ChangeRoom(4, 120, 170);
   // use:
   player.ChangeRoomFixed(4, 120, 170);

Caveats

CJ will probably fix this before v3.01 is fulyl released

Revision History

20 Mar 08: v1.0 Created module

Licence

ChangeRoomFixed AGS script module

Copyright (C) 2008 Andrew MacCormack

This module is licenced under the Creative Commons Attribution Share-alike

licence, (see http://creativecommons.org/licenses/by-sa/2.5/scotland/ )

which basically means do what you like as long as you credit me and don't

start selling modified copies of this module.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

DEALINGS IN THE SOFTWARE.

In addition to the licences mentioned in the modules themselves, you may choose to use the following creative commons licence if you prefer for all AGS modules and open source code resources on my site.

Creative Commons License
This work is licenced under a Creative Commons Licence.