Call of Duty 4: Moving Brushes: Difference between revisions

From COD Modding & Mapping Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Call of Duty 4]]
[[Category:Call of Duty 4]]
[[Category:Modtools]]
[[Category:Radiant]]
[[Category:Advanced Editing]]
[[Category:Scripting]]
[[Category:Scripting]]
{{warning_forpro}}
{{warning_forpro}}
Line 5: Line 8:
[[Image:Nutshell.png]] These script are to be used in conjunction with proper Targetname on brushes in Radiant. They are not standalone  -- just for reference.
[[Image:Nutshell.png]] These script are to be used in conjunction with proper Targetname on brushes in Radiant. They are not standalone  -- just for reference.


<font color=green>==Draglift Door==</font>
==Draglift Door==


<pre>main()  
<syntaxhighlight>
main()  
{  
{  
thread diaglift_slider ();  
thread diaglift_slider ();  
}  
}  


diaglift_slider()  
diaglift_slider()  
{  
{  
diaglift=getent("diaglift","targetname");  
diaglift=getent( "diaglift", "targetname" );  
wait (5);  
wait 5;  
while(1)  
{  
while(true)  
//trig waittill ("trigger");  
{  
diaglift moveto ((104,-125,124),6,2,2);  
//trig waittill ("trigger");  
diaglift waittill ("movedone");  
diaglift moveto ((104,-125,124),6,2,2);  
wait (5);  
diaglift waittill ("movedone");  
//trig waittill ("trigger");  
wait (5);  
diaglift moveto ((-35,-125,204),6,2,2);  
//trig waittill ("trigger");  
diaglift waittill ("movedone");  
diaglift moveto ((-35,-125,204),6,2,2);  
wait (5);  
diaglift waittill ("movedone");  
}  
wait (5);  
} </pre>  
}
 
}
</syntaxhighlight>


<font color=green>==Draw bridge==</font>
==Draw bridge==  


<pre>main()  
<syntaxhighlight>
main()  
{  
{  
thread drawbridge_open ();  
thread drawbridge_open ();  
}  
}  


drawbridge_open()  
drawbridge_open()  
{  
{  
drawbridge=getent("drawbridge","targetname");  
drawbridge = getent( "drawbridge", "targetname" );  
trig=getent("lower_bridge","targetname");  
trig = getent( "lower_bridge", "targetname" );  
while(1)  
while(true)  
{  
{  
trig waittill ("trigger");  
trig waittill ("trigger");  
drawbridge rotateto( (-90,0,0),6);  
drawbridge rotateto( (-90,0,0),6);  
drawbridge waittill ("rotatedone");  
drawbridge waittill ("rotatedone");  
wait (3);  
wait 3;  
trig waittill ("trigger");  
trig waittill ("trigger");  
drawbridge rotateto( (0,0,0),6);  
drawbridge rotateto( (0,0,0),6);  
drawbridge waittill ("rotatedone");  
drawbridge waittill ("rotatedone");  
}  
}  
} </pre>  
}
</syntaxhighlight>


==Lift Pad==


<font color=green>==Lift Pad==</font>
<syntaxhighlight>
 
main()  
<pre>main()  
{  
{  
thread liftpad_slider ();  
thread liftpad_slider ();  
}  
}  


liftpad_slider()  
liftpad_slider()  
{  
{  
liftpad=getent("liftpad","targetname");  
liftpad = getent( "liftpad", "targetname" );  
trig=getent("lift_trigger","targetname");  
trig = getent( "lift_trigger", "targetname" );
while(1)  
{  
while(true)  
trig waittill ("trigger");  
{
//wait (4);  
trig waittill ("trigger");  
liftpad movez (106,5,0,0.6);  
//wait 4;  
liftpad waittill ("movedone");  
liftpad movez (106,5,0,0.6);  
wait (4);  
liftpad waittill ("movedone");  
//trig waittill ("trigger");  
wait 4;  
liftpad movez(-106,4,0,0.6);  
//trig waittill ("trigger");  
liftpad waittill ("movedone");  
liftpad movez(-106,4,0,0.6);  
liftpad waittill ("movedone");  
}
}
</syntaxhighlight>


}
==Roller Door==
} </pre>


<font color=green>==Roller Door==</font>  
<syntaxhighlight>
 
main()  
<pre>main()  
{  
{  
thread door_slider ();  
thread door_slider ();  
}  
}  


door_slider()  
door_slider()  
{  
{  
door=getent("door","targetname");  
door = getent( "door", "targetname" );  
trig=getent("openthedoor","targetname");  
trig = getent( "doortrig", "targetname" );  
while(1)  
{  
while(true)  
trig waittill ("trigger");  
{  
//wait (4);  
trig waittill ( "trigger" );  
door movez (94,5,0,0.6);  
//wait 4;  
door waittill ("movedone");  
door movez ( 94, 5, 0, 0.6 );  
wait (4);  
door waittill ( "movedone" );  
//trig waittill ("trigger");  
wait 4;  
door movez(-94,4,0,0.6);  
//trig waittill ("trigger");  
door waittill ("movedone");  
door movez( -94, 4, 0, 0.6 );  
 
door waittill ( "movedone" );  
}  
}
} </pre>  
}
</syntaxhighlight>


<font color=green>==Slide Door==</font>
==Slide Door==  


<pre>main()  
<syntaxhighlight>
main()  
{  
{  
thread slidedoor_slider ();  
thread slidedoor_slider ();  
}  
}  


slidedoor_slider()  
slidedoor_slider()  
{  
{  
slidedoor=getent("slidedoor","targetname");  
slidedoor = getent( "slidedoor", "targetname" );  
trig=getent("slideopen","targetname");  
trig     = getent( "slidetrig", "targetname" );  
while(1)  
{  
while(true)  
trig waittill ("trigger");  
{  
//wait (4);  
trig waittill ("trigger");  
slidedoor movey (-64,2,0.5,0.5);  
//wait 4;  
slidedoor waittill ("movedone");  
slidedoor movey ( -64, 2, 0.5, 0.5);  
wait (4);  
slidedoor waittill ("movedone");  
//trig waittill ("trigger");  
wait 4;  
slidedoor movey(64,2,0.5,0.5);  
//trig waittill ("trigger");  
slidedoor waittill ("movedone");  
slidedoor movey( 64, 2, 0.5, 0.5);  
 
slidedoor waittill ("movedone");  
}  
}
} </pre>  
}
</syntaxhighlight>


<font color=green>==Train door==</font>
==Train door==


<pre>main()  
<syntaxhighlight>
main()  
{  
{  
thread train_slider ();  
thread train_slider ();  
}  
}  


train_slider()  
train_slider()  
{  
{  
train=getent("train","targetname");  
train = getent( "train", "targetname");  
trig=getent("start_train","targetname");  
trig = getent( "traintrig", "targetname");  
while(1)  
{  
while(true)  
trig waittill ("trigger");  
{  
//wait (4);  
trig waittill ("trigger");  
train movex (-464,8,0.3,0.3);  
//wait 4;  
train waittill ("movedone");  
train movex ( -464, 8, 0.3, 0.3);  
wait (4);  
train waittill ("movedone");  
//trig waittill ("trigger");  
wait 4;  
train movex(464,8,0.3,0.3);  
//trig waittill ("trigger");  
train waittill ("movedone");  
train movex( 464, 8, 0.3, 0.3);  
train waittill ("movedone");  
}
}
</syntaxhighlight>


}
==Train door 2==
} </pre>


<font color=green>==Train door 2==</font>
<syntaxhighlight>
 
main()  
<pre>main()  
{  
{  
 
thread traindoor_traindoor ();  
thread traindoor_traindoor ();  
}  
}  


traindoor_traindoor()  
traindoor_traindoor()  
{  
{  
door=getent("traindoor","targetname");  
door = getent( "traindoor", "targetname" );  
wait (20);  
// wait 20;
trig=getent("traindoor_trigger","targetname");  
trig = getent( "traindoortrig", "targetname" );  
while(1)  
{  
while(true)  
trig waittill ("trigger");  
{  
door movey (2,1,0.5,0.5);  
trig waittill ("trigger");  
door waittill ("movedone");  
door moveY ( 2, 1, 0.5, 0.5 );  
wait (1);  
door waittill ("movedone");
door movex (-50,4,1,1);  
door waittill ("movedone");  
wait 1;  
wait (4);  
door moveX ( -50, 4, 1, 1 );  
door movex (50,4,1,1);  
door waittill ("movedone");  
door waittill ("movedone");  
wait (1);  
wait 4;  
door movey (-2,1,0.5,0.5);  
door moveX ( 50, 4, 1, 1 );  
door waittill ("movedone");  
door waittill ("movedone");
}  
} </pre>  
wait 1;  
door moveY ( -2, 1, 0.5, 0.5 );  
door waittill ("movedone");  
}  
}
</syntaxhighlight>


<font color=green>==Trap Door==</font>
==Trap Door==


<pre>main()  
<syntaxhighlight>
main()  
{  
{  
thread trapdoor_droptrapdoor ();  
thread trapdoor();  
}  
}  


trapdoor_droptrapdoor()  
trapdoor()  
{  
{  
trapdoor=getent("trapdoor","targetname");  
trapdoor = getent( "trapdoor", "targetname" );  
trig=getent("droptrapdoor","targetname");  
trig     = getent( "trapdoortrig", "targetname" );  
while(1)  
{  
while(true)  
trig waittill ("trigger");  
{  
trapdoor rotateto( (0,0,-90),0.3);  
trig waittill ("trigger");  
trapdoor waittill ("rotatedone");  
trapdoor rotateto( ( 0, 0, -90 ), 0.3);  
wait (3);  
trapdoor waittill ("rotatedone");  
trapdoor rotateto( (0,0,0),1.7);  
trapdoor waittill ("rotatedone");  
wait 3;  
}  
trapdoor rotateto( ( 0, 0, 0 ), 1.7);  
} </pre>  
trapdoor waittill ("rotatedone");  
}  
}
</syntaxhighlight>


==Sources==
==Sources==


[http://itoeunited.net/forum/viewtopic.php?t=1235 Here]
[http://itoeunited.net/forum/viewtopic.php?t=1235 Broken Link]
[http://www.xfire.com/profile/rasmuswennerstrom Fixz]

Latest revision as of 15:14, 16 December 2010

This tutorial assumes that you already know how to create, compile & create GSCs,CSVs & FastFiles for your maps

These script are to be used in conjunction with proper Targetname on brushes in Radiant. They are not standalone -- just for reference.

Draglift Door

main() 
{ 
	thread diaglift_slider (); 
} 

diaglift_slider() 
{ 
	diaglift=getent( "diaglift", "targetname" ); 
	wait 5; 
	
	while(true) 
	{ 
		//trig waittill ("trigger"); 
		diaglift moveto ((104,-125,124),6,2,2); 
		diaglift waittill ("movedone"); 
		wait (5); 
		//trig waittill ("trigger"); 
		diaglift moveto ((-35,-125,204),6,2,2); 
		diaglift waittill ("movedone"); 
		wait (5); 
	}
}

Draw bridge

main() 
{ 
	thread drawbridge_open (); 
} 

drawbridge_open() 
{ 
	drawbridge = getent( "drawbridge", "targetname" ); 
	trig = getent( "lower_bridge", "targetname" ); 
	
while(true) 
{ 
	trig waittill ("trigger"); 
	drawbridge rotateto( (-90,0,0),6); 
	drawbridge waittill ("rotatedone"); 
	wait 3; 
	trig waittill ("trigger"); 
	drawbridge rotateto( (0,0,0),6); 
	drawbridge waittill ("rotatedone"); 
	} 
}

Lift Pad

main() 
{ 
	thread liftpad_slider (); 
} 

liftpad_slider() 
{ 
	liftpad = getent( "liftpad", "targetname" ); 
	trig = getent( "lift_trigger", "targetname" );
	
	while(true) 
	{
		trig waittill ("trigger"); 
		//wait 4; 
		liftpad movez (106,5,0,0.6); 
		liftpad waittill ("movedone"); 
		wait 4; 
		//trig waittill ("trigger"); 
		liftpad movez(-106,4,0,0.6); 
		liftpad waittill ("movedone"); 
	} 
}

Roller Door

main() 
{ 
	thread door_slider (); 
} 

door_slider() 
{ 
	door = getent( "door", "targetname" ); 
	trig = getent( "doortrig", "targetname" ); 
	
	while(true) 
	{ 
		trig waittill ( "trigger" ); 
		//wait 4; 
		door movez ( 94, 5, 0, 0.6 ); 
		door waittill ( "movedone" ); 
		wait 4; 
		//trig waittill ("trigger"); 
		door movez( -94, 4, 0, 0.6 ); 
		door waittill ( "movedone" ); 
	} 
}

Slide Door

main() 
{ 
	thread slidedoor_slider (); 
} 

slidedoor_slider() 
{ 
	slidedoor = getent( "slidedoor", "targetname" ); 
	trig      = getent( "slidetrig", "targetname" ); 
	
	while(true) 
	{ 
		trig waittill ("trigger"); 
		//wait 4; 
		slidedoor movey ( -64, 2, 0.5, 0.5); 
		slidedoor waittill ("movedone"); 
		wait 4; 
		//trig waittill ("trigger"); 
		slidedoor movey( 64, 2, 0.5, 0.5); 
		slidedoor waittill ("movedone"); 
	} 
}

Train door

main() 
{ 
	thread train_slider (); 
} 

train_slider() 
{ 
	train = getent( "train", "targetname"); 
	trig  = getent( "traintrig", "targetname"); 
	
	while(true) 
	{ 
		trig waittill ("trigger"); 
		//wait 4; 
		train movex ( -464, 8, 0.3, 0.3); 
		train waittill ("movedone"); 
		wait 4; 
		//trig waittill ("trigger"); 
		train movex( 464, 8, 0.3, 0.3); 
		train waittill ("movedone"); 
	} 
}

Train door 2

main() 
{ 
	thread traindoor_traindoor (); 
} 

traindoor_traindoor() 
{ 
	door = getent( "traindoor", "targetname" ); 
	// wait 20;
	trig = getent( "traindoortrig", "targetname" ); 
	
	while(true) 
	{ 
		trig waittill ("trigger"); 
		door moveY ( 2, 1, 0.5, 0.5 ); 
		door waittill ("movedone");
		
		wait 1; 
		door moveX ( -50, 4, 1, 1 ); 
		door waittill ("movedone"); 
		
		wait 4; 
		door moveX ( 50, 4, 1, 1 ); 
		door waittill ("movedone");
		
		wait 1; 
		door moveY ( -2, 1, 0.5, 0.5 ); 
		door waittill ("movedone"); 
	} 
}

Trap Door

main() 
{ 
	thread trapdoor(); 
} 

trapdoor() 
{ 
	trapdoor = getent( "trapdoor", "targetname" ); 
	trig     = getent( "trapdoortrig", "targetname" ); 
	
	while(true) 
	{ 
		trig waittill ("trigger"); 
		trapdoor rotateto( ( 0, 0, -90 ), 0.3); 
		trapdoor waittill ("rotatedone"); 
		
		wait 3; 
		trapdoor rotateto( ( 0, 0, 0 ), 1.7); 
		trapdoor waittill ("rotatedone"); 
	} 
}

Sources

Broken Link Fixz