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

Members Online

»
0 Active | 79 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 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: 1 Trigger but 2 bruschmodels...(doors)
Errorman
General Member
Since: Mar 21, 2009
Posts: 24
Last: Jun 28, 2009
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Sunday, Jun. 28, 2009 07:12 pm
So hi it's he again...
I need help with a problem.
I want to make an openable double door, but with only one trigger like I push F and the two doors open up.
But the problem is I can't make 2 tragets in the trigger just one is possible.
What to do? Multipli trigger or what?

Thanks, Errorman.
Share |
Carl21221
General Member
Since: Apr 13, 2006
Posts: 134
Last: Jul 31, 2015
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Sunday, Jun. 28, 2009 08:17 pm
Create the trigger_use like you have. And have something like this in your script within your map .gsc file:
Code:

trig = getent ("door_trig", "targetname");

trig waittill ("trigger");

leftdoor = getent("leftdoor", "targetname");
rightdoor = getent("rightdoor", "targetname");

leftdoor movex (-128, 5, 2, 2);
rightdoor movex (128, 5, 2, 2);

leftdoor waittill ("movedone");
rightdoor waittill ("movedone");


All that is needed is to wait until the trigger is triggered and move the doors seperately.
Just copy the code and change the necessary things. (Coordinates and targetnames etc.)

P.s. the code may have an error since i only script for CoD2, i am unsure if this is the same.
Share |
Errorman
General Member
Since: Mar 21, 2009
Posts: 24
Last: Jun 28, 2009
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Sunday, Jun. 28, 2009 08:56 pm
Adding a" while (1)" and a" else" would be nice^^ I am not the best script. If I try to script something there surely are some errors so can you make me the "while (1)" and "else"?
Share |
Errorman
General Member
Since: Mar 21, 2009
Posts: 24
Last: Jun 28, 2009
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Sunday, Jun. 28, 2009 09:31 pm
Can you try to make me a script like this.
main()
{
doortriggers = getentarray("brucketrig","targetname");
for(i=0;i doortriggers 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;
}
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 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

»