[clarified] Flashlight efficiency
How would be best... to use a TE_DLIGHT in prethink and update it's origin... or to make an entity that has the EF_DIMLIGHT effect and just update it-s origin... don't know how would that look but I'll do it if it's better than the TE_DLIGHT ... I'm talking about lag issues, all players will be using flashlights and I need the most efficiency I can get :}
|
Re: Flashlight efficiency
The 2nd way with a acceptable think delay should be ok.
I may update my flashlight plugin with this method one of those day (i would have to hook addtofullpack to let the "not visible by other players" option, good idea. I actually use prethink : http://forums.alliedmods.net/showthread.php?p=633031 |
Re: Flashlight efficiency
Yes I know, I searched for that plugin to get the distance codes... but in time I learned more and I just replaced all those xs stuff with get_distance() :lol: ... you should do that too :P
Well thanks for input, I'll try the 2nd and see what I can get xD edit: ... well, big downside, can't set size (wich is pretty BIG for a flashlight), can't set color (wich I don't even care 'cause it's white but w/e :lol: ) ... aand you must set a model or something for the effect to work... :} so I think I'll stick with the message one :lol: made some shots: http://img9.**************/img9/1273/dedust20083.jpg http://img7.**************/img7/4435/dedust20084.jpg |
Re: Flashlight efficiency
In last version of my plugin is don't use xs anymore (still include, my bad, but has no impact on plugin as all xs are stocks).
Well, you can stay with tempents method, but instead of prethink, make a thinking ent (1 to handle all players), may be make it think every 0.1 or 0.05, and set the tempent life in consequence. |
Re: Flashlight efficiency
hmm, would be better to use a "global thinking" entity that updates all player's data like flashlight, battery, regeneration, etc ?
also, I was wondering... is while() faster than for() ? :? |
Re: Flashlight efficiency
Probably while but I don't think the *slight* difference in speed does matter.
|
Re: Flashlight efficiency
Somebody, who knows c++ and pascal very well, told me that for is slighty slower than while if you use is with small values or something like that, i dont' remember very well. But i agree with arkshine.
|
Re: Flashlight efficiency
I'd use "while" instead of "for" as long as it's possible in the case.
|
| All times are GMT -4. The time now is 01:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.