Jump to content
Sign in to follow this  
Rydygier

How to hide via script all HUD elements?

Recommended Posts

Thought, this should be a popular question answered many times, but strangely found nothing but sadly useless here advices about difficulty settings or creating custom camera...

I need to show in the cutscene some feed from AI unit eyes via switchCamera. Using showHUD I can disable 3D tags, but I need to get rid also of all GUI elements, in this particular case the only visible element is that showing weapon, fire mode, optics zeroing, ammo and stance in the right-upper corner.

I would guess, it's about knowing proper IDC/IDD and using it with proper script commands enabling/disabling displays/controls, If so, I would like to know these numbers, as seraching through config viewer gave me nothing useful...

Alternatively tried to attach custom camera in front of the unit, same direction, but sadly that cam apparently doesn't change direction along with the unit, also doesn't shake like view from the eyes would. I do not want to sink into extra scripting just to workaround these problems...

EDIT: current workaround for interested, still waiting for the answer, as it would be better way.

_cam attachTo [unit1,[0,0.25,0.5],"head"];
_cam setDir (getDir Unit1);

_handle = [_cam] spawn
{
_cam = _this select 0;

while {true} do
	{
	_tPos = Unit1 modelToWorld [0,10,1];
	_cam camSetTarget _tPos;
	_cam camCommit 0;
	waitUntil {true};
	}
};

[i](sleep/waituntil {something}/whatever)[/i]

terminate _handle;
[i](another shot/scene/end)[/i]

Edited by Rydygier

Share this post


Link to post
Share on other sites

If you knew the name of the layer(s) the main hud was created on, this would probably work to terminate it.

("RscSomeBILayerName" call bis_fnc_rscLayer) cutText ["","plain"];

There may be a bit of info in the ui_f.pbo. Maybe you could find the layer's name? Or how it's created to begin with and then go from there? Cheers.

Share this post


Link to post
Share on other sites

the only way i could think of is finding out the idd/idcs of the HUD and the its controls and making them all zero size using ctrlSetPosition. other than that i think this was always a problem. have seen this question several times over the years without an easy solution.

oh ninja'd. sounds liek a better version fo what i suggested :D

Share this post


Link to post
Share on other sites

_idcs = [configfile >> "RscInGameUI" >> "RscOptics_cows", 1, true] call BIS_fnc_displayControls;

Also returns a list of controls.

Share this post


Link to post
Share on other sites

What about using cinema borders to hide the GUI elements?

Share this post


Link to post
Share on other sites

All right, thanks guys for all suggestions, I'll try.

What about using cinema borders to hide the GUI elements?

If are shown over the GUI, not beneath... But I never liked them much. Just hiding part of the view, while I would preffer to keep visible all screen.

Share this post


Link to post
Share on other sites

Tonic's solutions sounds like your best bet. May aswell post this as I fiddled with it for a bit. Hide unit and stance info uptop :p

{
private ["_rsc","_idcs"];
_rsc = _x;
_idcs = [configfile >> "RscInGameUI" >> _rsc, 1, true] call BIS_fnc_displayControls; 
{
	((uiNameSpace getVariable _rsc) displayCtrl _x) ctrlSetPosition [0, 0, 0, 0];
	((uiNameSpace getVariable _rsc) displayCtrl _x) ctrlCommit 0;
} forEach _idcs;
} forEach ["RscStanceInfo","RscUnitInfo"];

Share this post


Link to post
Share on other sites
If you are using a scripted camera and want to hide it you can just use the scripting command:

Yes, but I'm switching from scripted camera into non-scripted via switchcamera, and that command seems do nothing at least in such case (HUD stays).

May aswell post this as I fiddled with it for a bit. Hide unit and stance info uptop

Cool. Thanks. :)

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
Sign in to follow this  

×