Call of Duty 4: Teleporter: Difference between revisions

From COD Modding & Mapping Wiki
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 33: Line 33:




<pre>
<syntaxhighlight>
main()
main()
{
{
entTransporter = getentarray( "enter", "targetname" );
entTransporter = getentarray( "enter", "targetname" );
if(isdefined(entTransporter))
if(isdefined(entTransporter))
{
for( i = 0; i < entTransporter.size; i++ )
for( i = 0; i < entTransporter.size; i++ )
entTransporter[i] thread transporter();
entTransporter[i] thread transporter();
}
}
}


transporter()
transporter()
{
{
while(true)
for(;;)
{
{
self waittill( "trigger", player );
self waittill( "trigger", player );
Line 56: Line 53:
wait 0.1;
wait 0.1;
}
}
}</pre>
}
</syntaxhighlight>





Latest revision as of 23:21, 22 February 2012

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

By Col.Mac

How to make a player teleport.

In the editor, go to your departure point, draw out a decent size brush and texture it trigger, right click in 2d view, go down and make it trigger_multiple. with the trigger still selected press n and enter these values

Key = target Value = gohere 
Key = targetname Value = enter 

Press n again to close the entity box, thats it for the trigger, press Esc.

Navigate your way in the editor to where you want to be teleported to. Right click in the 2d view and create a script_origin (a red cube should appear) With that still selected, press n and enter these values Key = targetname Value = gohere Press n again to close the entity box You can rotate the red cube until the arrow faces the direction you wish to be facing when teleported. have both selected and hit w to weld them Press esc.

If you have things correct you should now see a red line connecting trigger and red cube.

Compile,

Make a .gsc containing this script (just call it teleport)


main()
{
	entTransporter = getentarray( "enter", "targetname" );
	if(isdefined(entTransporter))
		for( i = 0; i < entTransporter.size; i++ )
			entTransporter[i] thread transporter();
}

transporter()
{
	for(;;)
	{
		self waittill( "trigger", player );
		entTarget = getEnt( self.target, "targetname" );
		wait 0.1;
		player setOrigin( entTarget.origin );
		player setplayerangles( entTarget.angles );
		wait 0.1;
	}
}


Dont forget to call up this .gsc in your main .gsc

maps\mp\_teleport::main(); 

For your Zone File:

rawfile,maps/mp/_teleport.gsc

Greets dadofazz / Kill3r (who found it via azz.. who found it via unknown sources)

I Have added some Videos to Help: <videoflash>gavmdAkmv1c</videoflash>


<videoflash>FTsmPuHVazY</videoflash>

(Videos Added by Zebb)