Jump to content
Sign in to follow this  
zonekiller

Can i run a script by using a key on the kb

Recommended Posts

i would like to run a script by pressing the home key on the keyboard

can this be done ?

i can not find anything in the wiki.

thanks in advance

Michael

Share this post


Link to post
Share on other sites
Guest

The SU34 Effects script used a keypress to activate the afterburner if I remember correctly.

So, maybe by having a look at it you can figure out how to use a certain key for your script.

PS:

That is not the latest version of that script but I wasn't able to find that anywhere and it seems the creator left the community.

Share this post


Link to post
Share on other sites

The display event handler is probably the thing you want, but just for the sake of completeness...

You can also do it with an action if you want to tie it to a control function rather than a specific key (like "moveForward" as opposed to "w").

addAction ("Alternative Syntax")

key mapping

For example, you might make an afterburner that uses vehicle turbo to activate:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_thrust = 50; // gets passed to afterburner.sqf as _this select 3

_plane addaction ["Afterburner", "afterburner.sqf", _thrust, 0, false, false, "heliFastForward"];

However, it clutters up the action menu and anyone can see/activate it if they're in range, so it's not appropriate for everything.

Share this post


Link to post
Share on other sites

Thanks guys

The missions is complete now and everything working the way i want

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  

×