Working Gate Help

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

Moderator: Core Staff

Post Reply
User avatar
XNevanderX
CJ Wannabe
CJ Wannabe
Posts: 14
Joined: August 5th, 2007, 6:32 pm
Location: North Carolina

Working Gate Help

Post by XNevanderX » September 9th, 2009, 9:17 pm

Hey! I'm currently trying to make a functioning gate in my jump map that works like these types of gates:

Image

The idea of the gate movement is illustrated in the attached pic.

Anyone know how to make it work?
You do not have the required permissions to view the files attached to this post.
Image

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

Re: Working Gate Help

Post by Drofder2004 » September 9th, 2009, 10:11 pm

Post your current code and explain what you have tried so far maybe?
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
XNevanderX
CJ Wannabe
CJ Wannabe
Posts: 14
Joined: August 5th, 2007, 6:32 pm
Location: North Carolina

Re: Working Gate Help

Post by XNevanderX » September 9th, 2009, 10:58 pm

So far this is what I have in the GSC. My friend wrote most of it but he can't seem to figure it out either. We've tried replacing rotateYaw with rotatePitch, which made it fly into the sky, now it just goes at a backwards angle.

main()
{
maps\mp\_load::main();

ambientPlay("NEV_FirstOneV2");

level.gate = "up";
getEnt( "gatetrig", "targetname" ) thread gate();

}

gate()
{
gate = getEnt( "gate", "targetname" );
self waittill( "trigger" );

if( level.gate == "up" )
{
gate rotateYaw( -90, 10 );
wait 10;
level.gate = "down";
}
else
{
gate rotateYaw( 90, 10 );
wait 10;
level.gate = "up";
}

wait 10;
self thread gate();
}
Image

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

Re: Working Gate Help

Post by Drofder2004 » September 10th, 2009, 12:26 am

KillerSam wrote:have you added an origin brush
That is all.

The most likely reason for the brush "spinning around the map", is because with no origin brush, the origin = 0,0,0, which is most likely what the brush is rotating around.
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
XNevanderX
CJ Wannabe
CJ Wannabe
Posts: 14
Joined: August 5th, 2007, 6:32 pm
Location: North Carolina

Re: Working Gate Help

Post by XNevanderX » September 10th, 2009, 8:17 pm

Well I had another friend work with it and this is what he ended up with in the script. He added what KS said to add but it's still not working. :(

main()
{
maps\mp\_load::main();

ambientPlay("NEV_FirstOneV2");

thread gate();

getEnt( "gatetrig", "targetname" ) thread gate();
}

gate()
{
trigger = getEnt ("gatetrig","targetname");

alm = getEnt ("nev_gate","targetname");
{
trigger waittill ("trigger");

alm rotateYaw(90, 1);

alm waittill ("movedone");
}

}
Image

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

Re: Working Gate Help

Post by Drofder2004 » September 10th, 2009, 10:05 pm

Bad KS!

Code: Select all

main()
{
   maps\mp\_load::main();
   ambientPlay("NEV_FirstOneV2");

   getEnt( "gatetrig", "targetname" ) thread gate();
}

gate()
{
   alm = getEnt ("nev_gate","targetname");
   while(1)
   {
      self waittill ("trigger");

      alm rotateYaw(90, 1);
      alm waittill ("rotatedone");
      wait 10;
      alm rotateYaw(-90, 1);
   }
}
OR!

Code: Select all

main()
{
   maps\mp\_load::main();
   ambientPlay("NEV_FirstOneV2");

   getEnt( "gatetrig", "targetname" ) thread gate();
}

gate()
{
   alm = getEnt ("nev_gate","targetname");

   self waittill ("trigger");
   alm rotateYaw(90, 1);
}
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
XNevanderX
CJ Wannabe
CJ Wannabe
Posts: 14
Joined: August 5th, 2007, 6:32 pm
Location: North Carolina

Re: Working Gate Help

Post by XNevanderX » September 10th, 2009, 10:44 pm

Ok I've had my friend work on it for a while and here's what he's got. It only goes down then it won't go back up, so I'm missing one piece somewhere. Note I have two gates now.

Code: Select all

main()
{
maps\mp\_load::main();
thread gate();
thread gate2();
}

gate()
{
trigger = getent ("gatetrig","targetname");
alm = getent ("nev_gate","targetname");
while(1)
{
trigger	waittill ("trigger");
alm rotatepitch(90, 1);
alm waittill ("movedone");
trigger	waittill ("trigger");
alm rotatepitch(-90, 1);
alm waittill ("movedone");
}
}

gate2()
{
trigger = getent ("gatetrig2","targetname");
alm2 = getent ("nev_gate2","targetname");
while(1)
{
trigger	waittill ("trigger");
alm2 rotatepitch(-90, 1);
alm2 waittill ("movedone");
trigger	waittill ("trigger");
alm2 rotatepitch(90, 1);
alm2 waittill ("movedone");
}
}
Image

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

Re: Working Gate Help

Post by Drofder2004 » September 10th, 2009, 10:52 pm

Go look at my first code. That should work fine.
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
XNevanderX
CJ Wannabe
CJ Wannabe
Posts: 14
Joined: August 5th, 2007, 6:32 pm
Location: North Carolina

Re: Working Gate Help

Post by XNevanderX » September 10th, 2009, 11:56 pm

Ok guys, finally got it to work up and down. It works perfectly, now I'm just cleaning up around it so that it fits smoothly and all. My friend cool helped me with pretty much all of it, using information posted here by you guys. Thanks so much, now I can get this map done! :D

In case you were wondering, the final script looks like this:

Code: Select all

main()
{
	maps\mp\_load::main();
	
	ambientPlay("NEV_FirstOneV2");
	
	getEnt( "gatetrig", "targetname" ) thread gate();
	getEnt( "gatetrig2", "targetname" ) thread gate2();
}

gate()
{
	gate = getEnt( "nev_gate", "targetname" );
	
	while( 1 )
	{
		self waittill( "trigger" );
		gate rotatepitch( 90, 1 );
		gate waittill( "rotatedone" );
		self waittill( "trigger" );
		gate rotatepitch( -90, 1 );
		gate waittill( "rotatedone" );
	}
}

gate2()
{
	gate = getEnt( "nev_gate2", "targetname");
	
	while( 1 )
	{
		self waittill( "trigger" );
		gate rotatepitch( -90, 1 );
		gate waittill( "rotatedone" );
		self waittill( "trigger" );
		gate rotatepitch( 90, 1 );
		gate waittill( "rotatedone" );
	}
}

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests