MV making an earthbound style "talk to" command :p

im using yanfly's main manu manager plugin to create the option itself - so now i have a menu option that calls a common event when it's pressed.

what i want it to do is simulate an action button input so that when the menu closes after the option is selected, if there's an event in front of the player that can be "talked to" then the simulated input will trigger the event

i've tried using RS_Keyboard_Event but that didn't work, it just didn't do anything at all

then i tried using the script "Input._currentState["ok"] = true" but that resulted in nothing happening again

am i missing something? thanks for reading, i'm happy to provide any other details if necessary!

also... i know this option is kinda pointless, but the idea is just to recreate earthbound as accurately as i can 😛 even if this option is silly
Edit: Sorry, I may have misunderstood this question. If it's in battle, do below. If it's on the map, it should be tied to the event's action trigger.

It won't do anything because you cant normally run common events in battle. You have to use a plugin like the NewRPGProject on that lets you run parallel common events in the battle scene, and put an if condition in there to specify what part of battle a button input should do something.

Site is in Japanese but the plugin file has English instructions
no worries! yea i mean on the map, what do u mean tie it to the events action trigger?
Do you want the event on the map to also respond to the player actually pressing OK to trigger it? Or only through this common event?

I'd just make the common event turn on a switch.

Your map events have a second page with the condition of that switch, Autorun. It checks whether the player is adjacent to it on the map - if yes, do whatever stuff. At the bottom, turn the switch back off.
interesting... is there an easy way to check if the player is adjacent or do i need to check if the player's x and y match the adjacent tiles to the event?
It's just setting a couple of variables and doing a couple of conditional branches...it probably would've taken me as long to enter those event commands as it took me to Google "rpg maker script call adjacent" 😛

But you could put in the Script field of a Conditional Branch:
Code:
Math.abs($gamePlayer.x - $gameMap.event(this.eventId()).x) + Math.abs($gamePlayer.y - $gameMap.event(this._eventId).y) == 1
hmmm... putting that code into a conditional branch didn't work... as in it just didn't do anything, i tried looking up that search query and got another string of code but that one also resulted in nothing happening
1697822768270.png
What you have in your script box there does not match what I typed for you. Just putting stuff in parentheses with .abs at the end is not correct JavaScript syntax.

If you're saying that what I provided also doesn't work when you correctly copy and paste it, try with the console open (press F8, Console tab) and see if there are any errors.

Otherwise, please post your full event page not cropped to see if it's a mistake in your event.
oh yea, thats the other code i tried, sorry. on that thread it said it worked for the person that posted, so i tried it but forgot to change it back for the screenshot. same results if i use the one you sent though
1697822978215.png
Otherwise, please post your full event page not cropped to see if it's a mistake in your event.

The code I gave works in my test project.

Or, for how long it's been since you first asked at 12:19, you could've just set up the event commands to copy and paste wherever you need 😉
yea i suppose ill just event it if this doesnt work : p i appreciate ur help regardless!!!! ive attached what should be all relevant screenshots
1697823339965.png


1697823400892.png

1697823422391.png
1 - You need to put "talking off" outside of the Conditional Branch. Otherwise if you turn on the switch and you're not next to the event, it's going to lock up your game by repeating the Autorun forever.

2 - Put some basic logical troubleshooting stuff in. Put a Show Text in your common event to make sure it's being run. Put a Show Text at the top of your map event to make sure that's being run as expected.

Did you confirm there are no errors showing in the console?
took the talking off switch outside of the branch, and also can confirm that the common event is running. the console is empty too

1697824874666.png
I don't know what to tell you, it works perfectly for me in my test project.

Are you saving your project and starting a new game after making changes in your database? Not trying to load a save?

Original thread: https://forums.rpgmakerweb.com/threads/making-an-earthbound-style-talk-to-command-p.162195/