Working Gate Help
Moderator: Core Staff
-
- CJ Wannabe
- Posts: 14
- Joined: August 5th, 2007, 6:32 pm
- Location: North Carolina
Working Gate Help
Hey! I'm currently trying to make a functioning gate in my jump map that works like these types of gates:
The idea of the gate movement is illustrated in the attached pic.
Anyone know how to make it work?
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.
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Working Gate Help
Post your current code and explain what you have tried so far maybe?
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
-
- CJ Wannabe
- Posts: 14
- Joined: August 5th, 2007, 6:32 pm
- Location: North Carolina
Re: Working Gate Help
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();
}
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();
}
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Working Gate Help
That is all.KillerSam wrote:have you added an origin brush
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.
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
-
- CJ Wannabe
- Posts: 14
- Joined: August 5th, 2007, 6:32 pm
- Location: North Carolina
Re: Working Gate Help
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");
}
}
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");
}
}
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Working Gate Help
Bad KS!
OR!
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);
}
}
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);
}
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
-
- CJ Wannabe
- Posts: 14
- Joined: August 5th, 2007, 6:32 pm
- Location: North Carolina
Re: Working Gate Help
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");
}
}
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Working Gate Help
Go look at my first code. That should work fine.
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
-
- CJ Wannabe
- Posts: 14
- Joined: August 5th, 2007, 6:32 pm
- Location: North Carolina
Re: Working Gate Help
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!
In case you were wondering, the final script looks like this:
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" );
}
}
Who is online
Users browsing this forum: No registered users and 30 guests