AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [L4D2] Alpha decay? (https://forums.alliedmods.net/showthread.php?t=341495)

King_OXO 01-26-2023 15:18

[L4D2] Alpha decay?
 
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

HarryPotter 01-26-2023 16:05

Re: [L4D2] Alpha decay?
 
PHP Code:

SetEntityRenderMode(entityRENDER_TRANSCOLOR);
SetEntityRenderColor(entity255,255,25550); //50 is alpha 


King_OXO 01-27-2023 18:36

Re: [L4D2] Alpha decay?
 
Quote:

Originally Posted by HarryPotter (Post 2798041)
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

Marttt 01-27-2023 20:31

Re: [L4D2] Alpha decay?
 
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

Paimon 06-01-2023 05:15

Re: [L4D2] Alpha decay?
 
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).


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

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