Skirmish_ 0 Posted May 22, 2019 Hi, I've been wondering for a while on how Bohemia have done this, maybe someone can help here. The 3DEN Displays all have actions that display a new box on the screen (e.g. Clicking new scenario button will display a another box and wont let you interact with anything behind it): https://gyazo.com/956ab95d3148cd87e4c9de5902d591ca I was thinking they made it so when the user clicks on the button, the controls get made in the script, but I don't know. Thanks Share this post Link to post Share on other sites
7erra 629 Posted May 23, 2019 findDisplay 313 createDisplay "YourNewDialog"; Share this post Link to post Share on other sites
Skirmish_ 0 Posted May 23, 2019 1 hour ago, 7erra said: findDisplay 313 createDisplay "YourNewDialog"; yeah thanks for the reply but every time i try this it crashes my game 😕 Share this post Link to post Share on other sites
7erra 629 Posted May 23, 2019 Change the 313 to the idd of your display. The example was for 3den which idd is 313. If the parent display is not open it crashes the game. Share this post Link to post Share on other sites
Skirmish_ 0 Posted May 24, 2019 2 hours ago, 7erra said: Change the 313 to the idd of your display. The example was for 3den which idd is 313. If the parent display is not open it crashes the game. I have a display open and i did change the idd it still crashed my game somehow... Share this post Link to post Share on other sites
7erra 629 Posted May 24, 2019 Whats the error message? Share this post Link to post Share on other sites
Skirmish_ 0 Posted May 26, 2019 On 5/24/2019 at 10:18 AM, 7erra said: Whats the error message? Basically when i execute it, my game freezes for like a minute then it crashes with the exitcode: 0xC0000005 - STATUS_ACCESS_VIOLATION. I use the following on the parent display: enableDisplay = 1; enableSimulation = 1; idd = 98111; On the child display i use the same. Does the parent display need to be opened with createDisplay or can I open it as a dialog, because i have been opening the parent display as a dialog. Thanks Share this post Link to post Share on other sites
7erra 629 Posted May 26, 2019 createDisplay is used when you want to create a GUI on top of another one. createDialog is used when creating a new GUI on its own. Therefore the parent display has to be opened with createDialog while all child displays should be created with createDisplay. The STATUS_ACCESS_VIOLATION can happen when executing certain commands the wrong way, eg while in 3den preview: findDisplay 313 createDisplay "anyDisplayInTheGame"; // goodbye, you cruel game world You are saying that you are using the same attributes on the parent and child display. Does that also include the idd? If so it is always better to use a new and unique IDD for each of your displays. When and how are you creating the new display? It might be possible that the parent dialog isn't opened at the time. Share this post Link to post Share on other sites
Larrow 2822 Posted May 26, 2019 See all the displays in the root of the config Display3DEN# (eg. Display3DENNew, Display3DENAttributes etc ). They all have defined in there controlsBackground a control that inherits from "ctrlStaticBackgroundDisableTiles" which is the diagonal lines background. This static control stops clicks happening to the display3DEN beneath it and is large enough to cover more than your whole screen. [ -4, -2, 8, 4 ] (x, y, w, h) so you can drag the display via its title and it still covers display3DEN beneath it. Open the editor, bring up the debug console and type... findDisplay 313 displayCreate "Display3DENNew" This is the display used for choosing which map to open. It has no functionality (no map names shown) as this is all handled by the do3DENAction "missionNew" command. Share this post Link to post Share on other sites
Skirmish_ 0 Posted May 26, 2019 1 hour ago, 7erra said: createDisplay is used when you want to create a GUI on top of another one. createDialog is used when creating a new GUI on its own. Therefore the parent display has to be opened with createDialog while all child displays should be created with createDisplay. The STATUS_ACCESS_VIOLATION can happen when executing certain commands the wrong way, eg while in 3den preview: findDisplay 313 createDisplay "anyDisplayInTheGame"; You are saying that you are using the same attributes on the parent and child display. Does that also include the idd? If so it is always better to use a new and unique IDD for each of your displays. When and how are you creating the new display? It might be possible that the parent dialog isn't opened at the time. Yeah well I'm obviously not using the same idd I only included that so I should show what idd the parent display is using. I can execute: findDisplay 46 createDisplay "anyDisplayInGame"; Everything works fine there, but whenever I use the parent display (findDisplay 98111) as the parent display it crashes my game, and yes the parent display is open... 25 minutes ago, Larrow said: See all the displays in the root of the config Display3DEN# (eg. Display3DENNew, Display3DENAttributes etc ). They all have defined in there controlsBackground a control that inherits from "ctrlStaticBackgroundDisableTiles" which is the diagonal lines background. This static control stops clicks happening to the display3DEN beneath it and is large enough to cover more than your whole screen. [ -4, -2, 8, 4 ] (x, y, w, h) so you can drag the display via its title and it still covers display3DEN beneath it. Open the editor, bring up the debug console and type... findDisplay 313 displayCreate "Display3DENNew" This is the display used for choosing which map to open. It has no functionality (no map names shown) as this is all handled by the do3DENAction "missionNew" command. Yeah I understand everything there I'm only having the game crash problem from a display thats open, I have no idea why it's crashing my game and I can't finish my work until it's obviously fixed, hence why I'm here. Share this post Link to post Share on other sites
7erra 629 Posted May 26, 2019 Can you upload your test mission? Might be faster than taking guesses. Share this post Link to post Share on other sites
Skirmish_ 0 Posted May 26, 2019 3 hours ago, 7erra said: Can you upload your test mission? Might be faster than taking guesses. Well it's not a test mission, its one I've been working on for a bit, I don't feel comfortable with uploading it unfortunately. On the other hand the script attached to the parent display has around 500 lines, not sure if that is the culprit as the child display executes a script when it is spawned also... also, when I open a display using createDisplay, how would I close that specific display without needing to go in and press escape (for scripting reasons) Share this post Link to post Share on other sites
Skirmish_ 0 Posted May 26, 2019 UPDATE: I got it to not crash. The problem was another menu that apparently crashes your game when attempting this. However this opens a new problem, the child display doesnt even go over the parent display and it looks like you just created another dialog Share this post Link to post Share on other sites
Skirmish_ 0 Posted May 29, 2019 I've copied basically everything bohemia have done as far as configs go, however it just looks like I made another parent display/dialog and its not going over the display. Maybe someone here can help? Share this post Link to post Share on other sites
7erra 629 Posted June 1, 2019 I've done some more research and testing and it seems that the 3den display is special in this regard. Another example for "displays" being created on top of each other would be the save and load "dialog" in the arsenal which is opened by clicking the SAVE or LOAD button. The new "dialog" is created and all the controls from the arsenal stay visible. Here's the catch though: These "dialogs" are in fact controls groups and therefore not displays. So instead of using createDisplay to create a new dialog you can make a controls group as part of your dialog with the attribute fade = 1; and show it when needed with _ctrl ctrlSetFade 0 and ctrlCommit. Keep in mind that the other controls will remain interactable. To prevent this make the controls group fill the entire screen: x = safeZoneX; y = safeZoneY; w = safeZoneW; h = safeZoneH; Share this post Link to post Share on other sites
Skirmish_ 0 Posted June 1, 2019 1 hour ago, 7erra said: I've done some more research and testing and it seems that the 3den display is special in this regard. Another example for "displays" being created on top of each other would be the save and load "dialog" in the arsenal which is opened by clicking the SAVE or LOAD button. The new "dialog" is created and all the controls from the arsenal stay visible. Here's the catch though: These "dialogs" are in fact controls groups and therefore not displays. So instead of using createDisplay to create a new dialog you can make a controls group as part of your dialog with the attribute fade = 1; and show it when needed with _ctrl ctrlSetFade 0 and ctrlCommit. Keep in mind that the other controls will remain interactable. To prevent this make the controls group fill the entire screen: x = safeZoneX; y = safeZoneY; w = safeZoneW; h = safeZoneH; Hmm, thats wierd, because looking at the config.cpp theres no mention of a controls group in the 3den displays or scripts... Nonetheless, I'll implement this and have a go at it, thanks for the help, and if you ever get anymore info about it make sure and post it here so others can learn from it Share this post Link to post Share on other sites