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

[L4D2] Alpha decay?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
Old 01-26-2023 , 15:18   [L4D2] Alpha decay?
Reply With Quote #1

I'm trying to create a function in which the entity gradually disappears through the alpha, but it's not working.

If anyone can help me I'll be grateful

script is below
Script
__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire
Youtube

Last edited by King_OXO; 01-26-2023 at 15:19.
King_OXO is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 01-26-2023 , 16:05   Re: [L4D2] Alpha decay?
Reply With Quote #2

PHP Code:
SetEntityRenderMode(entityRENDER_TRANSCOLOR);
SetEntityRenderColor(entity255,255,25550); //50 is alpha 
__________________

Last edited by HarryPotter; 01-26-2023 at 16:05.
HarryPotter is offline
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
Old 01-27-2023 , 18:36   Re: [L4D2] Alpha decay?
Reply With Quote #3

Quote:
Originally Posted by HarryPotter View Post
PHP Code:
SetEntityRenderMode(entityRENDER_TRANSCOLOR);
SetEntityRenderColor(entity255,255,25550); //50 is alpha 
doesn't work, I'm trying to do alpha fadeout on env_smokestack
__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire
Youtube
King_OXO is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-27-2023 , 20:31   Re: [L4D2] Alpha decay?
Reply With Quote #4

need more info, we don't even know which entity classname are you using, you mentioned env_smokestack, but without more code is just a guess
and you code btw you are reseting the alpha everytime to "0" in the else clause, and I hope is just a snippet code, otherwise [2000] array is not enough, sometimes the (network) entities created may be between 1~2048 in L4D2
__________________

Last edited by Marttt; 01-27-2023 at 20:32.
Marttt is offline
Paimon
Member
Join Date: Jul 2021
Location: Zootopia
Old 06-01-2023 , 05:15   Re: [L4D2] Alpha decay?
Reply With Quote #5

I'm not sure it will work.
In your code
PHP Code:
if(Alpha[entity] >= 255Alpha[entity] = 255;
else 
Alpha[entity] = 0
has an logic error(if your purpose is what I guess...). It will make alpha array always be 0 or 255. And if you didn't give the initial value as 255, it will always be 0.
So the value you input to entity will always be (255 - 0).
Paimon 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 04:19.


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