This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[TUT] Modules and efficient scripting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-29-2009 , 11:15   Re: [TUT] Modules and efficient scripting
Reply With Quote #1

Quote:
Originally Posted by joaquimandrade View Post
But it hooks spawn and it uses task. As i said in there is better. I never need to mess with models but, if someday i do, i will surely modify his code.

Basically:

It hooks spawns. That's an error. Then it uses tasks to protect problems coming from changing the models in spawn. Hooking instead the join team event you will not need task. You won't have 32 players changing the team at the same time.
I know, you don't need to explain, this is your situation or any other good coders situation. There are some problems that will be fixed on that tutorial. If a scripter needs it he will modify the code. It depends on experience at first, if a scripter is a beginner he can't be able to see all weak spots of a code. That is a thing which everyone will learn with time.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-29-2009 , 11:24   Re: [TUT] Modules and efficient scripting
Reply With Quote #2

Quote:
Originally Posted by ot_207 View Post
I know, you don't need to explain, this is your situation or any other good coders situation. There are some problems that will be fixed on that tutorial. If a scripter needs it he will modify the code. It depends on experience at first, if a scripter is a beginner he can't be able to see all weak spots of a code. That is a thing which everyone will learn with time.
The thing is: despite the fact that his code make things better it also does things wrong. It is re-setting models on spawn so, in a 32 slots full server, when a round begins it is re-setting 32 models (despite the fact that it is not needed). And because of that it also has tasks to prevent problems that can arise from these simultaneous re-sets. So, it's not only the efficient that it can be as it also can still let problems happen. By hooking team join event you would never re-set 32 models at the same time.

So basically what am i saying?
Changing its code like i said is not a trivial optimization but, for me, a obligatory one.
__________________

Last edited by joaquimandrade; 03-29-2009 at 13:14.
joaquimandrade 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 03:37.


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