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

Status
Not open for further replies.

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
184
Reaction score
13
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,709
Reaction score
1,127
First Language
Portuguese - Br
Primarily Uses
RMMZ
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
184
Reaction score
13
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,709
Reaction score
1,127
First Language
Portuguese - Br
Primarily Uses
RMMZ
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
184
Reaction score
13
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:

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,467
Members
137,821
Latest member
Capterson
Top