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

[clarified] Flashlight efficiency


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-07-2009 , 15:42   [clarified] Flashlight efficiency
Reply With Quote #1

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 :}
__________________
Hunter-Digital is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-07-2009 , 17:00   Re: Flashlight efficiency
Reply With Quote #2

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
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-07-2009 , 20:02   Re: Flashlight efficiency
Reply With Quote #3

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() ... you should do that too

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 ) ... aand you must set a model or something for the effect to work... :} so I think I'll stick with the message one

made some shots:
http://img9.**************/img9/1273/dedust20083.jpg
http://img7.**************/img7/4435/dedust20084.jpg
__________________

Last edited by Hunter-Digital; 05-07-2009 at 20:22.
Hunter-Digital is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-08-2009 , 03:41   Re: Flashlight efficiency
Reply With Quote #4

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.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-08-2009 , 04:08   Re: Flashlight efficiency
Reply With Quote #5

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() ?
__________________
Hunter-Digital is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-08-2009 , 04:14   Re: Flashlight efficiency
Reply With Quote #6

Probably while but I don't think the *slight* difference in speed does matter.
Arkshine is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 05-09-2009 , 08:05   Re: Flashlight efficiency
Reply With Quote #7

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.
__________________

anakin_cstrike is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-09-2009 , 08:51   Re: Flashlight efficiency
Reply With Quote #8

I'd use "while" instead of "for" as long as it's possible in the case.
__________________
hleV is offline
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 16:32.


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