Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 104 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
Author Topic: Weird Lags With a Script
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Apr. 14, 2011 12:53 pm
Some one deleted my new post, so I ask again here...

I'm having the same problem. When my server is full (64/64) it laggs. My server hoster says, the server is only using 4%, so he thinks the mod is wrongly coded with open threads and so on.

Is there a way to measure a script performance or to prove that it's a mod problem?

Please help!
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Thursday, Apr. 14, 2011 03:58 pm
You can't really profile the scripts but you can always try to improve it by cutting down on loops or loop iteration times (longer waits in loops).
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Apr. 14, 2011 04:34 pm
I though the lag can come because of open threads, but you say it can also come if the waiting time of the loops is too small?
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Thursday, Apr. 14, 2011 04:46 pm
yh sure
imagine:

a while(1) loop with wait 0.01;

will proof it 100 times in a second

if you have maybe 10 of them it will be 1000 in still 1 second

and the you have 64/64 players, result 64000 times in, yes, still only 1 second
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Apr. 14, 2011 04:51 pm
Lol okay..

So how much time to wait do you advise me for loops?

I think I use in some 0.001, but not for each player. Could this be a problem?
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Thursday, Apr. 14, 2011 05:12 pm
Yes :o.

It depends on what the loop does, but as a baseline, net updates are only 20fps which comes out as wait 0.05;
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Thursday, Apr. 14, 2011 05:13 pm
asaik 0.001 does not work
i would take 0.01 as minimum
(i read that it is caused by the 20 fps server but not sure)

i visited your server often and i guess you have a afk script in it

for example you can do there
while(1)
wait 10
if oldps = self.origin
afktime++
if afktime = 10

i think there you do not need a waittime with under 1

but for your killingspree you can use 0.1 - 0.01 should be okay this way

maybe try some settings and do the waittimes the way it will still working/looking good

but i dont think that your mod causes many of the laggs
it is a sweet normal modded one, cant imagine that few scripts will cause this laggs

i visited a hungarian extrem modded server and there were also not this many laggs in it

EDIT: =D
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Apr. 14, 2011 05:23 pm
Nice that you visit the server :)

Do you notice lag in it? I do a lot when it's full...

I'm going to run a map in TDM, then I should see if it's a mod question or what ever.

Could the lag also be produced not by scripts? E.g. a very high detailed blood modification or any menu or what ever?

Thanks for the replays!
Share |
cresuso
General Member
Since: Aug 29, 2009
Posts: 51
Last: Apr 14, 2011
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Thursday, Apr. 14, 2011 05:46 pm
I gave up with this script.....because of the lags. And some noob russians stole my script months ago, now lot of zom servers on cod2 copied it....these bunch of tards.

And i guess ur using my script probably..

Anyway, i didnt find any solution for that lag problem. I tried everything.
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Apr. 14, 2011 05:56 pm
You shouldn't guess so quickly. I didn't either use Paulus's zombie mod, I did my own mod, appart from some awe scripts for helmetpopping and killing spree :).
Share |
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»