| Author |
Topic: A small and Simple multiple door handling script |
| WHC_Grassy |
General Member Since: Apr 20, 2005 Posts: 1426 Last: Aug 25, 2007 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Saturday, Feb. 17, 2007 09:36 pm |
 |
@Big-Mal
Have you made and manipulated script_brushmodels before?
Thats all your doors will be, two brushes, one with a door texture, and a smaller one with origin texture.
First make your door brush, texture it as you want.
Select your door and hit the space bar to duplicate it and drag one side over to the opposite side so you end up with a tall brush the same height as your door and the thickness of your door squared.
Now while the small brush is still selected choose origin texture.
To make these two brushes one entity select them both and right click in the 2d window and choose script_brushmodel.
Thats all you need to do for the door.
All you need now is to make a trigger, draw out a brush 32 units cubed (all sides), texture it trigger, right click and select trigger_use, hit "N" and give the trigger a targtename of "doortrig" Place the trigger on the door opposite the origin brush and so it protrudes an equal amount on each side of the door.
Now to target the door from the trigger, first select the trigger then the door and press Ctrl+k
Thats all there is to it, each and every door will be done the same way, and ALL the triggers should have the same targetname.
|
 |
|
|
| WHC_Grassy |
General Member Since: Apr 20, 2005 Posts: 1426 Last: Aug 25, 2007 [view latest posts] |
|
|
|
|
| Big-Madman |
 |
General Member Since: May 14, 2006 Posts: 197 Last: May 7, 2008 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Sunday, Feb. 18, 2007 12:09 am |
 |
![[cool]](images/BBCode/smilies/cool.gif) i already made maps with doors before , but i'm using the same script as Capt ...
so everything was made like you said in the previous post Grassy ... exept for this part ...
(Now to target the door from the trigger, first select the trigger then the door and press Ctrl+k) .. i tryed but nothing apen when i hit ctrl+k ...
so when i start map and hit the trigger , here is the error i got ..
cannot cast undefined to string
ent = getten (self.target "targetname" ;
any clue what is my prob ??
![[confused]](images/BBCode/smilies/confused.gif) |
 |
|
|
| OLD_MAN_WITH_GUN |
General Member Since: May 13, 2006 Posts: 754 Last: Jan 23, 2010 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Sunday, Feb. 18, 2007 12:52 am |
 |
Big-Mal writes...Quote: (Now to target the door from the trigger, first select the trigger then the door and press Ctrl+k) .. i tryed but nothing apen when i hit ctrl+k ... In the radiant for CoD2 you have to press w instead of ctrl+k. |
 |
|
|
| Big-Madman |
 |
General Member Since: May 14, 2006 Posts: 197 Last: May 7, 2008 [view latest posts] |
|
|
|
|
| rogue722 |
 |
General Member Since: Jan 17, 2006 Posts: 175 Last: Mar 29, 2007 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Sunday, Feb. 18, 2007 01:37 am |
 |
Quote: cannot cast undefined to string
ent = getten (self.target "targetname" ;
I think your problem is your code, not the targeting persay...
Your line of code here should be:
ent = getent (self.target,"targetname");
You spelled getent wrong, missing the comma, and the end parenthesis, make sure you type everything exactly as it is.
-Rogue |
 |
|
|
| Big-Madman |
 |
General Member Since: May 14, 2006 Posts: 197 Last: May 7, 2008 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Sunday, Feb. 18, 2007 02:03 am |
 |
![[cool]](images/BBCode/smilies/cool.gif) ya sry i have write the error by hand ...
the error was
ent = getent (self.target,"targetname");
, i have put in the gsc the exact same file as Grassy ...
still have the prob ... ![[sad]](images/BBCode/smilies/sad.gif) |
 |
|
|
| WHC_Grassy |
General Member Since: Apr 20, 2005 Posts: 1426 Last: Aug 25, 2007 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Sunday, Feb. 18, 2007 02:05 am |
 |
Big-Mal writes...Quote: ![[cool]](images/BBCode/smilies/cool.gif) i already made maps with doors before , but i'm using the same script as Capt ...
![[confused]](images/BBCode/smilies/confused.gif)
What?
If you are using the code that Capt_confusion posted then you will get errors.
If you decide to use other code than what this thread was created for then make your own thread about your issues related to that code. |
 |
|
|
| Capt.Com |
General Member Since: Nov 14, 2004 Posts: 879 Last: Oct 6, 2007 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Sunday, Feb. 18, 2007 02:36 am |
 |
Thank you fro the name grassy I'll remember that for long, you can count on me for that.
The problems is that " experienced" mappers give helps to new mappers with complicated scripts. I was just trying to give him a quick script that function very well. I have 23 doors on the map I'm actually doing and they ALL works fine accordin to the code I gave to Big-Mal even those that are not rotate the same way as others.
Next time put the script in the advanced tutorials, that way those who are "experienced" will find it.
No offense.....
|
 |
|
|
| Big-Madman |
 |
General Member Since: May 14, 2006 Posts: 197 Last: May 7, 2008 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Sunday, Feb. 18, 2007 03:00 am |
 |
![[cool]](images/BBCode/smilies/cool.gif) lolol yo guys the Capt script is working very well .... i'm just trying to get a shorter way (script) ... from you Grassy , but till now it doesn't work ...
there are something wrong ... i just trying here to find what is the problem ...
second thing , i want that my door be able to open forward from both side ...
thank you for help but i dont want to start a litle war here ... ![[wink]](images/BBCode/smilies/wink.gif) |
 |
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|