[HELP] Beam Follow
I have a message in a think function which is creating a trail when the player holds certain buttons, but the problem is sometimes there are drawn too many sprites at the same time, resulting in low fps
Is there any way I can limit the number of sprites drawn at once per player excluding reducing their life to 1? I want to create a flame like trail :) PHP Code:
|
Re: [HELP] Beam Follow
Quote:
or 2. Something like this PHP Code:
3. (And probably the best one) Using get_gametime() and creating the trail every 0.1/0.2s |
Re: [HELP] Beam Follow
Using a boolean would be much more efficient
Set the bool to true when "certain button" is pressed And to false when the button is released |
Re: [HELP] Beam Follow
the problem is not when he is not holding the button, be when he is holding it for a little bit longer, it will spam too many sprties...
About the beam counter, I was thinking for it, but I have no idea yet when or how to decrease it, since the life of the sprites I don't think it is in seconds.. Btw how do you kill the beam exactly? |
Re: [HELP] Beam Follow
check the trails plugin: https://forums.alliedmods.net/showth...64803?p=164803
|
Re: [HELP] Beam Follow
Quote:
1. Send the beam for 0.4s (third WRITE_BYTE(4)) 2. Set Float:NextBeam = get_gametime() + 0.3; //Dont make it 0.4 here as "clipping" effect may occur 3. if get_gametime() >= NextBeam -> Goto 1. The beam is a temp entity - I think you cannot kill it. Its automatically killed from the engine. Read here Have in mind that those "seconds" are engine seconds (since map start) and their tick can differ from real time seconds (just to know). |
Re: [HELP] Beam Follow
Quote:
Quote:
Quote:
|
| All times are GMT -4. The time now is 09:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.