Button - Click Action - SetCursorMode doesn't work

Started by Klarnolph, Thu 04/07/2019 17:40:37

Previous topic - Next topic

Klarnolph

I'm trying to get my verb buttons to change the cursor mode.

So far I've made a GUI with five buttons, and set each button's Click Action to SetCursorMode, and the NewModeNumber to the corresponding cursor number. When I run the game, though, clicking the buttons does little to nothing, it blinks as if it changes image for a fraction of a second, but remains in Walk To mode.

If I'm supposed to put something in the global script, I haven't managed to find any info on it. I've read the manual and searched the forums.

Thankful for help!

Slasher

#1
Did you set cursor modes properly in the buttons events panel? These are built-in functions..

Khris

It sounds like your game has code that resets the cursor mode.

Which template did you use? The BASS template for instance changes the cursor mode based on the LocationType (the type of area under the mouse); you'll probably want to use the Empty or Sierra template instead.

Klarnolph

Quote from: Slasher on Thu 04/07/2019 17:50:50
Did you set cursor modes properly in the buttons events panel? These are built-in functions..

Yes, I believe I did. But you made me double-check, which is always a good thing! Thanks!

Quote from: Khris on Thu 04/07/2019 22:23:59
It sounds like your game has code that resets the cursor mode.

Which template did you use? The BASS template for instance changes the cursor mode based on the LocationType (the type of area under the mouse); you'll probably want to use the Empty or Sierra template instead.

I use the Empty template, but your first guess was right! I did have code that resets the cursor mode, from back when I struggled to make the cursor change over hotspots. I put the if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) != hotspot[0]) but the cursor image didn't changed back, so I improvised a line of if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hotspot[0]), which worked for the moment being, but of course was the root of my problems with the buttons.

Thank you for helping me see it!

SMF spam blocked by CleanTalk