Raised This Month: $51 Target: $400
 12% 

What are "life" and "decay rate" in write_byte?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 03-27-2022 , 16:10   What are "life" and "decay rate" in write_byte?
Reply With Quote #1

Hello. Can someone explain to me the meaning of the two lines marked in red?

Code:
write_byte(random(256)) // r
write_byte(random(256)) // g
write_byte(random(256)) // b
write_byte(3) // life
write_byte(3) // decay rate
message_end()
I tried changing the values, using different combinations, but i hardly see any difference in the way colors are being changed from one color to another. Basically, i don't understand what the two values are about.

The above code is about an object surrounded by an aura, blinking in 256 different colors.

How will increasing or decreasing the "life" value affects the way the aura is being changed from one color to another?

How will increasing or decreasing the "decay rate" value affect the way the aura is being changed from one color to another?

Thanks.
GlobalPlague is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-27-2022 , 16:31   Re: What are "life" and "decay rate" in write_byte?
Reply With Quote #2

Life = duration
Decay rate = how fast the effect is going to fade out

I suggest you take a look/use this instead - https://forums.alliedmods.net/showthread.php?t=310276
__________________

Last edited by OciXCrom; 03-27-2022 at 16:31.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply



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 03:29.


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