IGG Jaypee 10 Posted October 7, 2016 Hi Guys I,m running the eg spectator when the player is alive through addaction on a laptop model. spectator.sqf: _spectator_settings = [ player, // The target player object [], // Whitelisted sides, empty means all false, // Whether AI can be viewed by the spectator false, // Whether Free camera mode is available true, // Whether 3th Person Perspective camera mode is available true, // Whether to show Focus Info stats widget false, // Whether or not to show camera buttons widget true, // Whether to show controls helper widget true, // Whether to show header widget true // Whether to show entities / locations lists ]; ["Initialize", _spectator_settings] call BIS_fnc_EGSpectator; I want to be able to close it again through keyboard event. Hitting escape now will open the main menu. Using displayAddEventHandler seems the way to go but how do I find the spectator display? If there is another easy way to close the spectator system i'd also gladly hear it. Share this post Link to post Share on other sites
Bnae 1431 Posted October 7, 2016 In a similiar situation i used a missionNamespace variable to exit while loop. Not the best way but it works. missionNamespace setVariable ["ESCape", 0,false]; while (true) do { _escape = missionNamespace getVariable "ESCape"; sleep 1; if (_escape == 1) exitWith {["Terminate"] call BIS_fnc_EGSpectator}; }; And in the ESC keybind i had missionNamespace setVariable ["ESCape", 1,false]; Share this post Link to post Share on other sites
neokika 62 Posted October 7, 2016 I want to be able to close it again through keyboard event. Hitting escape now will open the main menu. Using displayAddEventHandler seems the way to go but how do I find the spectator display? If there is another easy way to close the spectator system i'd also gladly hear it. Hi there. Like @Banae mentioned, you can use BIS_fnc_EGSpectator to shut it down, in a similar way how you initialize it. ["Terminate"] call BIS_fnc_EGSpectator; Share this post Link to post Share on other sites
IGG Jaypee 10 Posted October 7, 2016 Thanks for the answers guys. Though: I knew that i need to call: ["Terminate"] call BIS_fnc_EGSpectator; My question is how do I get user input to fire aforementioned piece of script? Share this post Link to post Share on other sites
IGG Jaypee 10 Posted October 27, 2016 In a similiar situation i used a missionNamespace variable to exit while loop. Not the best way but it works. missionNamespace setVariable ["ESCape", 0,false]; while (true) do { _escape = missionNamespace getVariable "ESCape"; sleep 1; if (_escape == 1) exitWith {["Terminate"] call BIS_fnc_EGSpectator}; }; And in the ESC keybind i had missionNamespace setVariable ["ESCape", 1,false]; that keybind you are speaking of is that in options-> controls where you set it? Also: _KeyDown = (findDisplay 46) displayAddEventHandler ["KeyUp", "hint str _this"]; doesn't show any keys when the spectator camera is running. Anyone know what is up with that? Share this post Link to post Share on other sites