Page 1 of 1
Script Runtime Error....
Posted: October 27th, 2006, 12:33 am
by Soviet
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);
}
}
Posted: October 27th, 2006, 1:40 pm
by Drofder2004
I think I could puke looking at that code
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
Posted: October 27th, 2006, 2:34 pm
by Soviet
k, thanks droffy, ill fix up my script to your extremely high standards when i get the chance

Posted: October 27th, 2006, 2:56 pm
by [SoE]_Zaitsev
I'm such a noob compared to all the scripting and mapping (I'd like to map someday though

), 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.
Posted: October 27th, 2006, 11:54 pm
by Soviet
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)
Posted: October 28th, 2006, 12:05 am
by Soviet
nvm drofder, i got it working. But to say it kindly, your script is fucked up
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.
Posted: October 28th, 2006, 2:02 am
by Drofder2004
Soviet wrote:nvm drofder, i got it working. But to say it kindly, your script is fucked up
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

Posted: October 28th, 2006, 8:11 am
by Soviet
useless...
Posted: October 28th, 2006, 2:12 pm
by teebag
Drofder is the next Albert Einstein I mean wtf

Posted: October 28th, 2006, 5:40 pm
by Soviet
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

Posted: October 28th, 2006, 11:50 pm
by Nightmare
Wait drof, if they were in arrays, wouldn't all of the chosen axels become as one and spin around in the middle?
Posted: October 29th, 2006, 4:46 am
by Drofder2004
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