Jump to content
Sign in to follow this  
El' Rabito

Base Camera sorting

Recommended Posts

Gets rid of the number changing base cameras and sorts them by distance so they should always have the same number.

Make a CfgCustomcode override for ExileClient_gui_baseCamera_event_onLoad.sqf with the code below.

/**
 * ExileClient_gui_baseCamera_event_onLoad
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_display", "_camerasCombo", "_range", "_cameras", "_index"];
_display = uiNamespace getVariable ["RscExileCameraView",displayNull];
_camerasCombo = _display displayCtrl 4005;
_range = ExileCameraSystemBase getVariable ["ExileTerritorySize",0];
_cameras = nearestObjects [ExileCameraSystemBase, ["Exile_Construction_BaseCamera_Static"], _range];

lbClear _camerasCombo;
if(_cameras isEqualTo [])then
{
	_index = _camerasCombo lbAdd "No cameras in your base";
	_camerasCombo lbSetData [_index,"0"];
	_camerasCombo lbSetPictureRight [_index,"\exile_assets\texture\ui\cameraView\camera.paa"];
}
else
{
	_index = _camerasCombo lbAdd "Select a Camera";
	_camerasCombo lbSetData [_index,"0"];
	_camerasCombo lbSetPictureRight [_index,"\exile_assets\texture\ui\cameraView\camera.paa"];
	{
		_index = _camerasCombo lbAdd ("Camera " + (str _forEachIndex));
		_camerasCombo lbSetData [_index,netId _x];
		_camerasCombo lbSetPicture [_index,"\exile_assets\texture\ui\cameraView\camera.paa"];
		if(_x getVariable ["ExileCameraInUse",false])then
		{
			_camerasCombo lbSetColor [_index,[221/255, 38/255, 38/255, 1]];
			_camerasCombo lbSetPictureRightColor [_index,[221/255, 38/255, 38/255, 1]];
			_camerasCombo lbSetTextRight [_index,"IN USE!"];
			_camerasCombo lbSetColorRight [_index,[221/255, 38/255, 38/255, 1]];
		}
		else
		{
			_camerasCombo lbSetColor [_index,[160/255, 223/255, 59/255, 1]];
		};
	}
	forEach _cameras;
};
ExileClientPlayerIsInSecurityCamera = true;
ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0.39, 0.32, 0.25, 1], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]]; 
ExileClientPostProcessingColorCorrections ppEffectCommit 0;
ExileClientPostProcessingColorCorrections ppEffectEnable true;
ExileClientPostProcessingSecurityCameraFilmGrain ppEffectCommit 0;
ExileClientPostProcessingSecurityCameraFilmGrain ppEffectEnable true;
false call ExileClient_gui_hud_toggle;
_camerasCombo
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

@El' Rabito - I want to say publicly, that I had always appreciated all the work you have done with Exile in the past years.  This script is but one example of the stuff you do!

 

Thanks!

😀

 

Share this post


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

@El' Rabito - I want to say publicly, that I had always appreciated all the work you have done with Exile in the past years.  This script is but one example of the stuff you do!

 

Thanks!

😀

 


Well it's nothing i just changed 😅
 

_cameras = ExileCameraSystemBase nearObjects ["Exile_Construction_BaseCamera_Static",_range];

to
 

_cameras = nearestObjects [ExileCameraSystemBase, ["Exile_Construction_BaseCamera_Static"], _range];

https://community.bistudio.com/wiki/nearObjects
https://community.bistudio.com/wiki/nearestObjects

  • Thanks 1

Share this post


Link to post
Share on other sites

@El' Rabito - Well, what is simple to some fold is mighty hard to others!  Interesting change  though.  This would be/is over my head though!  I am lower-medium scripter in ARMA, and I would not gotten this one I think.

 

I also tried it out last night...works like a champ!

 

Once again, thank you for this and all the OTHER scripts (here and on the original Exile site) too!

 

😀

Share this post


Link to post
Share on other sites
Sign in to follow this  

×