Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 8 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
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]
Level 8
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.
Share |
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Saturday, Feb. 17, 2007 09:41 pm
Capt-Com,
What is the point in doing that?
That is exactly the reason for the script, to eliminate repetitive code that does the same thing anyway.
Share |
Big-Madman
General Member
Since: May 14, 2006
Posts: 197
Last: May 7, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, Feb. 18, 2007 12:09 am
[cool]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]
Share |
OLD_MAN_WITH_GUN
General Member
Since: May 13, 2006
Posts: 754
Last: Jan 23, 2010
[view latest posts]
Level 7
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.
Share |
Big-Madman
General Member
Since: May 14, 2006
Posts: 197
Last: May 7, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, Feb. 18, 2007 01:13 am
[cool]i did that too..
and nothing apen !!![crazy]
Share |
rogue722
General Member
Since: Jan 17, 2006
Posts: 175
Last: Mar 29, 2007
[view latest posts]
Level 4
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
Share |
Big-Madman
General Member
Since: May 14, 2006
Posts: 197
Last: May 7, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, Feb. 18, 2007 02:03 am
[cool] 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]
Share |
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Sunday, Feb. 18, 2007 02:05 am
Big-Mal writes...
Quote:
[cool]i already made maps with doors before , but i'm using the same script as Capt ...
[confused]


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.
Share |
Capt.Com
General Member
Since: Nov 14, 2004
Posts: 879
Last: Oct 6, 2007
[view latest posts]
Level 7
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.....[duh]

Share |
Big-Madman
General Member
Since: May 14, 2006
Posts: 197
Last: May 7, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, Feb. 18, 2007 03:00 am
[cool] 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]
Share |
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»