"Walk" click on hotspot

Started by CaptainD, Sat 28/04/2007 13:49:08

Previous topic - Next topic

CaptainD

Apologies if this has already been answered before but I couldn't find it anyway.

I have a hotspot on one screen that has options fo all the normal interactions, but I want to make it so that if you click on it whne the mouse cursor is on the WALK function, it will take you to a new location. 

I'm using the script belopw:

if (mouse.Mode == 0) {
player.ChangeRoom(4,185,280);
}


I'm using the RON template, I'm not entirely sure if zero is the figure for the walk cycle but I'm not sure how to work it out from the global script and from trial and error testing 1-3 seem to refer to the other functions.

Any ideas?

CaptainD

Ashen

Cursor mode 0 is Walk To - but why did you need trial and error to figure that out? You could've looked at the 'Cursors' section of the editor, or just used if (mouse.Mode == eModeWalkto) and not worried about the number at all.

The problem is probably that, by default, eModeWalkto doesn't trigger interactions in the same way as other modes - so that code is useless. To make it work, you'll need to check the 'Don't automatically move character in Walk Mode' option, and re-write on_mouse_click slightly, to include a player.Walk command for Walk mode clicks.
It's possible that the RON template has taken care of that already. In which case, where did you put that code?
I know what you're thinking ... Don't think that.

Khris

Shouldn't putting it in "any click on" work?

Ashen

Not without doing the 'Don't automaticaly move' thing, no. (That's what I meant by "eModeWalkto doesn't trigger interactions in the same way as other modes".)

According to the manual, checking that option causes eModeWalkto to trigger the Hotspots 'Player stands on hotspot' interaction, so you could use that instead of 'Any click' and if (mouse.Mode == ...

Another, probably easier, option would be to use a Region in conjunction with the Hotspot. Clicking the Hotspot in eModewalkto will make the player move to the Hotspots Walk-To point, and then the Region handles the location change.
I know what you're thinking ... Don't think that.

CaptainD

Quote from: Ashen on Sat 28/04/2007 15:41:52
Not without doing the 'Don't automaticaly move' thing, no. (That's what I meant by "eModeWalkto doesn't trigger interactions in the same way as other modes".)

According to the manual, checking that option causes eModeWalkto to trigger the Hotspots 'Player stands on hotspot' interaction, so you could use that instead of 'Any click' and if (mouse.Mode == ...

Another, probably easier, option would be to use a Region in conjunction with the Hotspot. Clicking the Hotspot in eModewalkto will make the player move to the Hotspots Walk-To point, and then the Region handles the location change.

Thanks, that's probably going to be the easiest way round it.

SMF spam blocked by CleanTalk