Script Runtime Error....

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Script Runtime Error....

Post by Soviet » October 27th, 2006, 12:33 am

Image

any ideas as to what it is?....

btw, here's my .gsc

Code: Select all

main()
{
maps\mp\_load::main();
thread gear1();
thread gear2();
thread gear3();
thread gear4();
thread gear5();
thread gear6();
thread gear7();
thread gear8();
thread axle1();
thread axle2();
thread axle3();
thread axle4();
thread axle5();
thread axle6();
thread axle7();
thread axle8();
thread pillar1();
thread platform1();
thread rotation1();

}

gear1() 
{ 
gear1 = getent("gear1","targetname");  
while (1) 
{ 

gear1 rotateyaw(-360, 10);

gear1 waittill("rotatedone");
} 
}

gear2() 
{ 
gear2 = getent("gear2","targetname");  
while (1) 
{ 

gear2 rotateroll(-360, 10);

gear2 waittill("rotatedone");
} 
}

gear3() 
{ 
gear3 = getent("gear3","targetname");  
while (1) 
{ 

gear3 rotateyaw(360, 10);

gear3 waittill("rotatedone");
} 
}

gear4() 
{ 
gear4 = getent("gear4","targetname");  
while (1) 
{ 

gear4 rotateroll(-360, 10);

gear4 waittill("rotatedone");
} 
}

gear5() 
{ 
gear5 = getent("gear5","targetname");  
while (1) 
{ 

gear5 rotateroll(360, 10);

gear5 waittill("rotatedone");
} 
}

gear6() 
{ 
gear6 = getent("gear6","targetname");  
while (1) 
{ 

gear6 rotateroll(360, 10);

gear6 waittill("rotatedone");
} 
}

gear7() 
{ 
gear7 = getent("gear7","targetname");  
while (1) 
{ 

gear7 rotateroll(360, 10);

gear7 waittill("rotatedone");
} 
}

gear8() 
{ 
gear8 = getent("gear8","targetname");  
while (1) 
{ 

gear8 rotateroll(360, 10);

gear8 waittill("rotatedone");
} 
}

////////////////////////////////////AXLES/////////////////////////////////////////////

axle1() 
{ 
axle1 = getent("axle1","targetname");  
while (1) 
{ 

axle1 rotateyaw(-360, 10);
axle1 waittill("rotatedone");
} 
}

axle2() 
{ 
axle2 = getent("axle2","targetname");  
while (1) 
{ 

axle2 rotateroll(-360, 10);
axle2 waittill("rotatedone");
} 
}

axle3() 
{ 
axle3 = getent("axle3","targetname");  
while (1) 
{ 

axle3 rotateyaw(360, 10);
axle3 waittill("rotatedone");
} 
}

axle4() 
{ 
axle4 = getent("axle4","targetname");  
while (1) 
{ 

axle4 rotateroll(-360, 10);
axle4 waittill("rotatedone");
} 
}

axle5() 
{ 
axle5 = getent("axle5","targetname");  
while (1) 
{ 

axle5 rotateroll(360, 10);
axle5 waittill("rotatedone");
} 
}

axle6() 
{ 
axle6 = getent("axle6","targetname");  
while (1) 
{ 

axle6 rotateroll(360, 10);
axle6 waittill("rotatedone");
} 
}

axle7() 
{ 
axle7 = getent("axle7","targetname");  
while (1) 
{ 

axle7 rotateroll(360, 10);
axle7 waittill("rotatedone");
} 
}

axle8() 
{ 
axle8 = getent("axle8","targetname");  
while (1) 
{ 

axle8 rotateroll(360, 10);
axle8 waittill("rotatedone");
} 
}

////////////////////////////////////////PILLARS//////////////////////////////////////////

pillar1()
{
platform = getent ("pillar1","targetname");
while(1)
{
platform moveZ (400,2,.3,.3);
platform waittill ("movedone");
wait(2);
platform moveZ (-400,2,.3,.3);
platform waittill ("movedone");
wait(2);
}
}

//////////////////////////////////PLATFORMS////////////////////////////////////////

platform1()
{
platform = getent ("platform1","targetname");
while(1)
{
platform moveX (-910,3,.3,.3);
platform waittill ("movedone");
wait (.5);
platform moveX (910,3,.3,.3);
platform waittill ("movedone");
wait (.5);
}
}

///////////////////////////////////////ROTATIONS/////////////////////////////////////////

rotation1() 
{ 
rotation1 = getent("rotation1","targetname");  
while (1) 
{ 
rotation1 rotateroll(-90, 4);
rotation1 waittill("rotatedone");
wait (1);
rotation1 rotateroll(90, 4);
rotation1 waittill("rotatedone");
wait (3);
} 
}

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » October 27th, 2006, 1:40 pm

I think I could puke looking at that code :P

Lets start off with the error before I complain a little more and explain some other things I have explained before... ;)

Ok, read the error...

"undefined is not an entity".

This says, 'something' is not an entity.
The error is caused by "axle5".

So, the error is because axle5 - is not an entity. Basically axle5 does not exist.

Now, let me push on to something called "arrays". Described in many posts and examples are everywhere, arrays are used to removed repetitive actions.

Ok, first off your gears, 8 threads to do 2 actions.
4 gears move clockwise, 4 gear anticlockwise.

You axles, the same, 2 actions yet 8 threads.

So to remove 16 thread and replace them with 5...

Code: Select all

main()
{
   thread start();
}

start()
{
   gearcw = getentarray("gearcw","targetname");
   gearacw = getentarray("gearacw","targetname");
   axlecw = getentarray("axlecw","targetname");
   axleacw = getentarray("acleacw","targetname");

   for(i=0;i<gearcw.size;i++)
   {
      gearcw[i] thread _gear_cw();
   }

   for(i=0;i<gearacw.size;i++)
   {
      gearacw[i] thread _gear_acw();
   }

   for(i=0;i<axlecw.size;i++)
   {
      axlecw[i] thread _axle_cw();
   }

   for(i=0;i<gearcw.size;i++)
   {
      axleacw[i] thread _axle_acw();
   }
}

_gear_cw()
{
while (1)
{
   self rotateyaw(360, 10);
   self waittill("rotatedone");
} 
}

_gear_acw()
{
while (1)
{
   self rotateyaw(-360, 10);
   self waittill("rotatedone");
} 
}

_axle_cw()
{
while (1)
{
   self rotateroll(360, 10);
   self waittill("rotatedone");
} 
}

_axle_acw()
{
while (1)
{
   self rotateroll(-360, 10);
   self waittill("rotatedone");
} 
}
To get this to work, you will need to give all the gears and axles the correct targetname...

gearcw
gearacw
axlecw
axleacw
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 27th, 2006, 2:34 pm

k, thanks droffy, ill fix up my script to your extremely high standards when i get the chance :P

User avatar
[SoE]_Zaitsev
Core Staff
Core Staff
Posts: 14220
Joined: October 21st, 2004, 7:17 pm
Location: Holland
Contact:

Post by [SoE]_Zaitsev » October 27th, 2006, 2:56 pm

I'm such a noob compared to all the scripting and mapping (I'd like to map someday though :P), but I always find it awesome how Drofder can answer any questions about scripting (Again, I havbe no clue what's going on but still).

Very cool, it's not something that you learn in 1 day.
matt101harris wrote:big cock was the first thing that came to my head lol

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 27th, 2006, 11:54 pm

i did exactly as you said and renamed all my gears, but they dont move. Theres not an error, even in dev mode.

(the map runs)

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 28th, 2006, 12:05 am

nvm drofder, i got it working. But to say it kindly, your script is fucked up :P

all of the gears and axles are turning incorrectly. Im not just talking the wrong way, im saying they aren't turning on their origin properly.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » October 28th, 2006, 2:02 am

Soviet wrote:nvm drofder, i got it working. But to say it kindly, your script is fucked up :P

all of the gears and axles are turning incorrectly. Im not just talking the wrong way, im saying they aren't turning on their origin properly.
They would work correctly if it were my map ;)
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 28th, 2006, 8:11 am

useless...

teebag
CJ Spammer!
CJ Spammer!
Posts: 548
Joined: August 7th, 2006, 7:11 pm

Post by teebag » October 28th, 2006, 2:12 pm

Drofder is the next Albert Einstein I mean wtf :|
That's why my brother's computer doesn't need anti-virus software; 450MHz P3 doesn't meet virus's system requirements.

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 28th, 2006, 5:40 pm

maybe, but hes supposed to respond with some witty answer to my problem or at least ask for more information, and instead he says that they would work correctly if they were on his map...no shit :P

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » October 28th, 2006, 11:50 pm

Wait drof, if they were in arrays, wouldn't all of the chosen axels become as one and spin around in the middle?
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » October 29th, 2006, 4:46 am

Nightmare wrote:Wait drof, if they were in arrays, wouldn't all of the chosen axels become as one and spin around in the middle?
Ofcourse they would, but I covered that in my script...
To get this to work, you will need to give all the gears and axles the correct targetname...

gearcw
gearacw
axlecw
axleacw
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests