Jump to content
Ibragim A

Created IGUI dialog is seen while cutscenes.

Recommended Posts

Hi,
I have a problem with the created graphic dialog, which in theory should be hidden during cutscenes, as all other BIS made IGUI dialogs.
But the dialog I created remains on the screen surface when all vanilla dialogs disappear.

 

I've tried changing the display ID from 46 to many others, but it doesn't work.

 

I realized that, in principle, I can solve the problem by moving my dialog away from the screen or fading it by setting it's color alpha to zero.
But I don't quite understand how I can get the beginning and the  end of the cutscenes. Commands such as cutText or showCinemaBorder do not return variables.

 

If someone has an idea, please share it with me. Thanks.
 

screen99.png

 

screen98.png

Share this post


Link to post
Share on other sites

Well we can't read your mind, need to see some code. 😉

How do you initialize the UI?

How do you define it?

If config what do you inherit from?

Share this post


Link to post
Share on other sites

Well, my UI control is created in the most primitive way, without configurations.
So, I have config.cpp in my mod:

class Extended_PostInit_EventHandlers 
	{
		Ibragim_PC_mod_init = "[] execVM '\Addon_PC\PC_init.sqf';";
	};

Then from PC_init.sqf I run the mod scripts, including the PC_gui_bar.sqf script:

[] execVM "PC_gui_bar.sqf";

Then PC_gui_bar.sqf just creates controls on display 46:

_PC_GUI_SQUAD_1_BAR_NUMBBACK = (findDisplay 46) ctrlCreate ["RscPicture", 12751];
_PC_GUI_SQUAD_1_BAR_NUMBBACK ctrlSetTextColor [(profilenamespace getvariable ['IGUI_BCG_RGB_R',0]), (profilenamespace getvariable ['IGUI_BCG_RGB_G',1]), (profilenamespace getvariable ['IGUI_BCG_RGB_B',1]), (profilenamespace getvariable ['IGUI_BCG_RGB_A',0.8])];
_PC_GUI_SQUAD_1_BAR_NUMBBACK ctrlSetPosition 
  [
    (_PC_GUI_SQUAD_1_BAR_X + 0) * 			(			((safezoneW / safezoneH) min 1.2) / 40),
    (_PC_GUI_SQUAD_1_BAR_Y + 1) * 			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25),
    4 * 			(			((safezoneW / safezoneH) min 1.2) / 40),
    1 * 			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25)
  ];
_PC_GUI_SQUAD_1_BAR_NUMBBACK ctrlCommit 0;
_PC_GUI_SQUAD_1_BAR_NUMBBACK ctrlSetText "Addon_PC\images\CommandBar\unitNumberBackground4_ca.paa";	

 

Share this post


Link to post
Share on other sites

There is a command shownHUD that shows an active HUD, but it does not respond to HUD changes during cutscenes.

 

Syntax: shownHUD

Return Value: Array in format [hud, info, radar, compass, direction, menu, group, cursors, panels, kills, icon3d]

 

For example, it will continue to return true for (shownHUD select 6) even after the group command bar is not visible during cutscenes.

 

There are also commands like visibleCompass, visibleWatch, visibleGPS ... that react to whether a certain interface element is shown on the player's screen, which could immediately solve my problem if the same command could be for the group command bar.

Share this post


Link to post
Share on other sites

User input is partially disabled during cutscenes. But at the same time, the userInputDisabled command still returns false.

 

I'm wondering if it's possible to use the ctrlVisible command in order to determine the beginning of the scene by the disappearance of the group command bar?

Share this post


Link to post
Share on other sites

Perhaps you wrote condition about this display/these controls, like : player must be a leader to show it/them. You could add an extra (generic) condition, like a variable  GUI_SQUADS_BAR_SHOW  set to TRUE, then you could set it to FALSE during or just before/after ... what you want.

Share this post


Link to post
Share on other sites

Yes, it wouldn't be a problem if I created these cutscenes. But my mod also works with missions created by other users, so I need a universal way to determine the beginning and end of the cutscene, which works in all cases, even if the cutscene was not created by me and does not contain a variable specially created by the mission maker indicating the beginning and end of the cutscene.

 

At the moment, I could solve everything very simply if I had the opportunity to get a variable at the moment when the cutscene hides the user's command bar.

I would put a condition with this variable in a script that periodically updates my command bar controls.
 

Share this post


Link to post
Share on other sites

Try with a BI variable

if (!isNil "BIS_fnc_cinemaBorder_shown" && {BIS_fnc_cinemaBorder_shown}) then {hint "cinema border is on"};

if (isNil "BIS_fnc_cinemaBorder_shown" or (!isNil "BIS_fnc_cinemaBorder_shown" && {! BIS_fnc_cinemaBorder_shown}) ) then {hint "cinema border is off"};

Note: The cinema border (black curtain) is an overlay above the command bar which is always present.

 

Share this post


Link to post
Share on other sites

Thanks for the tip.
Doesn't work, boolean doesn't change.

 

It should be noted that even cinemaborder is not used in all cutscenes. And even the group commanding bar will not be on the screen if the player is alone in his group.

Also, not all cutscenes create their own camera, although I tried to determine this, but in vain. Cutscenes do not change the returned variable with commands such as cameraView and cameraOn.

 

Therefore, so far I see the only factor that is present in all cutscenes is partially disabled player control. But userInputDisabled is true only if it is set true by disableUserInput. And since it is no longer necessary to use this command for cutscenes, it may not be used.

Share this post


Link to post
Share on other sites

I think trying to solve for every possible kind of cutscene technique simply isn't feasible. I use the term "cutscene" loosely since most artificial transitions, be it a simple fade to black or a full on movie, can cause issues.

 

I mean broadly speaking you are trying to hide your UI whenever it would collide with other things that's going on on-screen. That's a pretty big problem.

 

You could just go with a "best effort" approach and check for a combination commonly used techniques and combine that with a flag that other content creators can use to easily hide your UI on demand.

 

Edit:

A thought occured to me, not sure about it but worth investigating. Does the game's group UI actually run on IDD 46?

 

If not see if you can find out which IDD it runs on and add your controls to that display instead.

 

A quick BIKI search found this list: 

https://community.bistudio.com/wiki/Arma_3:_IDD_List

  • Like 1

Share this post


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

I think trying to solve for every possible kind of cutscene technique simply isn't feasible. I use the term "cutscene" loosely since most artificial transitions, be it a simple fade to black or a full on movie, can cause issues.

 

I mean broadly speaking you are trying to hide your UI whenever it would collide with other things that's going on on-screen. That's a pretty big problem.

 

You could just go with a "best effort" approach and check for a combination commonly used techniques and combine that with a flag that other content creators can use to easily hide your UI on demand.

I completely agree, so I understand that primitive methods will always not be universal, which means that only a set of primitive methods will work for all possible cases.

The problem with an additional variable or flag is that users do not want them to have to subtract, enter anything at all, etc. Basically, they use mods on the principle of "what I understand, I do, what I don't understand, I don't need." This means that they simply won't bother with the extra requirements of the addon.

There is another problem in this - missions that are already created by users. This variable is not involved in them.

2 hours ago, mrcurry said:

A thought occured to me, not sure about it but worth investigating. Does the game's group UI actually run on IDD 46?

 

If not see if you can find out which IDD it runs on and add your controls to that display instead.

Yes, I tried to do it, as I said in the first post, but with no results.

Share this post


Link to post
Share on other sites
3 hours ago, mrcurry said:

A thought occured to me, not sure about it but worth investigating. Does the game's group UI actually run on IDD 46?

If not see if you can find out which IDD it runs on and add your controls to that display instead.

 

 

29 minutes ago, Ibragim A said:

 

Yes, I tried to do it, as I said in the first post, but with no results.

 

 

Same. I never found a Rsc or some display/control(s) for the command bar. It's a little bit different from the cinema border but even rscUnitInfo (fine for weapon and magazine) doesn't help for the command bar.

My aim was grabbing unit(s) data displayed by unit icons when leader.
 

Spoiler

 

I gave you the variable for the BIS_fnc_cinemaBorder because, at least, this BI function is often used by scripters (not universal but easy to use) for a cinematic animation (and the variable works as far as it's defined at cinema border start, set to true on opening, and false on closing borders).

On the other hand, this function embeds the code:

("BIS_fnc_cinemaBorder" call BIS_fnc_rscLayer) cutRsc ["RscCinemaBorder", "PLAIN"];  // configfile >> "RscCinemaBorder" returns IDD -1...
BI cinema border is a layer (allActiveTitleEffects returning [5] for me once launched til closed, more convenient, don't ask me why, than allCutLayers detecting "rscCinemaBorder" at launch but never deleting it when closed).

 

 

Share this post


Link to post
Share on other sites

Regarding the cinemaBorder there are issues again. The BIS_fnc_cinemaBorder function does everything the same as the showCinemaBorder command (creates borders, disables unit input, hides command bar ...), but the trouble is that when using the command, the variables used by the function do not react. That is, both the function and the command do the same thing, but they are encoded differently, so you cannot use function variables if the user used the command in the cutscene.

Maybe the solution needs to be found in some kind of layers.

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

×