[REL]Possible Fix for blackscreen issues

Discussion in 'Mod Discussions' started by cola_colin, February 22, 2014.

  1. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    What?

    Since the most recent Update lots of users have had weird blackscreens. This mod may fix that.
    Install "No Blackscreens" via pammv3
    Caveats:
    none anymore :)

    How?
    This is all a lie by now, it is now using the method wondible found:
    https://forums.uberent.com/threads/rel-possible-fix-for-blackscreen-issues.56735/page-4#post-914511
    ===
    A lot of blind testing let me to believe that any mod that loads css files creates black screens.
    Since even an empty css file caused issues I suspected that the way PA dynamically loads CSS is somehow not very nice to coherent. (or whatever, I have no real explanation, really no idea).

    So I changed the way CSS are loaded from this:

    Code:
    var link = document.createElement('link');
    link.href = src;
    link.type = "text/css";
    link.rel = "stylesheet";
    document.getElementsByTagName("head")[0].appendChild(link);
    to this:
    Code:
        var o = new XMLHttpRequest();
        try
        {
            o.open('GET', src, false);
            o.send('');
        }
        catch( err )
        {
            console.log("error loading " + src)
            return;
        }
    
        var link = document.createElement('style');
        link.innerText = o.responseText;
        link.type = "text/css";
        link.media = "screen";
        document.getElementsByTagName("head")[0].appendChild(link);
    This works kind of like the way PA loads js files dynamically.

    Again I have no idea what I am doing, this is based on blind trial and error.

    [​IMG]

    Good luck
    Last edited: April 20, 2014
  2. Tripax

    Tripax Member

    Messages:
    67
    Likes Received:
    62
  3. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    so try it and report back
  4. Tripax

    Tripax Member

    Messages:
    67
    Likes Received:
    62
    started 10 games not a single black screen
    before it was like 8 out of 10 times black screen

    hotbuild2 still works with this, can't vouch for other mods atm
    totalannihilation and cola_colin like this.
  5. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    Mods installed:

    Auto Factory 1.5
    Better System View 1.1
    Blueprint Info Framework 1.2.0
    Chrono Click 1.0.0
    Commander Health Display 2.7.4
    Enhanced System Preview 1.1.0
    Floating Framework 1.2.3
    Hotbuild2 1.9.9.9.3
    In Game Timer 1.3.1
    Mod Batchsize 1.1
    PA Stats Online
    Settings Manager 1.5.2
    System Sharing 1.1.1

    Without this fix I get a black screen, with this fix I don't get a blackscreen and the mods work like a boss.

    I noted one defect: hotbuild2 would display "NULL" as a value next to two of the icons on the sidebar, ping and attack. Both are mapped keys and this behaviour was not displayed without the fix installed.

    You are a ******* beast.
    totalannihilation and reptarking like this.
  6. mishtakashi

    mishtakashi Active Member

    Messages:
    369
    Likes Received:
    217
    Same story as Quitch, without the mod I get black screen every time, with the mod 100% fix.

    One thing I will add is that this also 100% fixes the issue of not being able to review each game due to the black screen showing up. f5 wasn't helpful for this problem as it refreshed to the end game menu not the review chrono cam

    Mods installed:

    Better system view 1.1
    Blueprint info framework 1.2.0
    Chrono click 1.0.0
    Enhanced system preview 1.1.0
    Floating framework 1.2.3
    Hotbuild2 1.9.9.9.3
    In game timer 1.3.1
    No blackscreen 1.0
    Pa stats online
    Planet preview details 1.1
    Settings manager 1.5.2
    System sharing 1.1.1
    Unit database 1.1.0

    I was really hanging out for this fix, many thanks!
    stormingkiwi and cptconundrum like this.
  7. boylobster

    boylobster Active Member

    Messages:
    167
    Likes Received:
    185
    Works like a charm so far. You the proverbial *man*.
  8. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Incompatible with Draggable Pip, which is very strange. I'll look into that when I get a chance.
  9. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    Haha i totally lol'd.

    So all this does is instead of linking to mod css files, it imbeds it in the body of the code via javascript.

    so from this:
    <link rel="stylesheet" type="text/css" href="styles.css" />



    To this:
    <style type="text/css"></style>


    Which is interesting, and imply's that somehow pa/coherent is having issues accessing the mods directory sometimes.


    It could be some type of issue with the file handers? or some type of permission issue?


    Also you should be able to remove this line of the code:
    link.media = "screen";
  10. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    This mod seems to have trouble when the css includes an image. It's breaking my draggable pip because the images don't show.
    totalannihilation and reptarking like this.
  11. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Are your image URLs relative paths?
  12. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Yep that's the issue. I'll fix that when I get a chance.
    totalannihilation and reptarking like this.
  13. superouman

    superouman Post Master General

    Messages:
    1,007
    Likes Received:
    1,139
    The possible fix for the blackscreen possibly worked :)
    stuart98 and cola_colin like this.
  14. mered4

    mered4 Post Master General

    Messages:
    4,083
    Likes Received:
    3,149
    From a former CSS programmer:
    Yep. That will do it.

    I just cannot tell you why either. Sorry :)
    stuart98 likes this.
  15. r0ck1t

    r0ck1t Active Member

    Messages:
    125
    Likes Received:
    51
    It worked for me. Awesome.
  16. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    Sounds like you knew what you were doing after all.

    I won't download it as I rarely blackscreen and I f5, but I would suspect from positive feedback that if I was having more trouble this would fix it.
  17. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    Needs update this breaks the start screen in gamma.
    But is still needed cause still black screens ...
  18. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    And I have it updated for gamma ! So if you use mods and you have black screens Install this.
    Quitch, cola_colin and cptconundrum like this.
  19. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    Just tested without and with again.

    Usefull as fu ck for gamma.
    Uber might as well implement this to stock! 100% results!
  20. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I am having massive issues in the lobby with this:
    [​IMG]

    can anyone confirm?

Share This Page