Adding Script to Secret

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

Moderator: Core Staff

Post Reply
BatterY
CJ Worshipper
CJ Worshipper
Posts: 238
Joined: January 29th, 2010, 10:27 pm

Adding Script to Secret

Post by BatterY » April 12th, 2010, 1:33 pm

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

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Adding Script to Secret

Post by Rezil » April 12th, 2010, 7:30 pm

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.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

BatterY
CJ Worshipper
CJ Worshipper
Posts: 238
Joined: January 29th, 2010, 10:27 pm

Re: Adding Script to Secret

Post by BatterY » April 12th, 2010, 7:34 pm

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 <~

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: Adding Script to Secret

Post by waywaaaard » April 12th, 2010, 8:31 pm

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()"
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

BatterY
CJ Worshipper
CJ Worshipper
Posts: 238
Joined: January 29th, 2010, 10:27 pm

Re: Adding Script to Secret

Post by BatterY » April 12th, 2010, 8:50 pm

Well, I was waiting for drofs response, but thanks Lev!

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

Re: Adding Script to Secret

Post by Drofder2004 » April 12th, 2010, 9:15 pm

BatterY wrote:Well, I was waiting for drofs response, but thanks Lev!
My response is to go with Levs response.
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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests