Force action button input\run intractable event nearby via Script Call.

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
109
Reaction score
10
First Language
Spanish
Primarily Uses
RMMV
Is there any script call that could force pressing the Z\Enter button?
I'm making a game on MV3D and need to trigger events in the first person by clicking on them. No plugins have worked for me.

UPD.
There might be some solution inside Mouse System Plugin, but I can't figure it out.

1603054668602.png
 
Last edited:

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,605
Reaction score
958
First Language
Portuguese - Br
Primarily Uses
RMMV
Hi!
Why don't you execute the event with a switch or anything else? After all, is the same thing, you need to activate an event, to execute their commands. You can do this in many ways, not need to have the player to activate it with the action button.
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
109
Reaction score
10
First Language
Spanish
Primarily Uses
RMMV
Hi!
Why don't you execute the event with a switch or anything else? After all, is the same thing, you need to activate an event, to execute their commands. You can do this in many ways, not need to have the player to activate it with the action button.
"I'm making a game on MV3D and need to trigger events in the first person by clicking on them."
I can do it only this way. By clicking on it like in a normal 3D FPS game.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,605
Reaction score
958
First Language
Portuguese - Br
Primarily Uses
RMMV
Hi!
I get it... But logically, you can make the event trigger without the player really triggers it, but simulate it instead.
But I think you can try in the script call(not sure, I never give it a try):
Input._currentState['ok'] = true
That will let the game know that this button is currently pressed.

Or you can check if the player clicks on the event with:
Touch.InputX === posX(screen of the event) and the same for Y.
If that's true, then you call the script $gameMap.event(Id).start()

I'm sorry, I'm not on the computer, otherwise, I will check it out. But maybe that script calls are not right. Let's hope someone sees this and fixes it.

Hope it helps!
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
109
Reaction score
10
First Language
Spanish
Primarily Uses
RMMV
I get it... But logically, you can make the event trigger without the player really triggers it, but simulate it instead.
How come? I can't program it for every single interactable event. I want it to be automatic.
Input._currentState['ok'] = true
Unfortunately, this didn't work for me.
Touch.InputX === posX(screen of the event) and the same for Y.
If that's true, then you call the script $gameMap.event(Id).start()

Again, I'm working in 3D, so I'm not sure if mouse coordinates will work properly, and even if they do, I'll have to make a hole script that would compare players position to the event's one and automatically recognize which event player's trying to interact with.
But I'm too bad at coding to figure it out all on my own.
Again, forcing Z\Enter button input is the easiest way to go.

Also, check this threat "Check if player can trigger an event?"
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Those kittens I met the other day all found loving homes. I might miss playing with them, but I'm glad they found owners to care for them. In the meantime, my Orlando trip is likely to happen on the 29th. While I wait for that, I'll be working on Angel of Justice...
I really need to work on my time management skills... I have one plot-based roleplay here, another plot-based roleplay there, I have the fangame to work on, I'm trying to get into Runescape again....

Forum statistics

Threads
104,231
Messages
1,004,872
Members
135,752
Latest member
Geralt708
Top