AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Add brightness in this message (https://forums.alliedmods.net/showthread.php?t=76041)

hleV 08-17-2008 09:28

Add brightness in this message
 
I'm using
PHP Code:

engfunc(EngFunc_LightStyle0"b"

And I want to make the view brighter in this message:
PHP Code:

message_begin(MSG_ONE98, {000}, id)
write_short(1<<0)
write_short(1<<0)
write_short(1<<2)
write_byte(128// Red
write_byte(0// Green
write_byte(32// Blue
write_byte(120)
message_end() 

Is it possible? Or I'll have to do it by some other way? If so, how?

BTW I took this message from Predator Mode.

Arkshine 08-17-2008 09:30

Re: Add brightness in this message
 
http://wiki.amxmodx.org/Half-Life_1_...nts#ScreenFade

Play with the last arg.

hleV 08-17-2008 10:12

Re: Add brightness in this message
 
Thanks. Seems like it's not what I wanted.

Can I change the brightness level for a single client?
PHP Code:

engfunc(EngFunc_LightStyle0"b"

This is for everyone.

BTW I'm doing this because NVGs are dropping fps to many players in my server. I need an alternative. The message seems to change the color of the screen but it's still hard to see in the dark.

danielkza 08-17-2008 10:20

Re: Add brightness in this message
 
Quote:

Originally Posted by hleV (Post 671066)
Thanks. Seems like it's not what I wanted.

Can I change the brightness level for a single client?
PHP Code:

engfunc(EngFunc_LightStyle0"b"

This is for everyone.

BTW I'm doing this because NVGs are dropping fps to many players in my server. I need an alternative.

Use an dynamic light,like this:
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(brightness)
// write_byte(life in 10's)
// write_byte(decay rate in 10's)

Use the player position as origin,a big radius, and set a repeating task according to the duration you specified. Lower task time = more responsive.

It 'll flicker a bit,don't worry about that.

hleV 08-17-2008 10:52

Re: Add brightness in this message
 
Quote:

Originally Posted by hleV (Post 671066)
NVGs are dropping fps to many players in my server. I need an alternative.

Custom NVG Colors plugin also drops fps.

danielkza 08-17-2008 11:08

Re: Add brightness in this message
 
Quote:

Originally Posted by hleV (Post 671082)
Custom NVG Colors plugin also drops fps.

I tested here and got exactly the same FPS as before. Or you have some really old machines or there's another problem.

hleV 08-17-2008 14:00

Re: Add brightness in this message
 
Quote:

Originally Posted by danielkza (Post 671090)
I tested here and got exactly the same FPS as before. Or you have some really old machines or there's another problem.

I believe normal NVG also doesn't drop your fps.
BTW using that I would need to set a task that is very frequent and can make some lag.

I believe there are other ways.

danielkza 08-17-2008 15:15

Re: Add brightness in this message
 
Quote:

Originally Posted by hleV (Post 671182)
I believe normal NVG also doesn't drop your fps.
BTW using that I would need to set a task that is very frequent and can make some lag.

I believe there are other ways.

Actually,normal NVG drops me 10-20 fps,but this method does not. And as far as I now, the task can be done in 0.2 - 0.5 sec, even more, wich is not much. Only a real world test will tell that.

hleV 08-17-2008 18:41

Re: Add brightness in this message
 
You can believe me or not but I've tried that way. Task 0.1 - nice, 0.2 or more - SUCKS!

BTW the fps is worse than with NVG (nothing - 100, NVG - 85, DLight - 50-60).

Any other ways to add brightness without losing fps?


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

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