Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Grey Screen

  1. #1
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts

    Grey Screen

    Hey Guys, i have a question:

    Its possible to delete all colours and only set white and black for 20 secounds in a script?
    (So grey screen [black+white without green blue red...])

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    You can precache the shader "black" and make it over the whole screen with setShader("black", 640, 480) IIRC and .alpha = 0.5

    Maybe somebody want to figure out precisely
    timescale 0.01

  3. The Following User Says Thank You to kung foo man For This Useful Post:

    guiismiti (16th September 2014)

  4. #3
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    113
    Thanks
    10
    Thanked 74 Times in 45 Posts
    set the shader to black/white and:
    .color = (0.7,0.7,0.7)

  5. The Following User Says Thank You to randall For This Useful Post:

    kung foo man (17th June 2013)

  6. #4
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    I know it's an old thread, but I'm using it.
    Call on player

    PHP Code:
    blackAndWhiteScreen()
    {
        
    blackandwhite newClientHudElem(self);
        
    blackandwhite.vertAlign "fullscreen";
        
    blackandwhite.horzAlign "fullscreen";

        
    blackandwhite.alpha 0.5;
        
    blackandwhite setShader("black"640480);

        
    wait(20);

        
    blackandwhite destroy();

    The only thing is, this isn't actually black and white, it's just darkened.
    Although I tried using the attribute color, it didn't change anything. I tried setting it as green and not grey, didn't work.

    Code:
    blackandwhite.color = (0,0.7,0);
    Last edited by guiismiti; 16th September 2014 at 18:19.

  7. #5
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Maybe "white" instead of "black"? And then using the color attribute with low numbers like (0.3, 0.3, 0.3), which should turn it darkish (just guessing).
    timescale 0.01

  8. The Following User Says Thank You to kung foo man For This Useful Post:

    guiismiti (16th September 2014)

  9. #6
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    in DirectX9 mode you can shellshock some1 and its black/white for a few secs

  10. #7
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by guiismiti View Post
    I know it's an old thread, but I'm using it.
    Call on player

    PHP Code:
    blackAndWhiteScreen()
    {
        
    blackandwhite newClientHudElem(self);
        
    blackandwhite.vertAlign "fullscreen";
        
    blackandwhite.horzAlign "fullscreen";

        
    blackandwhite.alpha 0.5;
        
    blackandwhite setShader("black"640480);

        
    wait(20);

        
    blackandwhite destroy();

    The only thing is, this isn't actually black and white, it's just darkened.
    Although I tried using the attribute color, it didn't change anything. I tried setting it as green and not grey, didn't work.

    Code:
    blackandwhite.color = (0,0.7,0);
    You should always set the player flag in front of client elements:

    PHP Code:
    blackAndWhiteScreen()
    {
        
    // check in case element is already on player's screen
        
    if( isdefinedself.blackandwhite ) )
            
    self.blackandwhite destroy();
        
        
    blackandwhite newClientHudElemself );
        
    blackandwhite.alpha 1;
        
    blackandwhite.0;
        
    blackandwhite.0;
        
    blackandwhite.alignX "left";
        
    blackandwhite.alignY "top";
        
    blackandwhite.horzAlign "fullscreen";
        
    blackandwhite.vertAlign "fullscreen";
        
    blackandwhite.foreground true;
        
    blackandwhite.color = (0.5020.5020.502);
        
    blackandwhite setShader"white"640480 );        
        
        
    self.blackandwhite blackandwhite;

        
    wait20 );
        
        
    // always check for defined element in case player has disconnected. If you don't it will throw an error
        
    if( isdefinedself.blackandwhite ) )
            
    self.blackandwhite destroy();


  11. #8
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    ehm why?
    Just check if self is still defined, so you know the player hasnt disconnected

    Setting it to a player var might cause your script to overwrite said var and double the hud elem, making one hud elem indestructable for it has lost its pointer

    I use a lot of local hud elements in some of my mods, and it works fine. No need for a player var.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  12. #9
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Why is it that I can't generate valid material+image with the asset_manager?
    I created a jpg file (supported format), it's a 512x512 green square. Then I followed the steps from this tutorial and got two tiny files. I set the green square as a fullscreen shader and I get an error when trying to load it.
    Code:
    ERROR: Couldn't open techniqueSet 'materials/techniquesets/
    =soE`v.gdf
    green
    104
    912561463
    79
    .te'
    WARNING: Could not find material 'green'
    Also tried using DXT5 instead of DXT3.
    It's the same error I was having with the killIcon yesterday when I gave up, but using the asset manager to create iwi+material seems like a very basic thing for modding.
    Thanks in advance.

    @kung foo man - I'm gonna try to use the white shader now.
    Tested - alpha 0.4 and color(0,0.5,0) looks really nice.
    Last edited by guiismiti; 16th September 2014 at 22:15.

  13. #10
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by IzNoGoD View Post
    ehm why?
    Just check if self is still defined, so you know the player hasnt disconnected

    Setting it to a player var might cause your script to overwrite said var and double the hud elem, making one hud elem indestructable for it has lost its pointer

    I use a lot of local hud elements in some of my mods, and it works fine. No need for a player var.
    Hud elements are not vars. They are structs. Furthermore, and here is a PRO-TIP: if you check to see if the hud element is defined before you create it, you will never double your hud elements.

    And finally, all client hud elements are player elements. It is impossible for them to be otherwise. That is why they are called CLIENT elements. As in PLAYER! So, your nonsense-talk about local vars vs player vars is completely invalid.
    Last edited by Tally; 16th September 2014 at 22:24.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •