Page 1 of 1

Adding Script to Secret

Posted: April 12th, 2010, 1:33 pm
by BatterY
Title is confusing but i couldn't think of anything else.
So, i'm making a secret that has a glass cube which will take you there(see nm_unlocked for example how i want it to be.
I'm planning this: secret is other side of gap, which is almost full of hurt triggers (except where the cube goes, so it's highly secure) When you enter correct code, the cube will come to you and one side of it opens as a door, you go in, and it takes you to secret.
Code what i've come up

Code: Select all

blablabla, the code part of it
if code correct:

cube movex 200, 3; // cube moves to you, takes 3 seconds
cube waittill ("movedone"); //wait for cube to move
cubedoor1 movez -120, 2; // door opens, takes 2 seconds
cubedoor1 waittill ("movedone"); // wait for door to open
wait 5;
cubedoor1 movez 120, 2; // door closes, takes 2 seconds
cubedoor1 waittill ("movedone"); // wait for door to close
cube movex -200, 3 // cube moves to secret, takes 3 seconds
cube waittill ("movedone") // you know at this part what this does
cubedoor2 movez -120, 3 // other, opposite of the cube is another door, which will open
cubedoor2 waittill ("movedone")
cubedoor2 movez 120, 3 // door closes
but can the doors be "part" of the cube at the same time theyre brushmodels?
PS Adding some screenshots and code what i might come up later

Re: Adding Script to Secret

Posted: April 12th, 2010, 7:30 pm
by Rezil
They can't be part of the cube, atleast not as one brushmodel. You can move them at the same time however:

Code: Select all

cube movex(-200, 3);
cube_door movex(-200, 3);
cube_door waittill("movedone");
This will move the doors and the cube at the same time 200 units along the x axis in 3 seconds.

Re: Adding Script to Secret

Posted: April 12th, 2010, 7:34 pm
by BatterY
I've got it working on my own, without doors and hurt triggers (for now)
Now, i need to disable trigger2 while trigger1 is triggered.
I'm giving you the map, gsc and the bsp files ( I don't care if you steal anything 8) )
So i need sum halp.

~>Download Here <~

Re: Adding Script to Secret

Posted: April 12th, 2010, 8:31 pm
by waywaaaard
Rez|l wrote:They can't be part of the cube, atleast not as one brushmodel. You can move them at the same time however:

Code: Select all

cube movex(-200, 3);
cube_door movex(-200, 3);
cube_door waittill("movedone");
This will move the doors and the cube at the same time 200 units along the x axis in 3 seconds.
Just link the doors to the cube if you want to move them all together and then disable the link if you want to move the doors only. Look for "ent linkTo(ent)" in the documentation. If you have trigger that should also be moved with the cube you have to "ent enableLinkTo()"

Re: Adding Script to Secret

Posted: April 12th, 2010, 8:50 pm
by BatterY
Well, I was waiting for drofs response, but thanks Lev!

Re: Adding Script to Secret

Posted: April 12th, 2010, 9:15 pm
by Drofder2004
BatterY wrote:Well, I was waiting for drofs response, but thanks Lev!
My response is to go with Levs response.