Jump to content
Sign in to follow this  
benargee

Control player input via script?

Recommended Posts

Hey, pretty straight forward question. Is it possible to make a script directly control player input? Say I want to turn the the wheel on my truck to a certain degree or so, that I am driving. Another example is I want to beable to control a helicopter via script.

Please do not send me to https://community.bistudio.com/wiki/BIS_fnc_UnitPlay. I already know about it and its not the effect I'm after.

Im really looking for the opposite of this command: https://community.bistudio.com/wiki/actionKeys

actionKeys is the "get" command. now I'm looking for the "set" version of this command.

Edited by Benargee
correct link

Share this post


Link to post
Share on other sites

No, sorry. I'm looking for analog input of what would normally be done with a controller/keyboard/mouse.

Share this post


Link to post
Share on other sites

Just to clarify for all looking at this, I'm getting that you pretty much want to be able to "slave" a vehicle with the players inputs being it's controls, without the player actually being in the vehicle. Similar to a drone.

Share this post


Link to post
Share on other sites

Nope, you can't do that directly.

Your best bet is to simulate the steering-effects with commands that rotate or change the velocity of the vehicle.

It's also possible to let an AI take control of a player-vehicle and force him to watch. But I think that's not what you're looking for.

Anyway, as always: What exactly are you trying to achieve? We might be able to propose alternative solutions if we know what this is about.

Share this post


Link to post
Share on other sites

A keystroke recorder/player would be far better than Unitplay as all actions could be played out, engine on, throttle, lights ect.

Not only that you could easily play it from different positions on the map as it wouldn't be tied to the map co-ords.

Share this post


Link to post
Share on other sites

Was your question answered/did you find a solution? If its SP I still have the addaction method which you could use (look at a laptop and then take control) of course you may not want that so yea...

Share this post


Link to post
Share on other sites

Has anyone found anything new on this? I've compiled my own findings on another post about the same issue, however as this is my first post I can't link, you'll have to search the forums for Enable manipulating "inputAction".

Share this post


Link to post
Share on other sites

this addEventHandler ["keydown" other stuff]

setplayer helicopterpilot

helipilot addeventhandler keydown, setplayer original unit.

Probably not it, but thats all I got. if anyone wants to use this to get farther go for it.

Share this post


Link to post
Share on other sites
this addEventHandler ["keydown" other stuff]

setplayer helicopterpilot

helipilot addeventhandler keydown, setplayer original unit.

Probably not it, but thats all I got. if anyone wants to use this to get farther go for it.

Did this allow you to control vehicle input via script? I'll have to give it a try, thanks for the info.

I have made a request for this feature on the ARMA 3 Community Issue Tracker, please +1 if you agree!

Share this post


Link to post
Share on other sites

You need to use displayAddEventHandler to process keystrokes.

(findDisplay 46) displayAddEventHandler ["KeyDown", {if((_this select 1) == 17) exitWith {hintSilent "Key ""W"" pressed.";};}];

If you make the EH return "true", it'll override the engine's default keystroke handling.

  • Like 1

Share this post


Link to post
Share on other sites
You need to use displayAddEventHandler to process keystrokes.

(findDisplay 46) displayAddEventHandler ["KeyDown", {if((_this select 1) == 17) exitWith {hintSilent "Key ""W"" pressed.";};}];

If you make the EH return "true"' date=' it'll override the engine's default keystroke handling.[/quote']

Thank you. sorry to be so needy (I've barely worked with EH's) but how might one go about performing that key with commands i.e. making the player/ai perform that action?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×