Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: mechsrule1 on Thu 11/04/2024 20:08:15

Title: Move than changeroom?
Post by: mechsrule1 on Thu 11/04/2024 20:08:15
So trying to figure things out on my own but I'm stumped on this, mostly because I'm reading the manual and the code isn't behaving as the manual says it should.

This is what I have:

function hHotspot1_Interact(Hotspot *theHotspot, CursorMode mode)
{
  player.WalkStraight(155, 315,  eBlock);
  player.ChangeRoom(5, 330, 360, eDirectionDownLeft);
 
}

I want the character sprite to move to a certain location, THEN transition to the new room. But what's happening is it's just moving to the new room without any delay. Is there something obvious I'm missing?

Title: Re: Move than changeroom?
Post by: RootBound on Thu 11/04/2024 20:50:15
Are you using walkable areas in the room? In the Walk command, if you don't specify eWalkableAreas or eAnywhere it will default to eWalkableAreas. Then, if there is no walkable path to the destination, the character will simply change rooms when it has walked as far as possible. If you don't want to use a walkable area, use eAnywhere.
Title: Re: Move than changeroom?
Post by: mechsrule1 on Thu 11/04/2024 22:08:30
Quote from: RootBound on Thu 11/04/2024 20:50:15Are you using walkable areas in the room? In the Walk command, if you don't specify eWalkableAreas or eAnywhere it will default to eWalkableAreas. Then, if there is no walkable path to the destination, the character will simply change rooms when it has walked as far as possible. If you don't want to use a walkable area, use eAnywhere.

Yes, I've got walkable areas. I even double checked and the destination point is within the walkable area.
Title: Re: Move than changeroom?
Post by: Snarky on Thu 11/04/2024 22:11:17
What happens if you comment out the ChangeRoom?
Title: Re: Move than changeroom?
Post by: mechsrule1 on Thu 11/04/2024 22:19:42
Quote from: Snarky on Thu 11/04/2024 22:11:17What happens if you comment out the ChangeRoom?
Aaaahhhhhh now I see the problem. There's 2 hotspots in the room on opposite sides and I had them swapped in the code. Thanks!