Page 1 of 1
script runtime error
Posted: April 14th, 2006, 10:26 pm
by Luke
I get a runtime error after about 4 minutes of playing on my map since i added some new threads:
Code: Select all
car1()
{
car1 = getent ("car1","targetname");
org1 = (2904, -3842, 0);
while (1)
{
car1 moveto (org1 + (0, 8000,0), 10);
car1 waittill ("movedone");
car1 hide();
car1 moveto (org1 + (0, 0,0), 1);
car1 waittill ("movedone");
car1 show();
thread car1();
}
}
car2()
{
car2 = getent ("car2","targetname");
org2 = (2686, 4416, 0);
while (1)
{
car2 moveto (org2 + (0, -8000,0), 10);
car2 waittill ("movedone");
car2 hide();
car2 moveto (org2 + (0, 0,0), 1);
car2 waittill ("movedone");
car2 show();
thread car2();
}
}
It says
exceeded maximum number of script variables: @ 61066
called from:
@ 61119
I put the script together myself, so its probably not the best way of doing it
Any suggestions please?
Posted: April 15th, 2006, 1:07 am
by Luke
DOH...It was because of the last lines in the threads: thread car1(); thread car2(); ....don't know why i put them there but its ok now

Posted: April 15th, 2006, 1:12 am
by Nightmare
lol luke, I cant belive I didnt see that

Posted: April 17th, 2006, 8:13 pm
by Drofder2004
Luke wrote:DOH...It was because of the last lines in the threads: thread car1(); thread car2(); ....don't know why i put them there but its ok now

Remember, aslong as you "thread" the thread then you dont need to recall it (otherwise, you will have multiple of the same thread running.
Posted: April 17th, 2006, 8:33 pm
by Luke
Ok thanks..theres something else i'd like to know if i can do. is there a way to make it so the cars don't need to travel back in order to go again? and how do you disable a trigger multiple? i know you can use the delete command, but it can't be used again that way can it?
Posted: April 17th, 2006, 8:43 pm
by Drofder2004
Luke wrote:Ok thanks..theres something else i'd like to know if i can do. is there a way to make it so the cars don't need to travel back in order to go again? and how do you disable a trigger multiple? i know you can use the delete command, but it can't be used again that way can it?
Code: Select all
trigger = getent("trigger","targetname");
trigger maps\mp\trigger::triggerOff();
wait 10;
trigger maps\mp\trigger::triggerOn();
And to stop the "car" going back to the start, you need to either use the MoveX/Y/Z or you can change the origin after each movement. (Explain it a little more in detail, as by the looks of your script, you are telling the car to go back to its origin).
Posted: April 17th, 2006, 9:35 pm
by Luke
Well i want the cars to kill you when they go past(which they do) but not when they go back(as hidden)
Script updated:
Code: Select all
motor1()
{
motor1 = getent ("motor1","targetname");
motor1_clip = getent ("motor1_clip","targetname");
org1 = (2904, -3842, 0);
while (1)
{
motor1 moveto (org1 + (0, 8000,0), 5);
motor1_clip moveto (org1 + (0, 8000,0), 5);
motor1 waittill ("movedone");
motor1 hide();
motor1_clip notsolid();
motor1 moveto (org1 + (0, 0,0), 1);
motor1_clip moveto (org1 + (0, 0,0), 0.1);
motor1 waittill ("movedone");
motor1 show();
motor1_clip solid();
}
}
motor1_kill()
{
motor1_clip = getent ("motor1_clip","targetname");
death_trig1 = getent ("death_trig1","targetname");
while (1)
{
death_trig1 waittill ("trigger",user);
if (user istouching(motor1_clip))
{
user suicide();
wait 1;
}
}
}
Posted: April 17th, 2006, 10:24 pm
by Drofder2004
Why not move the car under the ground before you move it

Posted: April 17th, 2006, 10:52 pm
by Luke
Yeah i guess i could do that but wasn't sure if there was another option..that will work tho
Posted: April 18th, 2006, 11:05 am
by Luke
KillerSam wrote:i may have this totally wrong but....rotate a car when it gets to the end then have it come back....looks like 2 way traffic.
Yes, thought of that and its pobably the best way..there is more than 1 lane and several cars, i'll have to just make it rotate at the end, and move into the correct lane

Posted: April 18th, 2006, 7:30 pm
by Nightmare
so what your doing it making people jump from car to car to get across?

Posted: April 18th, 2006, 7:35 pm
by Drofder2004
Nightmare wrote:so what your doing it making people jump from car to car to get across?

I imagine this is a giant game of Frogger, but I do not know, and do not care until the release

Posted: April 18th, 2006, 7:40 pm
by Nightmare
Sounds like fun, can't wait to try it. Dont forget the logs if you are really making a frogger level

Posted: April 18th, 2006, 8:12 pm
by Luke
haha not a bad idea actually, but frogger never entered my head
