Jump to content
Sign in to follow this  
Doolittle

Assign key to radio command?

Recommended Posts

Is it possible to assign a key to using a radio command.. like if radio option 1 was Call in Chopper and you hit X, that radio trigger would run? I know you can do this with actions.

P.S. Is it possible to get a LOCATION back if you give a string name, like _location = getLocation "MyLocName" ??

Doolittle

Share this post


Link to post
Share on other sites

I think radio triggers can only be activated with the actual radio call (0-0-1 for Alpha and so on...). I tried to activate a radio trigger with a boolean as a condition (and then making that boolean true) with negative results.

But, what you want can still be accomplished. Since all the radio call is going to do most likely is execute a script to summon the helo, we can use displaySetEventHandler to execute the script instead:

init.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// Delays creation of the event handler until everything else is initialized.

sleep 1;

// Creates the event handler that detects "Key Up" events and executes the script as appropriate.

(findDisplay 46) displaySetEventHandler ["KeyUp", "_nil = _this execVM ""callHelo.sqf"""];

callHelo.sqf (Just a placeholder, instead of a hint it would actually contain code to summon helo)

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_key = _this select 1; // Gets key from event handler.

_activationKey = 45; // 45 = "X" key.

if (_key == _activationKey) then {hint "Helo en route"}; // Diplays hint if key pressed is "X".

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  

×