AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Create light entity (https://forums.alliedmods.net/showthread.php?t=135055)

Emp0wer 08-12-2010 04:23

Create light entity
 
Is that possible to create light entity? I was trying but to result. P.s In my cases messages can't be used.

lazarev 08-12-2010 04:46

Re: Create light entity
 
https://forums.alliedmods.net/showth...97#post1104097 yo

Emp0wer 08-12-2010 09:53

Re: Create light entity
 
Quote:

Originally Posted by lazarev (Post 1268683)

It send this every time on thinking, that makes my player really lagy if there are a lot of lights in the map, I knew about TE_DLIGHT but I want something that should not be updated every time, and could be attached to player, like a light enitity.
PHP Code:

        message_begin(MSG_BROADCASTSVC_TEMPENTITY);
        
write_byte(TE_DLIGHT);
        
engfunc(EngFunc_WriteCoordvOrigin[0]);
        
engfunc(EngFunc_WriteCoordvOrigin[1]);
        
engfunc(EngFunc_WriteCoordvOrigin[2]);
        
write_byte(iRadius);        // radius in 10's
        
write_byte(iR);        // R
        
write_byte(iG);        // G
        
write_byte(iB);        // B
        
write_byte(3);      // life
        
write_byte(0);        // decay rate
        
message_end(); 


ot_207 08-12-2010 11:13

Re: Create light entity
 
You can reduce the frequency of the think and set the life of the SVC_TEMPENTITY to 20 for example.

Emp0wer 08-12-2010 14:56

Re: Create light entity
 
Quote:

Originally Posted by ot_207 (Post 1268923)
You can reduce the frequency of the think and set the life of the SVC_TEMPENTITY to 20 for example.

20 is 2 secodns, my aura is moving with player, so it will be always 2 sec. behind him (

Hunter-Digital 08-12-2010 18:40

Re: Create light entity
 
Well then use lower values, use 0.1 for think and use life 5 and decay 1 or something.
You could also use this:

Code:

entity_set_int(ent, EV_INT_effects, EF_BRIGHTLIGHT)
But AFAIK you can't customize it's color, range, etc.

Emp0wer 08-12-2010 20:02

Re: Create light entity
 
Quote:

Originally Posted by Hunter-Digital (Post 1269178)
Well then use lower values, use 0.1 for think and use life 5 and decay 1 or something.
You could also use this:

Code:

entity_set_int(ent, EV_INT_effects, EF_BRIGHTLIGHT)
But AFAIK you can't customize it's color, range, etc.

Thx, But I need a red aura.


All times are GMT -4. The time now is 21:58.

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