Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Uhfgood on Fri 13/07/2012 07:20:29

Title: Can't get my hotspots to do anything.
Post by: Uhfgood on Fri 13/07/2012 07:20:29
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?)
Title: Re: Can't get my hotspots to do anything.
Post by: Khris on Fri 13/07/2012 09:43:18
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.
Title: Re: Can't get my hotspots to do anything.
Post by: Uhfgood on Sat 14/07/2012 06:57:31
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.
Title: Re: Can't get my hotspots to do anything.
Post by: steptoe on Sat 14/07/2012 08:47:06
Could you not just use

Code (AGS) Select
mouse.Mode =eModeWalkto; after Hotspot events?
Title: Re: Can't get my hotspots to do anything.
Post by: Khris on Sat 14/07/2012 09:49:47
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) Select
  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 (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=36383.msg477380#msg477380).
Title: Re: Can't get my hotspots to do anything.
Post by: Uhfgood on Mon 16/07/2012 20:44:50
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