Raised This Month: $51 Target: $400
 12% 

[TF2] Help with env_screenoverlay "disappearing"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pilger
Senior Member
Join Date: Sep 2010
Old 02-12-2015 , 08:13   [TF2] Help with env_screenoverlay "disappearing"
Reply With Quote #1

Hey guys,

I'm tryng to set an overlay here and I wish to display it simultaneously with stock overlay effects of the game itself (like ubercharge and jarate, for instance).

I've been told to use the env_screenoverlay entity, but I'm really not that good with entities:

env_screenoverlay code


The problem is that my overlay disappears everytime the game sets an overlay effect on a specific client. That client can't see my overlay until map change.

How can I "refresh" the entity for specific clients!? Can it be done? Or is there another way around this that I can't see clearly?


Thanks in advance!

p.s.: I've already posted a similar question on another thread, but since it was on another section and I was kinda "hijacking" it, I figured it would be better to start a new one.
__________________
pilger is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 02-12-2015 , 16:54   Re: [TF2] Help with env_screenoverlay "disappearing"
Reply With Quote #2

PHP Code:
public TF2_OnConditionAdded(clientTFCond:cond)
{
    if (
client == Hale)
    {
        if (
Special == VSHSpecial_Banana)
        {
            switch (
cond)
            {
                case 
TFCond_OnFireTFCond_JaratedTFCond_Bleeding:
                {
                    
TF2_RemoveCondition(clientcond);
                    
SetScreenOverlay(Hale"effects/combine_binocoverlay");
                    
RequestFrame(FixOverlay);
                    return;
                }
            }
        }
    }




public 
FixTankOverlay(any:Null)
{
    
SetScreenOverlay(Hale"effects/combine_binocoverlay");
}






// https://forums.alliedmods.net/showthread.php?t=72679
stock SetScreenOverlay(iClient, const String:szOverlay[] = "", const Float:flTime = -1.0)
{
    new 
iFlags GetCommandFlags("r_screenoverlay");
    
SetCommandFlags("r_screenoverlay"iFlags &~ FCVAR_CHEAT);

    
ClientCommand(iClient"r_screenoverlay \"%s\""szOverlay);

    
SetCommandFlags("r_screenoverlay"iFlags);

    if (
flTime >= 0.0)
    {
        
CreateTimer(flTimeTimer_RemoveOverlayGetClientUserId(iClient), TIMER_FLAG_NO_MAPCHANGE);
    }

__________________
Chdata is offline
pilger
Senior Member
Join Date: Sep 2010
Old 02-12-2015 , 21:07   Re: [TF2] Help with env_screenoverlay "disappearing"
Reply With Quote #3

This removes the game effect (e.g.: ubercharge overlay) completely. That's not what I intent to do.

I wisht to display both the game effect and my custom overlay simultaneously.
__________________
pilger is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 02-13-2015 , 09:43   Re: [TF2] Help with env_screenoverlay "disappearing"
Reply With Quote #4

Try destroying the old entity and remaking it.

If doing that removes other overlays, then it is apparent that we can't have two overlays at once.

...

Then again, can't you be on fire and bleeding (and jarate'd?) at the same time? (Yes I'm p sure bleed is an overlay and not just fade, considering it removes my r_screenoverlay's when the condition applies).
__________________

Last edited by Chdata; 02-13-2015 at 09:45.
Chdata is offline
pilger
Senior Member
Join Date: Sep 2010
Old 02-13-2015 , 10:36   Re: [TF2] Help with env_screenoverlay "disappearing"
Reply With Quote #5

Isn't destroying the entity necessary? Doesn't this practice use much resource?

I was wondering if I could simply make it visible again. Like "refiring" it...
__________________
pilger is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 02-13-2015 , 10:43   Re: [TF2] Help with env_screenoverlay "disappearing"
Reply With Quote #6

Oh yeah try

https://developer.valvesoftware.com/..._screenoverlay

StopOverlays
StartOverlays
__________________
Chdata is offline
pilger
Senior Member
Join Date: Sep 2010
Old 02-18-2015 , 12:32   Re: [TF2] Help with env_screenoverlay "disappearing"
Reply With Quote #7

I've done some testing and doing the following:
Code:
TF2_AddCondition(client, 24); //adding Jarated condition
ent = CreateEntityByName("env_screenoverlay");
    if(ent != -1)
    {
        DispatchKeyValue(ent, "OverlayName1", OVERLAY);
        DispatchKeyValue(ent, "OverlayTime1", "1.0");
        DispatchSpawn(ent);

        SetVariantString("OnUser1 !self,StartOverlays,,0,-1");
        AcceptEntityInput(ent, "AddOutput");
        AcceptEntityInput(ent, "FireUser1");
    }
And found out that no custom overlay is displayed on top of the Jarate effect.

Am I doing something wrong here? Or can we assume it's just impossible to have both at the same time!?
__________________
pilger is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode