Raised This Month: $ Target: $400
 0% 

Light an area (How to ?)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-09-2007 , 16:43   Light an area (How to ?)
Reply With Quote #1

Hi,

Is it possible to light a closed area (like a room) during a certain time, like for 30 seconds, or waiting some one switch of this light ?
ConnorMcLeod is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 06-09-2007 , 17:35   Re: Light an area (How to ?)
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?go=func&id=371
i.e.:
for pitchblack:
Code:
set_lights("a");

for as bright as you can get it:
Code:
seta_lights("z");

to return to normal:
Code:
set_lights("#OFF");
have fun

FYI:
Code:
#include <engine>
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 06-09-2007 at 17:39.
Rolnaaba is offline
Old 06-09-2007, 17:38
Rolnaaba
This message has been deleted by Rolnaaba.
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 06-09-2007 , 17:40   Re: Light an area (How to ?)
Reply With Quote #3

@rolnaaba: set_lights() is for the whole map ;)

Code:
spawn_light(origin[3])
{
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY, origin) 
    write_byte(TE_DLIGHT);// 27
    write_coord(origin[0]);  // x
    write_coord(origin[1]);  // y
    write_coord(origin[2]);  // z
    write_byte(100); // radius in 10's
    write_byte(255); // r
    write_byte(255); // g
    write_byte(255); // b
    write_byte(8);    // life in 10's
    write_byte(60);  // decay rate in 10's
    message_end();
}
Just set the origin where the light should be...and maybe the color and radius...don't ask me what decay is..0o

greetz regalis
__________________
regalis is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 06-10-2007 , 09:37   Re: Light an area (How to ?)
Reply With Quote #4

Please note I don't understand the measurements, or how to correctly set the life for 30 seconds but you will see that decay affects how fast the light withdraws over its lifespan, i.e "shrinking".
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 06-10-2007 , 10:49   Re: Light an area (How to ?)
Reply With Quote #5

I know set_lights is for whole map, thought thats what he wanted O.o but I was wrong
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
ShTaM
Junior Member
Join Date: Jun 2007
Old 06-10-2007 , 11:34   Re: Light an area (How to ?)
Reply With Quote #6

But how to let during 30 secondes and get a very nice light ?
ShTaM is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 06-10-2007 , 12:24   Re: Light an area (How to ?)
Reply With Quote #7

I Think this:
Code:
write_byte(8);     // life in 10's
means the light stays 8/10 seconds...

Now use this
Code:
write_byte(10);    // life in 10's
and do a set_task(1.0, ....)
and the task should repeat 30 times..0o
Maybe add a second dlight at the half time to prevent flickering..
It should then pulse or something...
Or maybe adjust the "decay" thingy ;)

greetz regalis
__________________
regalis is offline
ShTaM
Junior Member
Join Date: Jun 2007
Old 06-10-2007 , 13:54   Re: Light an area (How to ?)
Reply With Quote #8

Code:
 
public Light()
{
 message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
 write_byte(27);
 write_coord(0);
 write_coord(0); // y
 write_coord(0); // z
 write_byte(50); // radius
 write_byte(255); // red
 write_byte(255); // green
 write_byte(255); // blue
 write_byte(10); // life in 10's
 write_byte(30); // decay rate in 10's
 message_end();
 if ( AddLum < 500 )
 {
  AddLum++
  set_task(0.01,"Light")
 }
 else if ( AddLum == 500 )
 {
  AddLum = 0
 }
}
I can't get a constant light, it's boring .
ShTaM is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 06-10-2007 , 14:21   Re: Light an area (How to ?)
Reply With Quote #9

Quote:
Originally Posted by ShTaM View Post
Code:
 
public Light()
{
 message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
 write_byte(27);
 write_coord(0);
 write_coord(0); // y
 write_coord(0); // z
 write_byte(50); // radius
 write_byte(255); // red
 write_byte(255); // green
 write_byte(255); // blue
 write_byte(10); // life in 10's
 write_byte(30); // decay rate in 10's
 message_end();
 if ( AddLum < 500 )
 {
  AddLum++
  set_task(0.01,"Light")
 }
 else if ( AddLum == 500 )
 {
  AddLum = 0
 }
}
I can't get a constant light, it's boring .
Do you set the origin of the light?
This is a local dynamic light not for the whole map...
You have to set a specific location for this ;)
If you want to set the light for the whole map use what rolnaaba postet (set_lights() )...
Btw.: This --> set_task(0.01,"Light") will be set_task(0.1,"Light")
Shorter periods than 0.1 aren't supported..
But that seems ok...

greetz regalis
__________________
regalis is offline
mogel
Senior Member
Join Date: Jan 2007
Old 06-10-2007 , 14:46   Re: Light an area (How to ?)
Reply With Quote #10

Hi,

Quote:
Originally Posted by ShTaM View Post
I can't get a constant light, it's boring .
no possible with TE_DLIGHT ... max. constant view ist 25.5 seconds (life -> 255) ... the timing (hl1-engine problem?) is very bad to start a 2nd TE_DLIGHT on the same position without jitter

hand, mogel
__________________
mogel is offline
Reply


Thread Tools
Display Modes

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:35.


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