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
148
Reaction score
12
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,685
Reaction score
1,097
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
148
Reaction score
12
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,685
Reaction score
1,097
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
148
Reaction score
12
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,816
Reaction score
5,212
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 Posts

Latest Profile Posts

Ami
What do you think about the Wood Bridge inside of Volcano?
Yet another gaming question, i'm currently playing Last of Us 2 and want to get another game to play next but can't decide between Ghost of Tsushima, Miles Morales & Jedi Fallen Order. After the latest mandalorian i AM on a star wars kick, but i also LOVED the last spiderman game that prequels Miles Morales. Ghost of Tsushima is the bottom of my list but i heard it was AWESOME. Just want a good story & fun gameplay.
I checked out Genshin Impact gameplay out of curiosity. I can't believe it's available as a mobile game too. Smooth animation, great music, and stellar sound effects (the ambient sounds are pretty detailed).

I'm flabbergasted to see games have becoming more and more advanced. Maybe also because I'm oblivious to current trend for a long time, it almost feel like I'm being sent into distant future. xD
xDRAGOONx wrote on WaywardMartian's profile.
Your artwork is amazing!!!
:ewat:
Stream will be live shortly with a session of the Interactive Text Adventure! Feel free to drop by!

Forum statistics

Threads
105,669
Messages
1,015,412
Members
137,344
Latest member
Zindasan0078
Top