How to make a default cursor in your game?

Started by shaungaryevans, Sun 22/03/2009 18:40:43

Previous topic - Next topic

shaungaryevans

Hi,

When I view my game at the minute the walk to cursor comes up automatically. I want the interact cursor to come up automcallically instead of the walk to cursor. Do anybody knows how to do this please?

Ghost

Just add the following line to the game_start section of your game, in the global script:

mouse.Mode = eModeInteract

Should work a charm.

monkey0506

Inside your GlobalScript.asc look for the function game_start. There you should be able to do this:

Code: ags
  mouse.Mode = eModeInteract;


The function is called as soon as your game is loaded but before any rooms are loaded. If you want the interact cursor to be used as your walk cursor as well you could do:

Code: ags
// GlobalScript.asc
// function on_mouse_click
  if (button == eMouseLeft) {
    if (GetLocationType(mouse.x, mouse.y) == eLocationNothing) ProcessClick(mouse.x, mouse.y, eModeWalkto);
    else ProcessClick(mouse.x, mouse.y, mouse.Mode);
  }


Edit: Yes Ghost, you may have beaten me this time. But mark my word, you haven't seen the last of me! 8)

shaungaryevans

Thank you very much, it works.

Also thank you for repling quickly.

:) 

Ghost

Quote from: monkey_05_06 on Sun 22/03/2009 18:51:10
Edit: Yes Ghost, you may have beaten me this time. But mark my word, you haven't seen the last of me! 8)

A pleasure to cross the blades with ye  :=

SMF spam blocked by CleanTalk