Can't get my hotspots to do anything.

Started by Uhfgood, Fri 13/07/2012 07:20:29

Previous topic - Next topic

Uhfgood

i created some hotspots, and generated "any click" events for them in the room script but they don't seem to do anything.

I think it has either something to do with my gui's (these are only for display, as I turned off the clickable properties, and just set their visibility flags in scripts), or the cursors.  The gui is a custom gui I created that pops up whenever a user clicks anywhere (it pops up like i said in script via the visibility flag).  I'm using the walk-to cursor only right now as I'm not doing the typical user interface.  I read somewhere about setting a certain cursor to allow interaction (the interact cursor maybe?)

Khris

Not all cursor modes behave the same way, and the walk cursor in fact doesn't trigger the "any click on" event.
I'd use the interact cursor instead.

Uhfgood

Okay so when I switch to the interact cursor mode, the hotspots work but now he won't walk around the screen.  Is there a way I can do both on one cursor?

I suppose I could check when he stopped moving with the Moving property, then switch to the interact mode until after he's selected an option, and then switch back to walk mode.  A bit cumbersome, and I would have to set it back to walk mode after every call to hotspot click events.

steptoe

#3
Could you not just use

Code: AGS
mouse.Mode =eModeWalkto; 
after Hotspot events?
It's not over until the fat lady sings..

Khris

If you simply want the player to walk to where the click was before executing the interact click, do this in on_mouse_click/eMouseLeft:
Code: ags
  player.Walk(mouse.x + GetViewportX(), mouse.y + GetViewportY(), eBlock);
  ProcessClick(mouse.x, mouse.y, eModeInteract);


If you want to be able to set a precise position, direction and to interrupt the walk by another click, take a look at my GotThere module.

Uhfgood

Thanks Khris although I had to leave off the "eBlock" part as I need it to go back to the script to check if the correct option was clicked

SMF spam blocked by CleanTalk