AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   real time light entities (https://forums.alliedmods.net/showthread.php?t=312426)

CrazY. 12-02-2018 19:24

real time light entities
 
Hello, it's possible to create lighting entities (light, light_spot, etc) with create_entity instead of TE_DLIGHT message?

I don't found enough informations about these entities in hlsdk.

raizo11 12-03-2018 01:05

Re: real time light entities
 
Code:

stock bool:createSquare(Float:vAngles[3],Float:vOrigin[3])
{
          ent = create_entity( "info_target" );
       
          if (is_valid_ent(ent))
          {
                entity_set_string( ent , EV_SZ_classname, "square");
                entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
                      entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE);
                      entity_set_model(ent, SQUARE);
                entity_set_size( ent , Float:{ -80.0, -90.0, 0.0 }, Float:{ 80.0, 90.0, 10.0 } );
                entity_set_vector(ent, EV_VEC_angles, vAngles);
                entity_set_int(ent, EV_INT_fixangle , 1 );
                      entity_set_origin(ent, vOrigin);

                message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
                write_byte(TE_DLIGHT) // 27
                write_coord(floatround(vOrigin[0])) // x
                write_coord(floatround(vOrigin[1])) // y
                write_coord(floatround(vOrigin[2])) // z
                write_byte(50) // radius
                write_byte(50) // Red
                write_byte(255) // Green
                write_byte(255) // Blue
                write_byte(255) // life
                write_byte(60) // decay rate
                message_end()
          }

}


CrazY. 12-03-2018 06:55

Re: real time light entities
 
Without te_dlight and tempentity.

E1_531G 12-03-2018 07:36

Re: real time light entities
 
AFAIK, GoldSource doesn't support dynamic light, that means, "light" or "light_spot" entities created after map's compilation won't have any effect. But i didn't try.

Did you try? Try also with cs_create_entity("light").

CrazY. 12-07-2018 11:14

Re: real time light entities
 
Yes, only dynamic lights work in "real time". I Will leave thread open, case someone manage to do that and want to share.

DarthMan 12-11-2018 11:04

Re: real time light entities
 
Quote:

Originally Posted by CrazY. (Post 2627286)
Yes, only dynamic lights work in "real time". I Will leave thread open, case someone manage to do that and want to share.

I remember seeing a server with permanent lights. I am not sure how it worked, but the lights would never ever dissapear, you know, when you're using the de_dlight message to make lights and use a task to repeat the process, there is a little bit of lag so the lights are off for like 0.5 secs or whatever then they appear again. However, on that server, which is a TFC server, they would never dissapear. Still, I'm quite sure it's still the tempentity message, because, there is no other way to add lights after map completly loaded.

Neeeeeeeeeel.- 12-11-2018 12:52

Re: real time light entities
 
Quote:

Originally Posted by DarthMan (Post 2628344)
I remember seeing a server with permanent lights. I am not sure how it worked, but the lights would never ever dissapear, you know, when you're using the de_dlight message to make lights and use a task to repeat the process, there is a little bit of lag so the lights are off for like 0.5 secs or whatever then they appear again. However, on that server, which is a TFC server, they would never dissapear. Still, I'm quite sure it's still the tempentity message, because, there is no other way to add lights after map completly loaded.

Maybe 2 lights in the same point with different EOL times.

DarthMan 12-11-2018 16:27

Re: real time light entities
 
Quote:

Originally Posted by Neeeeeeeeeel.- (Post 2628358)
Maybe 2 lights in the same point with different EOL times.

Maybe, I don't know.

wilianmaique 05-18-2019 22:23

Re: real time light entities
 
does anyone know a good method?

<VeCo> 05-18-2019 22:34

Re: real time light entities
 
no, light is baked into the bsp


All times are GMT -4. The time now is 12:11.

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