MANTIA 55 Posted August 1, 2016 Hey guys! I'm putting together a TvT objective based multiplayer mission but am running into a problem. There are ZERO respawns so once a player dies they go to the Vanilla Spectator Cam. However, I would like to limit the cam to just 1st person perspective of their teammates that are still alive. I don't want to give them access to view their enemy's perspective and thus open the door to cheating (guys poking and messaging enemy positions and such) I've searched around quite a bit and have not found out a ton about how to do this. https://community.bistudio.com/wiki/EG_Spectator_Mode <---this provides some great information However, I'm not sure how to use it to achieve my desired outcome. I see I can create a playerkilled.sqf but only see the option to open up the Spectator Cam to sides that any dead player can view. Is there a way to create a playekilled.sqf linked directly to the faction the player is a part of? Then I could easily restrict the Cam to that same side. Any help, recommendations, ect would be greatly appreciated. Share this post Link to post Share on other sites
HallyG 239 Posted August 1, 2016 Hey guys! I'm putting together a TvT objective based multiplayer mission but am running into a problem. There are ZERO respawns so once a player dies they go to the Vanilla Spectator Cam. However, I would like to limit the cam to just 1st person perspective of their teammates that are still alive. I don't want to give them access to view their enemy's perspective and thus open the door to cheating (guys poking and messaging enemy positions and such) I've searched around quite a bit and have not found out a ton about how to do this. https://community.bistudio.com/wiki/EG_Spectator_Mode <---this provides some great information However, I'm not sure how to use it to achieve my desired outcome. I see I can create a playerkilled.sqf but only see the option to open up the Spectator Cam to sides that any dead player can view. Is there a way to create a playekilled.sqf linked directly to the faction the player is a part of? Then I could easily restrict the Cam to that same side. Any help, recommendations, ect would be greatly appreciated. Apparently you can call the spectator script with whitelisted sides, so maybe you could change the whitelist according to the side the player was before death (switch do statement in playerKilled.sqf). Also there is an option to disable 3rd person perspective. // Param1: A string describing the action to be taken by the spectator function // Param2: The custom arguments that are sent to the spectator function ["Initialize", [player, [], true, true, true, true, true, true, true, true]] call BIS_fnc_EGSpectator; // The custom array for Initialize function can contain: _this select 0 : The target player object _this select 1 : Whitelisted sides, empty means all _this select 2 : Whether AI can be viewed by the spectator _this select 3 : Whether Free camera mode is available _this select 4 : Whether 3th Person Perspective camera mode is available _this select 5 : Whether to show Focus Info stats widget _this select 6 : Whether or not to show camera buttons widget _this select 7 : Whether to show controls helper widget _this select 8 : Whether to show header widget _this select 9 : Whether to show entities / locations lists If the spectator mode is active and you would like to terminate it, run the following function: ["Terminate"] call BIS_fnc_EGSpectator; so maybe, if the player was east before (UNTESTED): ["Initialize", [player, [EAST], true, false, false, true, true, true, true, true]] call BIS_fnc_EGSpectator; 1 Share this post Link to post Share on other sites
MANTIA 55 Posted August 2, 2016 Apparently you can call the spectator script with whitelisted sides, so maybe you could change the whitelist according to the side the player was before death (switch do statement in playerKilled.sqf). Also there is an option to disable 3rd person perspective. // Param1: A string describing the action to be taken by the spectator function // Param2: The custom arguments that are sent to the spectator function ["Initialize", [player, [], true, true, true, true, true, true, true, true]] call BIS_fnc_EGSpectator; // The custom array for Initialize function can contain: _this select 0 : The target player object _this select 1 : Whitelisted sides, empty means all _this select 2 : Whether AI can be viewed by the spectator _this select 3 : Whether Free camera mode is available _this select 4 : Whether 3th Person Perspective camera mode is available _this select 5 : Whether to show Focus Info stats widget _this select 6 : Whether or not to show camera buttons widget _this select 7 : Whether to show controls helper widget _this select 8 : Whether to show header widget _this select 9 : Whether to show entities / locations lists If the spectator mode is active and you would like to terminate it, run the following function: ["Terminate"] call BIS_fnc_EGSpectator; so maybe, if the player was east before (UNTESTED): ["Initialize", [player, [EAST], true, false, false, true, true, true, true, true]] call BIS_fnc_EGSpectator; Ya, I'm just not sure how to set that up to call based on the faction the player is. Share this post Link to post Share on other sites
MANTIA 55 Posted August 3, 2016 Alright after reading some material this is what I came up with in a playerKill.sqf switch (_condition) do { case west: {["Initialize", [player, [WEST], true, false, false, true, true, true, true, true]] call BIS_fnc_EGSpectator;}; case GUER: {["Initialize", [player, [GUER], true, false, false, true, true, true, true, true]] call BIS_fnc_EGSpectator;}; case EAST: {["Initialize", [player, [EAST], true, false, false, true, true, true, true, true]] call BIS_fnc_EGSpectator;}; }; Does this look like I'm headed in the right direction? Also is a playerKill.sqf automatically called if the file is present? Similar to a initPlayerlocal or do I have to do something to call the playerKill when a player is killed? Thanks Share this post Link to post Share on other sites
MANTIA 55 Posted August 4, 2016 That did not appear to work. Any ideas on this in a playerkill.sqf? if(side player == EAST) then { if(isServer) then {["Initialize", [player, [EAST], true, false, false, true, true, true, true, true]] call BIS_fnc_EGSpectator; }; } foreach playableunits; }; }; if(side player == WEST) then { if(isServer) then {["Initialize", [player, [WEST], true, false, false, true, true, true, true, true]] call BIS_fnc_EGSpectator; }; } foreach playableunits; }; }; Share this post Link to post Share on other sites