Jump to content

Recommended Posts

Hello,

I'd like to display additional information when the watch is opened. Is there any way to capture the event that a user has opened their watch from a script?

Share this post


Link to post
Share on other sites

Thank you but this isn't an event, are you suggesting that I spawn a process that checks for this every 0.02 seconds or so?

Share this post


Link to post
Share on other sites
On 4/24/2017 at 3:34 AM, _SCAR said:

Found it. For anyone else wondering:

https://community.bistudio.com/wiki/inputAction

You'd still need to check every so often with inputAction like a waitUntil statement.

So I see no need for inputAction and I recommend GOM's post, since the keys alone don't always work specifically for their function at all times.

 

Share this post


Link to post
Share on other sites
2 hours ago, Midnighters said:

So I see no need for inputAction

 

Maybe he wants to use it inside UI Event Handler?

Share this post


Link to post
Share on other sites
6 hours ago, killzone_kid said:

 

Maybe he wants to use it inside UI Event Handler?

I dunno, never mentioned such so I'm just going with whatever.

input action method is probably the worst way to go in this case though, that is for sure.

Share this post


Link to post
Share on other sites
11 hours ago, killzone_kid said:

 

Maybe he wants to use it inside UI Event Handler?

Which one? It's not an action "in menu" like "disassemble".

"Watch" or "WatchToggle" aren't detected by the ingameUISetEH "action", if I'm right. Neither "rearm"...

I don't know how to say that in English but input actions (UI EH "action" doesn't fire) seem to me different from Arma 3 actions (UI EH "action" fires).

 

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

Which one? It's not an action "in menu" like "disassemble".

"Watch" or "WatchToggle" aren't detected by the ingameUISetEH "action", if I'm right. Neither "rearm"...

I don't know how to say that in English but input actions (UI EH "action" doesn't fire) seem to me different from Arma 3 actions (UI EH "action" fires).

 

 

https://community.bistudio.com/wiki/User_Interface_Event_Handlers - UI Event Handlers

Edited by killzone_kid

Share this post


Link to post
Share on other sites

Aaaand to complete the circle:

_id = (findDisplay 46) displayAddEventHandler ["KeyDown", {
	params ["_display","_key"];
	if (_key isEqualTo 24) then {systemchat format ["Watch opened, it is %1.",[daytime,"HH:MM:SS"] call BIS_fnc_timeToString]
	} else {systemchat "This is not your watch."};
}];

Cheers

Share this post


Link to post
Share on other sites

Thanks Grumpy. I just forgot displayAddEventHandler was an UI EH. I focused on UI in IngameSetUIEH... I lost my Latin in all these action/inputaction, UI EH, display's and so on.

Even if I already scripted some lines with that !

Share this post


Link to post
Share on other sites

I am using the example on the page I've posted and it works beautifully. Of course I'm running it inside a spawn.

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

×