Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Moving huds :D

  1. #11
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Shaders work too with fadeovertime

    PHP Code:
    {
            
    hud newClientHudElem(self);
            
    hud.horzAlign "fullscreen";
            
    hud.vertAlign "fullscreen";
            
    hud setShader("white"640480);
            
    hud.alpha 1;
            
    hud.0;
            
    hud.0;
            
    hud fadeovertime(2.5);
            
    hud.alpha 0;


  2. The Following User Says Thank You to Ni3ls For This Useful Post:

    kung foo man (25th March 2014)

  3. #12
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    Doesn't work, you tested it with your own texture?
    If yes and if it does work, then do a .iwd file and upload here, I want to check it.

    Edit: My current HUD script:

    PHP Code:
    spawnHud()
    {
            
    hud newClientHudElem(self);
            
    hud.horzAlign "fullscreen";
            
    hud.vertAlign "fullscreen";
            
    hud setShader("texture_test"640480);
            
    hud.alpha 1;
            
    hud.0;
            
    hud.0;
            
    hud fadeovertime(10);
            
    hud.alpha 0;

         
    self thread destroyOnDeath(hud);
    }

    destroyOnDeath(hud)
    {
        
    self waittill("killed_player");

        if(
    isDefined(hud))
            
    hud destroy();

    notes:
    - spawnHud() will be called if someone is spawning
    - destroyOnDeath() will be called if someone die
    - the shader "texture_test" is precached
    - the hud spawns instantly (visible) and not from visible to invisible

    In game it looks like this (after spawned):

    Click image for larger version. 

Name:	ingame.png 
Views:	44 
Size:	1.33 MB 
ID:	676
    Last edited by Loveboy; 25th March 2014 at 16:39.

  4. #13
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    The thing I posted works. I use it for flashnade. The shader "white" is a default cod2 shader. I didnt test it with own texture. Maybe you need to compile your shader with certain options to make it work

  5. #14
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Loveboy View Post
    Is there any way to do a shader from .alpha 0 to .alpha 1 in 5 secounds? I tried it and there is a problem, it just showed the shader instantly. If you try it on the default shader "black", then you will see, that it works. But not on own shaders. I tried already fadeOverTime(time) too, but it doesn't work, only on text.

    fadeOverTime() works on shaders as well.

    Example of a working fading server logo shader:

    PHP Code:
        if( isdefinedlevel.svrlogo ) ) level.svrlogo destroy();
            
        if( !
    isdefinedlevel.svrlogo ) )
        {
            
    level.svrlogo newHudElem(); 
            
    level.svrlogo.X
            
    level.svrlogo.Y;
            
    level.svrlogo.hidden false;
            
    level.svrlogo.alignX "left";
            
    level.svrlogo.alignY "top";
            
    level.svrlogo.horzAlign "fullscreen";
            
    level.svrlogo.vertAlign "fullscreen"
            
    level.svrlogo.archived false;
            
    level.svrlogo.hideWhenInMenu true;
            
    level.svrlogo setShadergame"demonlogo" ], W);
            
    level.svrlogo.alpha 0;
        }
            
        for( ;; )
        {
            
            
    wait looptime;
            
            if( 
    isdefinedlevel.svrlogo ) ) level.svrlogo fadeOverTime);
            if( 
    isdefinedlevel.svrlogo) ) level.svrlogo.alpha .7;
            
            
    wait screentime;
            
            if( 
    isdefinedlevel.svrlogo ) ) level.svrlogo fadeOverTime);
            if( 
    isdefinedlevel.svrlogo ) ) level.svrlogo.alpha 0;
        } 

  6. The Following User Says Thank You to Tally For This Useful Post:

    kung foo man (25th March 2014)

  7. #15
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    No, now I found the problem, I looked on the material and image from the shader "black" and "white".
    The material name is "black" and the image name is "$black" (open the material from main/iw_13.iwd/materials/black to see what image name it has).
    You can also read the options what there is used for the material, but I it's just hard to understand, what they set:

    Code:
    V   \                                 e‘(      P   D   P   c     \   tools black $black colorMap

Posting Permissions

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