Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Icey on Sat 08/10/2011 23:32:02

Title: Problems with character.changeroom?
Post by: Icey on Sat 08/10/2011 23:32:02

For some reason when ever I go to start the game I get a error message about can't convert character to int.

void ChangeRoomSaveXY(this Character*, int room_number, int x, int y)
{
  if (this == player)
  {
    px = this.x;
    py = this.y;
  }
  this.ChangeRoom(this, room_number, x, y);//This is the line I am directed to when using Dennis.ChangeRoom(x,x,x);
}

void ReturnToPreviousRoomAndPosition(this Character*)
{
  if (this != player) this.ChangeRoom(this.PreviousRoom);
  else this.ChangeRoom(this.PreviousRoom, px, py);
}



The thing is that I am using the normal character.changeroom however I think this line altered the function so it gives me this error.
Title: Re: Problems with character.changeroom?
Post by: Wyz on Sun 09/10/2011 00:41:42
It looks like you have a parameter too many in the function call. Change it to:
Quote
this.ChangeRoom(room_number, x, y);
Title: Re: Problems with character.changeroom?
Post by: Icey on Sun 09/10/2011 01:11:50
Thanks. That fixed it.