Mouse click as action button instead of space bar?

Hi RPG Makers, I recently went through the forums and found a simple solution to turn off mouse click movement for the player sprite, implemented it nice and easy... but I still want the mouse click to work as the action button instead of space bar so interaction would be with mouse clicks, but just won't move the player sprite. Thank you all!
Hi RPG Makers, I recently went through the forums and found a simple solution to turn off mouse click movement for the player sprite, implemented it nice and easy... but I still want the mouse click to work as the action button instead of space bar so interaction would be with mouse clicks, but just won't move the player sprite. Thank you all!
Could i use a conditional to check and see if an event is in the space in front of my player to toggle between the two options?
I checked the condition if the spaces around the player are passable to enable a switch for mouse click but the problem is it enables click to any space on the screen, I would like clicks to be only available for events
found a simple solution to turn off mouse click movement for the player sprite, implemented it
What was the solution you used? There are plugins that disable mouse click for player movement

Also please stop double/triple posting and use the edit post function instead
What was the solution you used? There are plugins that disable mouse click for player movement

Also please stop double/triple posting and use the edit post function instead
Game_Temp.prototype.setDestination = function(x, y) {
if ($gameSwitches.value(7)) { return }; // <---- add this line here
this._destinationX = x;
this._destinationY = y;
};
the ID: 7 switch toggles it on/off
Game_Temp.prototype.setDestination = function(x, y) {
if ($gameSwitches.value(7)) { return }; // <---- add this line here
this._destinationX = x;
this._destinationY = y;
};
the ID: 7 switch toggles it on/off
Then you would just need a parallel common event that checked if an event is in front of the player, toggle that switch. Put a wait 10 frames or so so it doesn't check 60 times a second but 6 times a second.
Then you would just need a parallel common event that checked if an event is in front of the player, toggle that switch. Put a wait 10 frames or so so it doesn't check 60 times a second but 6 times a second.
lol that's kind of what I'm toying with now, problem is when an event is in front of the player it changes the toggle, which I want, but then the player can click other things than the event in front. I only want the player to be able to mouse click events that are in front of them.
I'm also running some tests now with some potential plugins that might work. thanks for the support
I'm getting closer but having trouble finding a way to check if an event is in front of the player, how would I do that?
I think I've found a temporary solution where I did use your method of checking for events in the tile in front of the player, still have a slight bug but workable for my demo thank you AquaEcho!
OMG I did it in epic fashion! We can close this!
Does it matter where on the Screen the Mouse Button is pressed?
Or when it is pressed it checks and activates the event infront of the player, in case there is one there?

I believe the Scriptcall List could be helpful with this.

I started with this attempt:
Code:
◆If:Script:TouchInput.isTriggered()
  ◆Control Variables:#0005 var5_x = Map X of Player
  ◆Control Variables:#0006 var6_y = Map Y of Player
  ◆If:Player is facing Down
    ◆Control Variables:#0006 var6_y += 1
    ◆
  :End
  ◆If:Player is facing Up
    ◆Control Variables:#0006 var6_y -= 1
    ◆
  :End
  ◆If:Player is facing Left
    ◆Control Variables:#0005 var5_x -= 1
    ◆
  :End
  ◆If:Player is facing Right
    ◆Control Variables:#0005 var5_x += 1
    ◆
  :End
  ◆Get Location Info:Var7_EvIdonTile, Event ID, ({var5_x},{var6_y})
  ◆If:Var7_EvIdonTile > 0
    ◆Script:$gameMap.event($gameVariables.value(7)).start();
    ◆
  :End
  ◆
:End
Does it matter where on the Screen the Mouse Button is pressed?
Or when it is pressed it checks and activates the event infront of the player, in case there is one there?

I believe the Scriptcall List could be helpful with this.

I started with this attempt:
Code:
◆If:Script:TouchInput.isTriggered()
  ◆Control Variables:#0005 var5_x = Map X of Player
  ◆Control Variables:#0006 var6_y = Map Y of Player
  ◆If:Player is facing Down
    ◆Control Variables:#0006 var6_y += 1
    ◆
  :End
  ◆If:Player is facing Up
    ◆Control Variables:#0006 var6_y -= 1
    ◆
  :End
  ◆If:Player is facing Left
    ◆Control Variables:#0005 var5_x -= 1
    ◆
  :End
  ◆If:Player is facing Right
    ◆Control Variables:#0005 var5_x += 1
    ◆
  :End
  ◆Get Location Info:Var7_EvIdonTile, Event ID, ({var5_x},{var6_y})
  ◆If:Var7_EvIdonTile > 0
    ◆Script:$gameMap.event($gameVariables.value(7)).start();
    ◆
  :End
  ◆
:End
Sorry for the late response, the above code will come in handy but I did already manage to get a system to work using a few plugins + scripting. Kind of a lot to explain via text but I can post a short clip of the solution if that would be beneficial for the forums.

Original thread: https://forums.rpgmakerweb.com/threads/mouse-click-as-action-button-instead-of-space-bar.158455/