Raised This Month: $32 Target: $400
 8% 

[Solved] How to make this darkness effect?


Post New Thread Reply   
 
Thread Tools Display Modes
Mitchell
~lick~
Join Date: Mar 2010
Old 11-25-2012 , 14:28   Re: How to make this darkness effect?
Reply With Quote #21

Quote:
Originally Posted by Mitch View Post
seeing how ive had this code since halloween
Code:
#include <sourcemod>
#include <sdktools>

new FogIndex = -1;
new Float:mapFogStart = 0.0;
new Float:mapFogEnd = 175.0;
new Float:mapFogDensity = 1.0;

public OnPluginStart()
{
    RegAdminCmd("sm_fogoff", fogoff, ADMFLAG_ROOT, "");
    RegAdminCmd("sm_fogon", fogon, ADMFLAG_ROOT, "");
}
public OnMapStart()
{
    new ent; 
    ent = FindEntityByClassname(-1, "env_fog_controller");
    if (ent != -1) 
    {
        FogIndex = ent;
    }
    else
    {
        FogIndex = CreateEntityByName("env_fog_controller");
        DispatchSpawn(FogIndex);
    }
    DoFog();
    AcceptEntityInput(FogIndex, "TurnOff");
}

public Action:fogoff(client, args)
{AcceptEntityInput(FogIndex, "TurnOff");}    

public Action:fogon(client, args)
{AcceptEntityInput(FogIndex, "TurnOn");}

DoFog()
{
    if(FogIndex != -1) 
    {
        DispatchKeyValue(FogIndex, "fogblend", "0");
        DispatchKeyValue(FogIndex, "fogcolor", "0 0 0");
        DispatchKeyValue(FogIndex, "fogcolor2", "0 0 0");
        DispatchKeyValueFloat(FogIndex, "fogstart", mapFogStart);
        DispatchKeyValueFloat(FogIndex, "fogend", mapFogEnd);
        DispatchKeyValueFloat(FogIndex, "fogmaxdensity", mapFogDensity);
    }
}
This should do what you are trying to do, or atleast replicate what i saw in the video
Bit off topic, but you scared the hell out of me, i was like: "wait a second... i didnt post here...."
Mitchell is offline
Guren
Senior Member
Join Date: Feb 2011
Location: Equestria, Ponyville
Old 11-26-2012 , 07:59   Re: How to make this darkness effect?
Reply With Quote #22

Quote:
Originally Posted by Mitchell View Post
Bit off topic, but you scared the hell out of me, i was like: "wait a second... i didnt post here...."

LOL hahaha
__________________

Nick : Chamamyungsu // Korean Brony
Guren is offline
Guren
Senior Member
Join Date: Feb 2011
Location: Equestria, Ponyville
Old 11-26-2012 , 09:37   Re: How to make this darkness effect?
Reply With Quote #23

Quote:
Originally Posted by Mitch View Post
seeing how ive had this code since halloween
Code:
#include <sourcemod>
#include <sdktools>

new FogIndex = -1;
new Float:mapFogStart = 0.0;
new Float:mapFogEnd = 175.0;
new Float:mapFogDensity = 1.0;

public OnPluginStart()
{
    RegAdminCmd("sm_fogoff", fogoff, ADMFLAG_ROOT, "");
    RegAdminCmd("sm_fogon", fogon, ADMFLAG_ROOT, "");
}
public OnMapStart()
{
    new ent; 
    ent = FindEntityByClassname(-1, "env_fog_controller");
    if (ent != -1) 
    {
        FogIndex = ent;
    }
    else
    {
        FogIndex = CreateEntityByName("env_fog_controller");
        DispatchSpawn(FogIndex);
    }
    DoFog();
    AcceptEntityInput(FogIndex, "TurnOff");
}

public Action:fogoff(client, args)
{AcceptEntityInput(FogIndex, "TurnOff");}    

public Action:fogon(client, args)
{AcceptEntityInput(FogIndex, "TurnOn");}

DoFog()
{
    if(FogIndex != -1) 
    {
        DispatchKeyValue(FogIndex, "fogblend", "0");
        DispatchKeyValue(FogIndex, "fogcolor", "0 0 0");
        DispatchKeyValue(FogIndex, "fogcolor2", "0 0 0");
        DispatchKeyValueFloat(FogIndex, "fogstart", mapFogStart);
        DispatchKeyValueFloat(FogIndex, "fogend", mapFogEnd);
        DispatchKeyValueFloat(FogIndex, "fogmaxdensity", mapFogDensity);
    }
}
This should do what you are trying to do, or atleast replicate what i saw in the video

no... it doesn't.

i tried test your plugin(source) but it's notthing happened.
__________________

Nick : Chamamyungsu // Korean Brony
Guren is offline
Mitch
Junior Member
Join Date: Aug 2011
Old 11-26-2012 , 12:35   Re: How to make this darkness effect?
Reply With Quote #24

Quote:
Originally Posted by Guren View Post
no... it doesn't.

i tried test your plugin(source) but it's notthing happened.
thats odd, it worked fine for me when i use the sm_fogon command
Mitch is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-26-2012 , 17:00   Re: How to make this darkness effect?
Reply With Quote #25

Quote:
Originally Posted by Guren View Post
no... it doesn't.

i tried test your plugin(source) but it's notthing happened.
what map are you trying it on
Mitchell is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 11-26-2012 , 19:15   Re: How to make this darkness effect?
Reply With Quote #26

Quote:
Originally Posted by Guren View Post
no... it doesn't.

i tried test your plugin(source) but it's notthing happened.
Mitch's code is confirmed to work for me (TF2).
__________________
11530 is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 11-27-2012 , 03:30   Re: How to make this darkness effect?
Reply With Quote #27

Mitch's code is confirmed to work for me (CSS).
Despirator is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 11-27-2012 , 03:32   Re: How to make this darkness effect?
Reply With Quote #28

Quote:
Originally Posted by Guren View Post
no... it doesn't.

i tried test your plugin(source) but it's notthing happened.
did you enter sm_fogon in the console ?
Despirator is offline
Guren
Senior Member
Join Date: Feb 2011
Location: Equestria, Ponyville
Old 11-27-2012 , 05:57   Re: How to make this darkness effect?
Reply With Quote #29

Quote:
Originally Posted by Mitchell View Post
what map are you trying it on
umm..

i tried on dm_appleloosa_v7. it's user custom map.
__________________

Nick : Chamamyungsu // Korean Brony

Last edited by Guren; 11-27-2012 at 06:16.
Guren is offline
Guren
Senior Member
Join Date: Feb 2011
Location: Equestria, Ponyville
Old 11-27-2012 , 06:13   Re: How to make this darkness effect?
Reply With Quote #30

Quote:
Originally Posted by Despirator View Post
did you enter sm_fogon in the console ?

yes..

Code:
sm_fogon
Unknown command: sm_fogon
but it's not working. i definitely put the fog plugin in my server.

Code:
sm plugins 44
 "[TF2] Thirdperson" (2.1.0) by DarthNinja
 "[TF2] Model Manager" (1.0.2) by FlaminSarge (based on Damizean's TF2 Equipment Manager)
 "Twilight Sparkle Launcher" (1.0.1) by Chamamyungsu
 "Fog_test.smx" Fog_test.smx
 "TF2: Roll the Dice" (0.4.3.3) by linux_lover ([email protected])
 "Billy's Strengthen System plugin" (3.0.0) by NEF.K.Guren._. <CrystalRelease>


*i tried on pl_goldrush. it's perfectly worked. but it's not worked on other custom map.
__________________

Nick : Chamamyungsu // Korean Brony

Last edited by Guren; 11-27-2012 at 07:07. Reason: add
Guren 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 16:00.


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