Move than changeroom?

Started by mechsrule1, Thu 11/04/2024 20:08:15

Previous topic - Next topic

mechsrule1

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:

Code: ags
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?


RootBound

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.
They/them. Here are some of my games:

mechsrule1

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.

Snarky

What happens if you comment out the ChangeRoom?

mechsrule1

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!

SMF spam blocked by CleanTalk