Jump to content
MakeWebGames

Recommended Posts

Posted

I have made a mod. this is my first big mod i have made.

i am pleased with the result and no errors or bugs are present.

but every time i try to load the page it times out and takes like 3 minutes to load and then i get this error

 

Fatal error: Maximum execution time of 120 seconds exceeded in *directory removed for privacy* on line 116

 

i'm not sure how to get to the bottom of this problem.

is the code just to long or complex? because it contains about 7+ "for" loops and plenty of arrays.

Posted

Re: Problem With My Mod :S Somone Please Help

i really didn't think i would get that problem the whole file is only 300 lines. mostly loops and arrays.

im guessing its just not going to work then lol

Posted

Re: Problem With My Mod :S Somone Please Help

doesn't matter how many lines it is, if you use

 

for ($i = 0; $i < 1000000000; $i++) {
echo $i;
}

 

It's gonna be slow, if you wanna disable the time limit, put set_time_limit(0); at the top of the script to make it run until its done

Posted

Re: Problem With My Mod :S Somone Please Help

ok, i guess theres nothing i can do then.

no point in the mod without the loops lol

pfft would have been better to know this when i started

Posted

Re: Problem With My Mod :S Somone Please Help

Theres also a chance that you've somehow made an error in the code making it stuck in a certain loop forever (infinite loop) and thus passing the maximum execution time, although this is less likely to happen with for loops than with while loops.

Quick example of an infinite loop:

while(1==1)
{
$i++;
}

or

for($i=1;$i<50;$i=1) { //do whatever }
Posted

Re: Problem With My Mod :S Somone Please Help

so

 

for($i=1;$i<50;$i=1) { //do whatever }

 

that could be my problem? because i have loops like this

Posted

Re: Problem With My Mod :S Somone Please Help

Yeah, that'll loop forever

It resets to one on each loop,so it'll always be less than 50

Use firefox, it'll automatically end the page if it detects that it's looping forever (i think)

Posted

Re: Problem With My Mod :S Somone Please Help

i do use FF :\

and thanks for the post DBS lol.

Pfft i want this mod to work baddd. my first mod and i cant get it working. not going to continue making them if this ones fucked lol

Posted

Re: Problem With My Mod :S Somone Please Help

Here is an example of a loop in my code

 

for ($i = 1; $i <= 6; $i++)

 

this causing the problem?

Posted

Re: Problem With My Mod :S Somone Please Help

I know this probably a bit ughh, but why don't you post your code so we can see. Its a big hard to find the problem with something you cant see. Considering your planning on giving up on it if you cant get it to work I don't see a problem with that.

Posted

Re: Problem With My Mod :S Somone Please Help

that is true, let me work on it a little more and if i cant get it to work ill post it for everyone to have a go at fixing. and let people add itto their game for free

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...