Bashable Falling Doors

Tutorials for Call of Duty mapping

Moderator: Core Staff

Post Reply
Lethal323

Bashable Falling Doors

Post by Lethal323 » July 8th, 2007, 10:07 pm

Start by creating a wall with a door...

I made my door:

X: 4
Y: 48
Z: 88

(all measurements are asuming looking at map with everything sideways)

Now make a textures>common>orgin and place it at the bottom of the door inside of it

I made mine shaped like a rod going through almost like an invisible hinge...

Image

Now select both the door and the orgin and make it a script>brushmodel

Give it the following values:

Key: Targetname
Value: Door


Now make a trigger on front side of the door

Make sure it is the size of the door and its better if its flat aginst the door so it cant be bashed from the side, only from the front...

Now hit "n" to open the entities window and check all the boxes accept for no_melee

Make it a trigger>damage

Give it the following values:

Key: Targetname
Value: door_front


Now make another trigger for the backdoor

Give it the following values:

Key: Targetname
Value door_back


Now we need to make it so if the door falls on you it kills you :)

Make a trigger>hurt on the front side and make it a box so if your standing in it, it will kill you...

I made mine

X: 88
Y: 48
Z: 88


Give it the following values:

Key: dmg
Value: 100


Press enter

Key: Targetname
Value: door_front_hurt


Do the same thing for the back

Give it the following values:

Key: dmg
Value: 100


Press enter

Key: Targetname
Value: door_back_hurt


Now pretty up your map with lights and fun stuff like that and compile

Image


Now on to the scripting...

Create a new text document and save it as (mapname).gsc

Put the following code inside of it:

Code: Select all

main()
{
thread door_front();
thread door_back();
}
door_front()
{
trig = getent("door_front","targetname");
trig1 = getent ("door_front","targetname");
block = getent ("door","targetname");
kill = getent ("door_kill_front","targetname");
while (1)
{
kill thread maps\mp\_utility::triggerOff();
trig waittill ("damage", idamage);
{
block rotatepitch (90, .5, .5, 0);
wait (.5);
kill thread maps\mp\_utility::triggerOn();
block waittill ("movedone");
kill thread maps\mp\_utility::triggerOff();
trig thread maps\mp\_utility::triggerOff();
trig1 thread maps\mp\_utility::triggerOff();
}
}
}
door_back()
{
trig = getent("door_back","targetname");
trig1 = getent ("door_front","targetname");
block = getent ("door","targetname");
kill = getent ("door_kill_back","targetname");
while (1)
{
kill thread maps\mp\_utility::triggerOff();
trig waittill ("damage");
{
block rotatepitch (-90, .5, .5, 0);
kill thread maps\mp\_utility::triggerOn();
block waittill ("movedone");
kill thread maps\mp\_utility::triggerOff();
trig thread maps\mp\_utility::triggerOff();
trig1 thread maps\mp\_utility::triggerOff();
}
}
}


Image




And Thats it...

Pedsdude
Site Admin
Site Admin
Posts: 15908
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » July 9th, 2007, 4:04 pm

Nice tutorial, moved to tutorials section :)
Image
Image

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

Post by Drofder2004 » July 10th, 2007, 7:20 pm

Instead of turning the triggers off, because they are not going to be used again, use the "delete()" function. This will remove the entity from the map.

Clever idea and good tutorial.
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
Coontang
CJ G0D!
CJ G0D!
Posts: 1797
Joined: March 4th, 2007, 3:48 pm
Location: Painting by numbers

Post by Coontang » July 10th, 2007, 8:08 pm

does this work for cod2 as well?
Image
JDogg: 'I have a video of me pissing, wanna see?'

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » July 10th, 2007, 9:10 pm

Should do, except i've found using spawnflags on triggers don't work in cod 2.
Watch this before posting a question: http://www.albinoblacksheep.com/flash/posting.php

Lethal323

Post by Lethal323 » July 11th, 2007, 11:13 pm

So drofder, What you saying to do is...

Code: Select all

main() 
{ 
thread door_front(); 
thread door_back(); 
} 
door_front() 
{ 
trig = getent("door_front","targetname"); 
trig1 = getent ("door_front","targetname"); 
block = getent ("door","targetname"); 
kill = getent ("door_kill_front","targetname"); 
while (1) 
{ 
kill thread maps\mp\_utility::triggerOff(); 
trig waittill ("damage", idamage); 
{ 
block rotatepitch (90, .5, .5, 0); 
wait (.5); 
kill thread maps\mp\_utility::triggerOn(); 
block waittill ("movedone"); 
kill delete();
trig delete();
trig1 delete();
} 
} 
} 
door_back() 
{ 
trig = getent("door_back","targetname"); 
trig1 = getent ("door_front","targetname"); 
block = getent ("door","targetname"); 
kill = getent ("door_kill_back","targetname"); 
while (1) 
{ 
kill thread maps\mp\_utility::triggerOff(); 
trig waittill ("damage"); 
{ 
block rotatepitch (-90, .5, .5, 0); 
kill thread maps\mp\_utility::triggerOn(); 
block waittill ("movedone"); 
kill delete();
trig delete();
trig1 delete();
} 
} 
}

I think I coded that right...

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

Post by Drofder2004 » July 12th, 2007, 12:23 am

Well, test it and you shall see. Once the triggers are deleted, they are gone, they cannot be used. As long as the triggers are never going to be used again, this will be more efficient,
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

Lethal323

Post by Lethal323 » July 12th, 2007, 2:34 am

Would test it but im on linux... :-(

so dont have cod radiant, cod, coduo, nothing but internet and galaga

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests