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

Members Online

»
0 Active | 10 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 4
Category: CoD4 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Opening doors
kao-neki-jebac
General Member
Since: May 8, 2010
Posts: 4
Last: Feb 21, 2011
[view latest posts]
Level 0
Category: CoD4 MP Mapping
Posted: Tuesday, Feb. 8, 2011 08:19 am
MY doors dont work. i have a script file _door. ive made the door and origen brush into a brush model. ive put a trigger and put in targetname doortrig and ive connected the door with the trigger using W key. what do i do?
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Tuesday, Feb. 8, 2011 09:07 am
Do you want us to guess what your code looks like ?

Also, don't name the script "_door.gsc", it might interfere with other people's scripts. Better name it "mp_mapname_door.gsc".
Share |
COLMAC
General Member
Since: Sep 15, 2006
Posts: 914
Last: Jan 27, 2012
[view latest posts]
Level 7
Category: CoD4 MP Mapping
Posted: Tuesday, Feb. 8, 2011 04:34 pm
attachment: application(2.3Kb)
_door.gsc

Code:
main()
{
thread scripted_door();
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
scripted_door()
{
doortrigger = getentarray("doortrig","targetname");
for(i=0;i<doortrigger.size;i++)
doortrigger [i] thread door_think();
}
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
door_think()
{
self.doormoving = false;
self.doorclosed = true;
self.doormodel = getent(self.target, "targetname");

while (1)
{
self waittill("trigger");
if(!self.doormoving)
self thread door_move();
}
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
door_move()
{
self.doormoving = true;
if(self.doorclosed)
{
self.doormodel rotateyaw(-90, 1, 0.5, 0.5);
self.doormodel waittill("rotatedone");
self.doorclosed = false;
}
else
{
self.doormodel rotateyaw(90, 1, 0.5, 0.5);
self.doormodel waittill("rotatedone");
self.doorclosed = true;
}
self.doormoving = false;
}


note that you name the door in this line
self.doormodel = getent(self.target, "targetname");

and here is a double sliding door

_sliders.gsc

Code:
main() 
{ 
    thread door_start(); 
} 

door_start() 
{ 
    doortrigger = getentarray("doortrig","targetname"); 
    for(i=0;i<doortrigger.size;i++) 
        doortrigger[i] thread door_think(); 
} 

door_think() 
{ 
    stuff = getentarray(self.target,"targetname"); 
    for(i=0;i<stuff.size;i++) 
    { 
        if(!isDefined(stuff[i].script_noteworthy)) 
            continue; 

        if(stuff[i].script_noteworthy == "g_left_door") 
            self.left_door = stuff[i]; 
        else if(stuff[i].script_noteworthy == "g_right_door") 
            self.right_door = stuff[i]; 
    } 
    self.doorMoving = false; 
    while (1) 
    { 
        self waittill("trigger"); 
        if(!self.doorMoving) 
            self thread door_move(); 
    } 
} 

door_move() 
{ 
    self.doorMoving = true; 
    self.right_door movey(31,2,0.5,0.5); 
    self.left_door moveY(-31,2,0.5,0.5); 
    wait 3.5; 
    self.right_door movey(-31,2,0.5,0.5); 
    self.left_door moveY(31,2,0.5,0.5); 
    wait 3.5; 
    self.doorMoving = false; 
}  


notice that the( script_noteworthy named g_left_door)
and ( script_noteworthy named g_right_door)

i uploaded attach file prefab of glass sliding doors for this sliders.gsc

attachment: application(2.3Kb) copy on notepad close and save as
sliders.map, as map file in prefabs folder
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP 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

»