Skip to content

Commit

Permalink
several fixes and improvements:
Browse files Browse the repository at this point in the history
-logging didn't work
-rearranged instructions and informations
-deleting LOS display would remove it partially for other people
-added more information about the addon usage
  • Loading branch information
BlackHawkPL committed Oct 19, 2017
1 parent 110dca0 commit 6ea92a4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 23 deletions.
2 changes: 1 addition & 1 deletion functions/fnc_initialize.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ player createDiarySubject [QGVAR(menu), STR_DIARY_SUBJECT];
private _info = "";

_info = STR_DIARY_USER_INSTR;
player createDiaryRecord [QGVAR(menu), ["Instructions", _info]];
player createDiaryRecord [QGVAR(menu), ["Informations", _info]];

_info = format [STR_DIARY_PROFILE, QFUNC(selectProfilePos), QFUNC(closeChart)];
player createDiaryRecord [QGVAR(menu), ["Terrain Profile Tool", _info]];
Expand Down
2 changes: 1 addition & 1 deletion functions/fnc_mainFunc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private _recFunc = {

//hint format [STR_FINISHED_MESSAGE, GVAR(cellCount), ROUND_2D(GVAR(cellSize)), ROUND_2D(diag_tickTime - GVAR(timeStart))];
if (isMultiplayer && !isServer && GVAR(telemetryEnabled)) then {
[(count GVAR(markers)) - 1, GVAR(targetSize), GVAR(cellSize), (diag_tickTime - GVAR(timeStart)), name player] call GVAR(telemetry);
[(count GVAR(markers)) - 1, GVAR(targetSize), GVAR(cellSize), (diag_tickTime - GVAR(timeStart)), name player] call FUNC(telemetry);
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion functions/fnc_removeMarkers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (!isNull (findDisplay GVAR(IDD)) && !isNil QGVAR(drawEH_ID)) then {

if ((count GVAR(markers)) != 0) then {
{
deleteMarker _x;
deleteMarkerLocal _x;
} forEach GVAR(markers);
};
GVAR(markers) resize 0;
3 changes: 1 addition & 2 deletions init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

GVAR(telemetryEnabled) = true;
//GVAR(observerHeight) = 1.8;
GVAR(targetMinHeight) = 0.3;
GVAR(targetMaxHeight) = 1.8;
GVAR(targetMinHeight) = 1.0;
//GVAR(cellCount) = 10000;
GVAR(disableAfterStart) = true;
GVAR(chartAccuracy) = 5;
Expand Down
46 changes: 28 additions & 18 deletions resources.hpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
#define STR_TELEMETRY_LOG "[checkLOS] %4 generated %2m area, %1 cells, size %3m, in %4s."
#define STR_TELEMETRY_LOG "[checkLOS] %5 generated %2m area, %1 cells, size %3m, in %4s."

#define STR_FINISHED_MESSAGE "Finished\ndrawn cells: %1\ncell size: %2m\ntime taken: %3s"

#define STR_DIARY_LOS "<font size='18'><execute expression='call %1'>Check LOS</execute><br/>\
<br/>\
<execute expression='call %2'>Remove LOS display</execute></font>"
<execute expression='call %2'>Clear LOS display</execute></font><br/>\
<br/>\
How to use it:<br/>\
1. Click orange 'Check LOS' text<br/>\
2. On map, click position where Line of Sight will be calculated from<br/>\
3. Click position where will be middle of area where LOS will be calculated<br/>\
4. Move your mouse to set size of the area, click to confirm<br/>\
5. Wait for script to finish. Depending on cell count you selected it might take from 3 seconds up to few minutes!<br/>\
<br/>\
You can abort generation at any time by pressing A on your keyboard."

#define STR_DIARY_PROFILE "<font size='18'><execute expression='call %1'>Draw Terrain Profile</execute><br/>\
<br/>\
<execute expression='call %2'>Remove Terrain Profile chart</execute></font>"
<execute expression='call %2'>Remove Terrain Profile chart</execute></font><br/>\
<br/>\
How to use it:<br/>\
1. Click orange 'Draw Terrain Profile' text<br/>\
2. On map, click position where terrain profile will start<br/>\
3. Click end position for profile<br/>\
4. Chart can be closed by pressing x in it's right upper corner."

#define STR_DISABLED "Option is currently unavailable. Check Information tab for potential causes."

Expand All @@ -25,26 +40,21 @@
*Areas colored <font color='#FF4444'>red</font> are areas <font color='#FF4444'>obscured</font> by terrain<br/>\
*Areas colored <font color='#4444FF'>blue</font> are <font color='#4444FF'>not obscured</font> by terrain, but might be obscured by objects or vegetation<br/>\
<br/>\
<font size='18'>LOS checker</font><br/>\
1. In 'Check LOS Tool' section click orange 'Check LOS' link<br/>\
2. On map, click position where Line of Sight will be calculated from<br/>\
3. Click position where will be middle of area where LOS will be calculated<br/>\
4. Move your mouse to set size of the area, click to confirm<br/>\
5. Wait for script to finish. Depending on cell count you selected it might take from 3 seconds up to few minutes!<br/>\
<br/><font size='16'>I don't like it and I don't want to use it and my immersion is completely ruined.</font>\
<br/>- You can disable this addon in CBA addon settings.\
<br/>\
<font size='18'>Terrain profile</font><br/>\
1. In 'Terrain Profile Tool' section click orange 'Draw Terrain Profile' link<br/>\
2. On map, click position where terrain profile will start<br/>\
3. Click end position for profile<br/>\
4. Chart can be closed by pressing x in it's right upper corner.<br/>\
<br/><font size='16'>Can I make it so other people see it?</font>\
<br/>No. This will not be added due to complexity.\
<br/>\
<br/>\
<font size='18'>I still don't understand how to use it</font><br/>\
<br/><font size='18'>I still don't understand how to use it</font><br/>\
<execute expression='openYoutubeVideo ""watch?v=KJYGfS8R8YI""'>LOS Tool video guide</execute><br/>\
<execute expression='openYoutubeVideo ""watch?v=Tf4wExGAk-M""'>Terrain Profile tool video guide</execute><br/>\
<execute expression='openYoutubeVideo ""watch?v=sXzgAsNXafE""'>Settings guide</execute><br/>\
<execute expression='openYoutubeVideo ""watch?v=sXzgAsNXafE""'>CBA settings guide</execute><br/>\
<br/>\
<font size='18'>For mission makers</font><br/>\
If you want to disable it in your mission, go to Eden editor and open CBA settings for your mission. Set the addon to disabled and select option to overwrite client settings.<br/>\
If you have a mission with in-game briefing and you want this tool available while in-game you need to do 2 things:<br/>\
- add `BH_checkLOS_disableAfterStart=false;` to your init.sqf<br/>\
- to disable it run `call BH_checkLOS_fnc_disable`"
- to disable it run `call BH_checkLOS_fnc_disable`<br/>\
<br/>\
Author: BlackHawk"

0 comments on commit 6ea92a4

Please sign in to comment.