I have a section where the player is surfing, and will automatically move forward unless you hold in a direction to change directions.
I'm using a parallel process for this and it's working great except for one thing; I cannot for the life of me figure out how to let the player actually stop surfing at a vehicle on/off point because they need to be able to press Enter to get out of the vehicle.
I figure all I really need to do is use a conditional branch with the "Okay" key being pressed down, and a Javascript command to tell the game to use the "Okay" key input, but for the life of me, I cannot find anywhere online or in the help file to do that.
Could someone help me out here? Thanks!
It's Input.isTriggered('ok') afaik
You will need a plugin to send virtual input. Why don’t you just put events where the player lands that stops the surfing? If the problem is because your using a vehicle as the surf board you can probably find a script to exit the vehicle. You could also just not use a vehicle and just change the players graphic and speed.
Input.isTriggered('ok') just checks if the ok button is actually pressed. There should be a simple method to achieve what you need without virtual input though.
Edit: Sorry didn't see your other post. If you post a screenshot of your events, I can probably help you out more.
What you ask for is actively discouraged and blocked by most browsers.
Just think about it: if a HTML-based program can simulate a keypress, then an infected website would also be able to simulate typing in your administrator passwort when windows tries to block access to prevent infection.
What should usually be done is looking for the function that you want to trigger with the input, and call that directly without going through the actual input buffer.
But to help you with that, we would need to get more details like screenshots of your event pages like asked by the poster above.
There's a Get on/off Vehicle event command, have you tried using that instead?
It's easy to simulate an input: just change the appropriate variable, e.g. Input._currentState["ok"] = true. That said, unless I've missed something, it would be pointless to simulate an OK input when the player presses OK: the game has already recognised that input! By default player move controls are suspended while the player is undergoing a move route, so I think you'd want something to change how the game reacts to the input.
Maybe share your event setup?
I strongly suggest you rework that parallel process by not using any else-branch - best perhaps to disable the else completely by unchecking the box for it in the conditional branch window.
this will make the event much better readable and slightly spped it up without any negative cause, because if one button is pressed the others are handled independently.
It also has a chance of making the OK work correctly - I'm not sure of that however, just test it out.