script runtime error

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

Moderator: Core Staff

Post Reply
Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

script runtime error

Post by Luke » April 14th, 2006, 10:26 pm

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 :P

Any suggestions please?

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » April 15th, 2006, 1:07 am

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 :oops:

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

Post by Nightmare » April 15th, 2006, 1:12 am

lol luke, I cant belive I didnt see that :shock:
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 » April 17th, 2006, 8:13 pm

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 :oops:
Remember, aslong as you "thread" the thread then you dont need to recall it (otherwise, you will have multiple of the same thread running.
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

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » April 17th, 2006, 8:33 pm

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?

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

Post by Drofder2004 » April 17th, 2006, 8:43 pm

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).
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

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » April 17th, 2006, 9:35 pm

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;
	}
}
}

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

Post by Drofder2004 » April 17th, 2006, 10:24 pm

Why not move the car under the ground before you move it ;)
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

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » April 17th, 2006, 10:52 pm

Yeah i guess i could do that but wasn't sure if there was another option..that will work tho

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » April 18th, 2006, 11:05 am

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 :P

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

Post by Nightmare » April 18th, 2006, 7:30 pm

so what your doing it making people jump from car to car to get across? :P
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 » April 18th, 2006, 7:35 pm

Nightmare wrote:so what your doing it making people jump from car to car to get across? :P
I imagine this is a giant game of Frogger, but I do not know, and do not care until the release :)
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
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » April 18th, 2006, 7:40 pm

Sounds like fun, can't wait to try it. Dont forget the logs if you are really making a frogger level :wink:
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]

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » April 18th, 2006, 8:12 pm

haha not a bad idea actually, but frogger never entered my head :P

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests