Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: JackAnimated on Wed 27/08/2014 15:53:13

Title: Moving to a new room after clicking a hotspot
Post by: JackAnimated on Wed 27/08/2014 15:53:13
Hi all,

I am trying to get the player to click on a hotspot (ladder), walk to it and then the room to change. He walks to it, but no room change. What am I missing?

Quotefunction hLadder_AnyClick()
{
    cJohn.Walk(186, 91, eBlock, eWalkableAreas);
    cJohn.ChangeRoom(7, 205, 112);
}

Cheers.
Title: Re: Moving to a new room after clicking a hotspot
Post by: Crimson Wizard on Wed 27/08/2014 15:58:00
I don't see anything wrong, double-check if you are using correct room number maybe?
Title: Re: Moving to a new room after clicking a hotspot
Post by: Khris on Wed 27/08/2014 16:04:14
Quick guess: you have added a walk-to point which causes the player to walk to the hotspot, but the function is never called (since eModeWalkto clicks on hotspots send the player to the WalkToPoint by default but don't trigger AnyClick()).

Two solutions: either use a region and its "steps onto" event for the room change, or use "interact with hotspot" and the interact cursor mode (either the player has to interact with the ladder to use it, or left-clicking on hotspots automatically runs the "interact with" event, depending on the UI you're using).
Title: Re: Moving to a new room after clicking a hotspot
Post by: Intense Degree on Wed 27/08/2014 16:40:15
I may well be wrong about this but isn't it the case that AnyClick() isn't triggered by Walk mode? I'm sure I had a problem with that before.

EDIT: Sorry, didn't read the thread properly, Khris has already said that.