Moving to a new room after clicking a hotspot

Started by JackAnimated, Wed 27/08/2014 15:53:13

Previous topic - Next topic

JackAnimated

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.

Crimson Wizard

I don't see anything wrong, double-check if you are using correct room number maybe?

Khris

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).

Intense Degree

#3
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.

SMF spam blocked by CleanTalk