Talk:L4D Glow Effect

From Valve Developer Community
Revision as of 13:25, 31 December 2009 by Killermonkey (talk | contribs)

Jump to: navigation, search

Hello i need help getting the entities to register themselves with the effect. I'm trying to make a npc_metrocop glow. Help would be much appreciated.


First you should implement the screenspace effect as in the tutorial. Then add these lines of code the the Spawn() function of the npc_metrocop if you want the effect to be active during the entire life of the npc:

CEntGlowEffect *pGlowEffect = (CEntGlowEffect*)g_pScreenSpaceEffects->GetScreenSpaceEffect("ge_entglow");
pGlowEffect->RegisterEnt( this, Color(255, 255, 255, 100) );

Make sure you #include "ge_screeneffects.h" in the npc_metrocop cpp file so that you can properly find the glow effect. --killermonkey 03:07, 16 December 2009 (UTC)


Thanks for responding. First, I wan't the effect to be toggled on and off. So how would i implement this with the npc? I could place it in hl2_player.cpp, but then how would i register it with the npc? Last of all, in the section "Once the effect is enabled, we still have to get entities to register themselves with the effect so that they are drawn with it on. Since we are using the effect to highlight gameplay tokens I will show a method to active the effect from the server using Server/Client sendtable:" This won't be necessary anymore if i'm just registering it from the npc, correct? --Error3972 20:21, 17 December 2009 (UTC)


As a test i tried what you suggested. When i compiled my the metrocop i got these errors:
 1>Compiling...
1>cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
1>npc_metropolice.cpp
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(40) : error C2061: syntax error : identifier 'IMatRenderContext'
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(41) : error C2061: syntax error : identifier 'IMatRenderContext'
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(53) : error C2146: syntax error : missing ';' before identifier 'm_GlowBuff1'
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(53) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(53) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(54) : error C2146: syntax error : missing ';' before identifier 'm_GlowBuff2'
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(54) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(54) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(56) : error C2146: syntax error : missing ';' before identifier 'm_WhiteMaterial'
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(56) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(56) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(57) : error C2146: syntax error : missing ';' before identifier 'm_EffectMaterial'
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(57) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(57) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(59) : error C2146: syntax error : missing ';' before identifier 'm_BlurX'
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(59) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(59) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(60) : error C2146: syntax error : missing ';' before identifier 'm_BlurY'
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(60) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\Darkness\E2-Work\src\game\server\ge_screeneffects.h(60) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

This doesn't happen when ge_screeneffects.h is in client, Just in server. Any help? --Error3972 21:30, 17 December 2009 (UTC)


Sorry for the delay in answering. The effect is CLIENT SIDE ONLY. None of these rendering functions exist on the server. That is why you have to use the server/client send table or some other server message to the client in order to activate the effect from the server.

For your npc, you have many options. Following my tutorial for server/client network table will work fine. killermonkey 13:24, 31 December 2009 (UTC)