Jump to content

Skirmish_

Member
  • Content Count

    35
  • Joined

  • Last visited

  • Medals

Posts posted by Skirmish_


  1. Hey everyone,

     

    Was wondering something for a while now and I am pretty stumped.  Whenever I create my child displays with:

    finddisplay 46 createdisplay "displayMenuChild"

    I can still interact with the parent display (i.e. Can press buttons and interact with listboxes etc.)

    I also use the same controls as used in the 3DEN Editor displays.

     

    I create my parent display as a dialog with:

    createdialog "displayMenuParent";

    Maybe I need to create it another way?

     

    Thanks in advance,

    Skirmish_


  2. Hey everyone,

     

    I've been wondering this for a while now, maybe someone here can help me out.  I've been making UI's the same way for a long time, via the GUI Editor and exporting them using SafeZone.  However this positioning technique overlaps controls when you're on different resolutions and display sizes.  I looked around the 3DEN displays and controls in their configs and saw that the positions and completely different to safeZone:

    		class Picture: ctrlStaticPictureKeepAspect
    		{
    			text="\a3\3DEN\Data\Displays\Display3DENMsgBox\picture_ca.paa";
    			x="(	(0.5 - 0.5 * 	75 * (pixelW * pixelGrid * 	0.50))) + (2) * (pixelW * pixelGrid * 	0.50)";
    			y="(	(0.5 - 0.5 * 	25 * (pixelH * pixelGrid * 	0.50))) + (	5 + 2) * (pixelH * pixelGrid * 	0.50)";
    			w="10 * (pixelW * pixelGrid * 	0.50)";
    			h="5 * (pixelH * pixelGrid * 	0.50)";
    		};

    Is there a way I can start creating displays using this positioning technique?

     

    Thanks in advance,

    Skirmish_


  3. Hey everyone,

     

    I've been wondering this for the longest time now and I've had no real answer to this question.

    How are the Displays - 313 (Display3DEN) and 46 even getting spawned?  As you can obviously move while they are on screen.

    I am asking in regards to the displays being overlapped:

    finddisplay 313 createdisplay "Display3DENNew";

    and the parent display still being visible on screen while the child display is open.

    I cannot get this to work by myself and I've copied basically everything bohemia have done when it comes to configs etc.

     

    I've tested pretty much everything and have came to the conclusion that it definetly has something to do with the parent display and how it is opened.

     

    Example - Overlapping displays

     

    Thanks in advance, need all the help I can get at this point.

    Skirmish_

     


  4. 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


  5. Hi,

     

    I've been very confused for the past week on how bohemia made their 3DEN displays overlap each other.

    I've copied basically everything they have done as far as configs go, and I have also been using createDisplay to have the child display go over the dialog, however it just looks like I made another parent display/dialog and its not going over the display.

    Maybe someone here can help.

     

    Thanks in advance,

    skirmish_


  6. 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)

     


  7. 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.


  8. 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


  9. 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


  10. Okay so i've been messing around with the HandleDamage EVH on vehicles using:

    this addEventHandler [ "HandleDamage", { ( _this#7 in [ "hitlfwheel", "hitlbwheel", "hitlmwheel", "hitlf2wheel", "hitrfwheel", "hitrbwheel", "hitrmwheel", "hitrf2wheel", "hitengine", "hitengine2", "HitEngine3", "hitfuel", "hitfuel2", "HitRGlass", "HitLGlass", "HitGlass1", "HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6", "HitStarter1", "HitStarter2", "HitStarter3" ] ) } ]; 
    

    this way it can only damage everything exept the HULL of the vehicle, and this works fine on every other vehicle exept the hatchback.

     

    I have no Idea if the hatchback uses different hit points but when ever the hatchback takes any damage from the code above, it just takes all four tires out.

    Please tell me if i'm missing any hit points and thanks in advance.


  11. 6 minutes ago, Larrow said:

    Sorry I forgot to add the camera offset to the command. Tested, just removed some of your unused variables.

    
    ShowNameTags = addMissionEventHandler [ "Draw3D", {
    
    	{
    		_unit = _x;
    
    		_distance = cameraOn distanceSqr _unit;
    		_colour = [ 0, 1, 0, 1.5 - ( _distance / ( 12^2 )) ];
    
    		_name = "";
    		{
    			_name = format [ "%1%2%3", _name, [ endl, "" ] select ( _name == "" ), name _unit ];
    		}forEach crew vehicle _unit;
    
    		_unit selectionPosition "head" params[ "_headX", "_headY", "_headZ" ];
    		_pos = _unit modelToWorldVisual [ _headX - 0.05, _headY, _headZ + 0.7  + (_distance / ( 12 ^ 2 )) / 1.5 ];
    		if ( isNull objectParent _unit && { !( lineIntersects [ positionCameraToWorld [ 0, 0, 0 ], eyePos _unit, cameraOn, _unit ]) } ) then {
    			drawIcon3D[ '', _colour, _pos, 0, 1.0, 0, _name, 1, 0.0345, "RobotoCondensed", "center", false ];
    		};
    	}forEach ( allUnits select { side _x in [ civilian, west, independent ] } );
    }];

     

    Thanks a lot for the help, however the line intersects doesn't actually work and i can see the tag through walls:

    https://gyazo.com/0bfc8af7cf27e89217bd4510895914a2


  12. Yeah I used the if statement and it threw this error:

    https://gyazo.com/7c8aceeb3f1ee8f30797c2e1ecfae0e2

     

    Was using this for the test:

    ShowNameTags = addMissionEventHandler ["Draw3D",{  
      _units = [];  
      {  
        if (side _x == civilian || side _x == west || side _x == independent) then {  
         _units pushBack _x;  
        };  
      } forEach allUnits;  
     
      {  
        _unit = _x; 
        _distance = cameraOn distance _unit;  
        _alpha = 1.5 - (_distance / 12);  
        _colour = [0,1,0,_alpha];  
        _crew = crew (vehicle _unit);  
        _veh = vehicle _unit;  
        _name = '';  
     
        { 
            _name = format ["%1", name _unit];  
      
       }forEach _crew;  
      
        _bounding = boundingBoxReal _veh;  
        _b1 = _bounding select 0;  
        _b2 = _bounding select 1;  
        _maxHeight = (abs ((_b2 select 2) - (_b1 select 2)));  
      
        _pos = visiblePosition _veh;  
        _height = (_b2 select 2) + ((getPosATL _veh) select 2);  
        _maxHeight = _maxHeight - 0.37;  
        _pos set[2,_height];  
        _pos = _unit modelToWorldVisual [((_unit selectionPosition "head") select 0)-0.05, ((_unit selectionPosition "head") select 1), ((_unit selectionPosition "head") select 2) + 0.7  + (_distance / 12) / 1.5];  
    if ( isNull objectParent _unit && { !(lineIntersects [positionCameraToWorld, eyePos _unit, cameraOn, _unit]) } ) then { 
         drawIcon3D['', _colour, _pos, 0, 1.0, 0, _name, 1, 0.0345, "RobotoCondensed", "center", false];   
        };  
      }forEach _units; 
    }];

     


  13. Okay, so i'm trying to get drawIcon3D to work the same way as the code below, however this only shows the units drawicon3d if the player's eyes are in view of the unit.  I would like for it to be in the view of the players camera (internal or external) rather than the eye position of the player, thanks in advance to anyone willing to help me as it has been annoying me for a long time.

     

    if (!(lineIntersects [eyePos vehicle cameraOn, eyePos _unit, vehicle cameraOn, _unit]) && isNull objectParent _unit) then {
    
    drawIcon3D['', _colour, _pos, 0, 1.0, 0, _name, 1, 0.0345, "RobotoCondensed", "center", false];
    
    };

     

×