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

Members Online

»
0 Active | 61 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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 subscribe
Author Topic: Trying to get a door to rotate
notelvis
General Member
Since: Feb 19, 2005
Posts: 63
Last: Jun 13, 2006
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Wednesday, Apr. 26, 2006 01:53 pm
Following the cod1 scripting tutorial (moving things) I've managed to
make airplanes fly, land, stop, rotate, jump, whatever (In cod1).

But that's more then a year ago now, and I simply forgot everything.

My goal is to make rotating doors, so I started with the tutorial, following its every way. However, when I put it to the test, the door
simply stays closed. I don't think the problem is in my gsc file:

Code:
main()
{
maps\mp\_load::main();

game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";

thread controlroom_main();
}

controlroom_main()
{
controlroom_main = getent ("controlroom_main", "targetname");
controlroom_main rotateto ( (0, 0, 90), 1); 
}


I haven't equipped it with a trigger and all that, simply because I
want to have a simple version working first.

As this code is pretty straight forward, I think it's the mapping where it went wrong.

I've made 1 brush for a door,
inside an origin brush (dead center, and completely inside of the doorbrush)
Selected both, and made the classname script_brushmodel, and the targetname controlroom_main.

Am I doing something wrong?

edited on Apr. 26, 2006 09:55 am by notelvis
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Wednesday, Apr. 26, 2006 04:01 pm
Most like the the "0,0,90" is closed... try making it 0,0,180 or something.
Share |
notelvis
General Member
Since: Feb 19, 2005
Posts: 63
Last: Jun 13, 2006
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Wednesday, Apr. 26, 2006 05:17 pm
Nope, I've even tried simple moving instead of rotating, and it still didnt work.

(just to be clear, I also tried a non-normal angle like 139 degrees, just to be sure it wasnt turning so fast i couldnt see it.)

In the moving tutorial, it says that every brushmodel needs to have an origin, do I need to specify this origin, or is it enough to let it simply sit inside of the door with the same targetname?
Share |
notelvis
General Member
Since: Feb 19, 2005
Posts: 63
Last: Jun 13, 2006
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Thursday, Apr. 27, 2006 08:50 am
Could a moderator perhaps move this post to "CoD 2 Level Design" ?
I think it has more potential there :)
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Thursday, Apr. 27, 2006 09:44 am
eeuhh.. no.. it's a scripting problem.. it's right in it's place here.


Go over the CoD1 tutorial again and use a trigger this time.

you'll have to make an origin and a bruish, select BOTH and make them a script_brushmodel together.
Share |
notelvis
General Member
Since: Feb 19, 2005
Posts: 63
Last: Jun 13, 2006
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Thursday, Apr. 27, 2006 04:20 pm
I did every step exactly like it was written, at least I think so.
Does cod1 scripting even work in cod2? Could you, or someone else
that has been able to make a rotating door send me the .map file?

Would be greatly appreciated!

ps: I wouldn't ask this if I didn't think i'd tried everything, I spend about 5 hours on this pisshole now :)
Share |
Hightree
General Member
Since: Nov 5, 2004
Posts: 48
Last: May 23, 2006
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Thursday, Apr. 27, 2006 11:24 pm
Just saw your thread after posting a simmilar thread in the level design department.
However, my brush does rotate when hard-coded.
I included an iwd and a map file so you can check those out.

The triggering however does not work in my file, that's what I'm having trouble with...
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Friday, Apr. 28, 2006 10:20 am
Already answered in your other thread, Hightree.

As for notelvis:

rotatedoor = getent ("door", "targetname");
rotatedoor rotateto ((0,-90,0), 3, 1, 1);

This works. I just checked it.



Share |
notelvis
General Member
Since: Feb 19, 2005
Posts: 63
Last: Jun 13, 2006
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Apr. 29, 2006 08:27 am
I finally got it to work in a seperate map, as for the mistake, somehow another entity named the same as my door was in the map. (Dont ask me how it got there).

anyway, I thought the cleanest way of getting the doors in my map (mp_pipeline, rebuilding it from the most popular americas army map) was by making a little operating panel for the player to touch, and make the door go open with a heavy mechanical sound ;)

For the people that look for a door with a button:

Code:
thread controlroom_down();

controlroom_down()
{
	controlroom_down = getent ("controlroom_down", "targetname");
	controlroom_down_trigger = getent ("controlroom_down_trigger", "targetname");
		while(1)
		{
			controlroom_down_trigger waittill ("trigger");
			controlroom_down rotateto ((0,90,0), 2, 0, 0.5);
			controlroom_down playsound("mp_pipeline_door");
			controlroom_down_trigger waittill ("trigger");
			controlroom_down rotateto ((0,0,0), 2, 0, 0.5);
			controlroom_down playsound("mp_pipeline_door");
		}
}




Anyway, thanks for your help dudes.
Share |
Restricted Access Topic is Locked 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

»