Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: LupaShiva on Sun 23/01/2011 03:23:08

Title: Help with mouse [SOLVED]
Post by: LupaShiva on Sun 23/01/2011 03:23:08
Hello everybody

I want to create a mouse that when its over a character, object, hotspot, anything that it can interact, it appear an interact mouse mode, and when its outside a walk mouse mode, only wanted to use those 2 kinds of mouses, but honestly dont know exactly how to do it, i searched the manual and i think it has something to do with Changemodehotspot and disablemode, butI'm quite messed up with this, thank you all for the replies.
Title: Re: Help with mouse
Post by: Khris on Sun 23/01/2011 04:57:52
You need to use GetLocationType in repeatedly_execute and change the mouse mode accordingly.
Title: Re: Help with mouse
Post by: LupaShiva on Mon 24/01/2011 00:18:52
Thank you khris  :) already did it, ill post script if someone might need it.

function repeatedly_execute() {
 
  if (GetLocationType(mouse.x,mouse.y) == eLocationHotspot)
    mouse.Mode = eModeInteract;
  if (GetLocationType(mouse.x,mouse.y) == eLocationCharacter)
    mouse.Mode = eModeInteract;
  if (GetLocationType(mouse.x,mouse.y) == eLocationObject)
    mouse.Mode = eModeInteract;
  if (GetLocationType(mouse.x,mouse.y) == eLocationNothing)
    mouse.Mode = eModeWalkto;}
Title: Re: Help with mouse
Post by: Khris on Mon 24/01/2011 00:53:31
Or just:

  if (GetLocationType(mouse.x,mouse.y) == eLocationNothing) mouse.Mode = eModeWalkto;
  else mouse.Mode = eModeInteract;
Title: Re: Help with mouse
Post by: LupaShiva on Mon 24/01/2011 01:17:42
HEHE Good  ;D