Mouse over character

Started by ciborium, Wed 18/04/2007 23:16:50

Previous topic - Next topic

ciborium

Why doesn't this script work?
I'm trying to get the mouse to change to talk to when over a character.
This is in my repeatedly execute:

Code: ags

if (Character.GetAtScreenXY(mouse.x, mouse.y) == true){
  mouse.SaveCursorUntilItLeaves();
  mouse.Mode = eModeTalkto;
  }



Ashen

Read the manual
Quote from: Character.GetAtScreenXY
Returns the character if there is, or null if there is not. See the description of GetLocationName for more on screen co-ordinates.

The == true part of that doesn't mean anything - replace it with != null and it should work. You may also want to add a mouse.Mode != eModeTalkto check as well. Otherwise - as it's in rep_ex - the SaveCursorUntilItLeaves line will be repeated, 'saving' the mode as eModeTalkto.
I know what you're thinking ... Don't think that.

ciborium

#2
Thanks, I had used the != null in some other places, I just wasn't thinking clearly.

So far it's working as-is, except != null correction.

SMF spam blocked by CleanTalk