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

Members Online

»
0 Active | 9 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
Category: CoD Mapping
CoD mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: 2-Way scripted rotating doors
104DRS-NL_Havoc
General Member
Since: Jan 26, 2005
Posts: 10
Last: Mar 12, 2005
[view latest posts]
Level 0
Category: CoD Mapping
Posted: Thursday, Feb. 17, 2005 06:43 pm
Hi,

I'm working on VikingWiedel's moh_bridge_sdver map to make it support Retrieval (he was so kind to send me the .map file). Everything works fine (thanks to Wyatt Earp's Retrieval tutorial) so I moved along to make the map more like the one in MoHAA by adding doors. I started with func_door_rotating but that didn't work very well cause I couldn't make them solid, you could shoot through them. I tried the clipweap texture to be part of the door but that didn't work. So I changed them to script_brushmodels and made them scripted doors (thanks to StrYdeR's getting started with scripting tutorial). But now a new problem showed up, I can't figure out how to make them rotate away from the player who opens it. They just rotate to the angle I've set in the script and back. So for example if you're inside a room the door will rotate towards you and when you're outside the room it will rotate away from you. Of course most doors work like this in real life but it causes problems with players getting stuck and such. I would really like to know how I can make scripted doors rotate 90 degrees away from the player no matter on which side of the door the player is. If someone can help me out or point me to a thread/tutorial that covers this it would be very very appreciated.

Here's the script of one of the doors:
Code:

open_moh_door_1()
{
door = getent ("moh_door_wood_1", "targetname");
trig = getent ("moh_door_wood_1_trig", "targetname");

while(1)
{
trig waittill ("trigger");
door rotateyaw (-90,1);
door playsound("moh_doors_open");
wait (0.8);
door playsound("moh_doors_openstop");
wait (3.2);
door playsound("moh_doors_close");
door rotateyaw (90,1);
wait (0.9);
door playsound("moh_doors_closestop");
door waittill ("rotatedone");
}
}



And I have another quick question: The models on the map don't cast shadows, but I didn't check NO_SHADOW. I fixed it temporarily by adding shadow cast textures, but how do I make them cast 'real' shadows?

Thx to anyone in the community who keeps CoD(UO) a great game to play, you know who you are. [wink]
Share |
ShosMeister
General Member
Since: Feb 17, 2004
Posts: 179
Last: Jun 13, 2005
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Thursday, Feb. 17, 2005 07:17 pm
Not sure if it will work as I don't know how far apart trigger_use need to be but, why not make two triggers? One on the inside and one on the outside. Then, you can control it by what trigger the user triggers.
Share |
BR3NT
General Member
Since: Feb 15, 2005
Posts: 49
Last: Jun 6, 2005
[view latest posts]
Level 2
Category: CoD Mapping
Posted: Thursday, Feb. 17, 2005 07:21 pm
About The Shadows For Your models.

Read This Thread . >>>Click Here

Stryder Breaks It Down For You.

[smokin]
Share |
104DRS-NL_Havoc
General Member
Since: Jan 26, 2005
Posts: 10
Last: Mar 12, 2005
[view latest posts]
Level 0
Category: CoD Mapping
Posted: Thursday, Feb. 17, 2005 11:39 pm
ShosMeister writes...
Quote:
Not sure if it will work as I don't know how far apart trigger_use need to be but, why not make two triggers? One on the inside and one on the outside. Then, you can control it by what trigger the user triggers.



Yeah that's a good idea and I already tried it, but it screwed things up cause both triggers work simultaneously. I am not very familiar with scripting (but I'm learning..) so I don't know how to disable the 2nd trigger while the door is opened by the 1st one. I have this strange feeling this is really easy but it isn't if you don't know how. :) So if anyone can tell me how to disable certain parts of a script temporarily I would be helped out.

ShosMeister writes...
Quote:
About The Shadows For Your models.

Read This Thread . >>>Click Here

Stryder Breaks It Down For You.

[smokin]



Ah thx, I totally forgot about the Radiant readme this time. lol

Cheers.
Share |
104DRS-NL_Havoc
General Member
Since: Jan 26, 2005
Posts: 10
Last: Mar 12, 2005
[view latest posts]
Level 0
Category: CoD Mapping
Posted: Friday, Feb. 18, 2005 03:38 am
Nevermind guys, I figured out a way to do it.
I use 2 triggers for each door and when the door is opened both triggers will be disabled untill the door is closed.

This is how I did it:
Code:
main()
{
level.moh_door_1_open = false; // Door is not in use at start
thread open_moh_door_1_1();
thread open_moh_door_1_2();
}

open_moh_door_1_1()
{
door = getent ("moh_door_wood_1", "targetname");
trig = getent ("moh_door_wood_1_trig_1", "targetname");

while(1)
{
trig waittill ("trigger");

if (level.moh_door_1_open)
{
continue;
}
else
{
level.moh_door_1_open = true;
door rotateyaw (-90,1);
door playsound("moh_doors_open");
wait (0.8);
door playsound("moh_doors_openstop");
wait (3.2);
door playsound("moh_doors_close");
door rotateyaw (90,1);
wait (0.9);
door playsound("moh_doors_closestop");
door waittill ("rotatedone");
level.moh_door_1_open = false;
}
}
}

open_moh_door_1_2()
{
door = getent ("moh_door_wood_1", "targetname");
trig = getent ("moh_door_wood_1_trig_2", "targetname");

while(1)
{
trig waittill ("trigger");

if (level.moh_door_1_open)
{
continue;
}
else
{
level.moh_door_1_open = true;
door rotateyaw (90,1);
door playsound("moh_doors_open");
wait (0.8);
door playsound("moh_doors_openstop");
wait (3.2);
door playsound("moh_doors_close");
door rotateyaw (-90,1);
wait (0.9);
door playsound("moh_doors_closestop");
door waittill ("rotatedone");
level.moh_door_1_open = false;
}
}
}



Thanks for your help!
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty : CoD Mapping

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

»