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

Simulate thunders & lightning


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Desktop
AlliedModders Donor
Join Date: Sep 2009
Location: C:\Users\Default\
Old 07-30-2019 , 12:01   Simulate thunders & lightning
Reply With Quote #1

Hi guys;

I've been searching for any code that helps making the same effect that old MercyLeZz zombie plague in 1.6 could do (talking about thunders and lightning).

Didn't find anything similar to that intesity-variating light that he used to make this effect on the map.

To explain my idea, think about a very dark map (already done with SetLightStyle) with timers repeating each X seconds, producing increasements and decreasements of map's light.

The point is that whenever i change the light intensity with SetLightStyle, it does not refresh until the player places some type of light or moves around all the map, making that code useless.

Any idea?
__________________
Massive Infection:: Piu-Games
Desktop is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 07-30-2019 , 12:28   Re: Simulate thunders & lightning
Reply With Quote #2

I'm assuming this is for CS:GO, I know that CS:GO has a very weird bug with lightning even if you could achieve it without having to restart the map and/or disconnect all clients and reconnect them.

I really hope that one day it gets fixed by volvo
TheDS1337 is offline
Desktop
AlliedModders Donor
Join Date: Sep 2009
Location: C:\Users\Default\
Old 07-30-2019 , 15:31   Re: Simulate thunders & lightning
Reply With Quote #3

Yes, this is for CSGO tho, forgot to mention it.

I think we're thinking the same bug.

I wonder if we could "refresh" the entity in any way to fix this.
__________________
Massive Infection:: Piu-Games

Last edited by Desktop; 07-30-2019 at 15:31.
Desktop is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 07-31-2019 , 05:26   Re: Simulate thunders & lightning
Reply With Quote #4

I don't think it's possible, it's only loaded when a map is loaded :/ we need to email valve to atleast get the "a" lightening fixed because if you already tried it... it makes most of the map textures solid black
TheDS1337 is offline
Desktop
AlliedModders Donor
Join Date: Sep 2009
Location: C:\Users\Default\
Old 08-09-2019 , 11:42   Re: Simulate thunders & lightning
Reply With Quote #5

Ummm, look at this, i've found it in an old post by Dr. Api

PHP Code:
void ChangeLightStyle(char[] lightstringint client 0)
{
    
int style 1;
    if(
strcmp(lightstring"") != 0)
    {
        
SetLightStyle(0lightstring);

        
// This refreshes and updates the entire map with the new light style.
        
int entity CreateEntityByName("light_dynamic");

        
DispatchKeyValue(entity"_light""0 0 0 0");
        
DispatchKeyValue(entity"brightness""0");
        
DispatchKeyValue(entity"style""13");
        
DispatchKeyValue(entity"distance""19999");
        
DispatchSpawn(entity);

        if(
client)
        {
            
SetEntProp(entityProp_Data"m_iHammerID"client);
            
SDKHook(entitySDKHook_SetTransmitHook_SetTransmitLight);
        }

        if(
style == 0)
        {
            
float vPos[3], vMins[3], vMaxs[3];
            
GetEntPropVector(0Prop_Data"m_WorldMins"vMins);
            
GetEntPropVector(0Prop_Data"m_WorldMaxs"vMaxs);
            
vPos[0] = (vMins[0] + vMaxs[0]) / 2;
            
vPos[1] = (vMins[1] + vMaxs[1]) / 2;
            
vPos[2] = vMaxs[2] + 2000.0;
            
TeleportEntity(entityvPosNULL_VECTORNULL_VECTOR);

            
AcceptEntityInput(entity"TurnOn");
            
SetVariantString("OnUser1 !self:TurnOff::0.2:-1");
            
AcceptEntityInput(entity"AddOutput");
            
SetVariantString("OnUser1 !self:TurnOff::0.3:-1");
            
AcceptEntityInput(entity"AddOutput");
            
SetVariantString("OnUser1 !self:TurnOff::0.4:-1");
            
AcceptEntityInput(entity"AddOutput");
            
SetVariantString("OnUser1 !self:Kill::0.5:-1");
            
AcceptEntityInput(entity"AddOutput");
            
AcceptEntityInput(entity"FireUser1");
        }
        else
        {
            if(
style == 1)
            {
                
SetVariantString("OnUser1 !self:TurnOff::0.7:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser1 !self:TurnOff::0.8:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser1 !self:Kill::1.0:-1");
                
AcceptEntityInput(entity"AddOutput");
                
AcceptEntityInput(entity"FireUser1");

                
SetVariantString("OnUser3 !self:FireUser2::0.05:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.10:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.15:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.20:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.25:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.30:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.35:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.40:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.45:-1");
                
AcceptEntityInput(entity"AddOutput");
            }
            else
            {
                
SetVariantString("OnUser1 !self:TurnOff::1.2:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser1 !self:TurnOff::1.3:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser1 !self:Kill::1.5:-1");
                
AcceptEntityInput(entity"AddOutput");
                
AcceptEntityInput(entity"FireUser1");

                
SetVariantString("OnUser3 !self:FireUser2::0.1:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.2:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.3:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.4:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.5:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.6:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.7:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.8:-1");
                
AcceptEntityInput(entity"AddOutput");
                
SetVariantString("OnUser3 !self:FireUser2::0.9:-1");
                
AcceptEntityInput(entity"AddOutput");
            }

            
SetEntProp(entityProp_Data"m_iHealth"1);
            
HookSingleEntityOutput(entity"OnUser2"OnUser2);
            
AcceptEntityInput(entity"FireUser3");
        }
    }

How good/bad is this? Theoretically it refreshes lights by emitting light when you apply changes to darkness/brightness.
__________________
Massive Infection:: Piu-Games
Desktop 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 19:21.


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