Raised This Month: $ Target: $400
 0% 

Getting light entities in a map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MousePad
Junior Member
Join Date: Apr 2012
Old 04-28-2013 , 06:51   Re: Getting light entities in a map
Reply With Quote #1

Yes Arkshine. Changing their light style would be the best. But if it's the harder/longer way, removing them should be fine too. All I want is getting rid of flickering lights. Thanks a lot for looking into it! I attached the map. You'll see 2 candles at spawn.
Attached Files
File Type: zip bkz_ancient.zip (1.61 MB, 77 views)
MousePad is offline
MousePad
Junior Member
Join Date: Apr 2012
Old 04-28-2013 , 19:28   Re: Getting light entities in a map
Reply With Quote #2

This brings me new hopes:

PHP Code:
#include <amxmodx> 
#include <fakemeta> 
#include <engine> 

public plugin_precache() 
{     
        
register_forwardFM_Spawn"Forward_Spawn" ); 


public 
Forward_SpawniEnt 
{        
        static 
szName32 ];         
        
peviEntpev_classnameszNamecharsmaxszName ) );         
        if( 
equali(szName"light"))
        {       
                
set_peviEntpev_spawnflags1)
                
DispatchKeyValueiEnt"targetname""shack" );
                
DispatchKeyValueiEnt"pattern""amamamamamamamamamamam" )
        }

cs_militia has many lights connected to switches. One of the switch's target is "shack". When I test this plugin on cs_militia, all the lights start turned off because of the spawnflags being 1. And when I press E on the switch, all the lights turn on and flicker with the pattern amamam... Without this plugin they all start on and their style is normal. But when I test this on bkz_ancient, the lights act like the same before(Flicker B). So obviously these lights with switches have some data written to them when the maps get loaded and we're missing some piece(s). I'm going to try to output every single data these lights have and see what the differences are with lights which are not designed to have a targetname in the first place.

I tried these additions to Forward_Spawn:
PHP Code:
DispatchKeyValueiEnt"style""0")
DispatchKeyValueiEnt"style""32")
DispatchKeyValueiEnt"style""63"
Any of these additions caused the light to be always on with constant illumination and the switch stopped working. Then I looked at cs_militia with hammer and saw that style was set to 33. When I tried this addition:
PHP Code:
DispatchKeyValueiEnt"style""33"
The light started off and blinked amamam... when turned on. From lights.cpp I can't see any difference between 32 and 33. This is weird...

Last edited by MousePad; 04-28-2013 at 19:48.
MousePad 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 10:47.


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