AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Keep fake lights there permanently (https://forums.alliedmods.net/showthread.php?t=55842)

mysticssjgoku4 05-31-2007 11:35

Keep fake lights there permanently
 
Here's the function I'm using for this:

Code:
public spawn_light(r,g,b,bright,radius,x,y,z) {     new origin[3]     origin[0] = x     origin[1] = y     origin[2] = z         message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin)         write_byte(TE_DLIGHT);     write_coord(x);     write_coord(y);     write_coord(z);     write_byte(radius);     write_byte(r);     write_byte(g);     write_byte(b);     write_byte(bright);     write_byte(0);         message_end(); }

Only problem, it doesn't stay very long. Any other things to to add/edit in order to keep it in a spot permanently? Thanks.

Cheap_Suit 05-31-2007 12:00

Re: Keep fake lights there permanently
 
PHP Code:

#define TE_DLIGHT                   27       // Dynamic light, effect world, minor entity effect
// write_byte(TE_DLIGHT)
// write_coord(position.x)
// write_coord(position.y)
// write_coord(position.z)
// write_byte(radius in 10's) 
// write_byte(red)
// write_byte(green)
// write_byte(blue)
// write_byte(life in 10's)
// write_byte(decay rate in 10's) 

Try changing the second last byte to (~0) or 9999999999. Anotherway, is having an entity and keep calling it.

pRED* 05-31-2007 17:08

Re: Keep fake lights there permanently
 
Couldn't you spawn an actual light entity? I havn't done mapping in ages but it's something like func_light..

mysticssjgoku4 05-31-2007 18:59

Re: Keep fake lights there permanently
 
Quote:

Originally Posted by pRED* | NZ (Post 484218)
Couldn't you spawn an actual light entity? I havn't done mapping in ages but it's something like func_light..

Tried that before, because I'm a mapper too, so that was the first thing I actually tried lol.

mysticssjgoku4 06-01-2007 19:18

Re: Keep fake lights there permanently
 
tried both, only lasts for 25 seconds. :S.
Any other ideas?

mysticssjgoku4 06-02-2007 01:44

Re: Keep fake lights there permanently
 
bump

pRED* 06-02-2007 03:06

Re: Keep fake lights there permanently
 
Do what Cheap_suit said..

Use the TE_DLIGHT to create a temporary light and then create an entity, set it's next think to 25 seconds, on nextthink create the TE_DLIGHT message again..

Theres a tutorial by hawk about using entities nextthink instead of setting a looping task..


All times are GMT -4. The time now is 10:33.

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