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

Members Online

»
0 Active | 58 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: Moving door rotate problem
Errorman
General Member
Since: Mar 21, 2009
Posts: 24
Last: Jun 28, 2009
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Friday, Jun. 26, 2009 07:47 pm
Hey, guys.
I need help with a big castle main door which opens like this...

I need some helo with the script...
I have now...
main()
{

doortriggers = getentarray("doortrig","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,3,0.5,0.5);
self.doormodel movey(-90);
self.doormodel waittill("rotatedone");
self.doorclosed = false;
}
else
{
self.doormodel rotateyaw(90,3,0.5,0.5);
self.doormodel movey(90);
self.doormodel waittill("rotatedone");
self.doorclosed = true;
}
self.doormoving = false;
}

But this does look than like this...


So what musst i change in the script?
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Friday, Jun. 26, 2009 08:23 pm
it seems to me that ur origin texture is in the wrong place? shouldnt it be on the side( like a column, standing going up and down), instead of having it on the ground? because as far as i know it will rotate to those angles that you give it but it will move to however your origin texture is placed.

edited on Jun. 26, 2009 04:25 pm by voidsource
Share |
Errorman
General Member
Since: Mar 21, 2009
Posts: 24
Last: Jun 28, 2009
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Saturday, Jun. 27, 2009 09:45 am
Can you make me a picture where I should place the origin ?
Share |
CoDLiNK
General Member
Since: Mar 16, 2008
Posts: 178
Last: Sep 28, 2009
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Saturday, Jun. 27, 2009 11:56 am
Your origin brush is right. Just play with the script. Change the "movey" to "movez" or "movex." Pretty sure someone here will give the right one for your application.

Code:
self.doormodel rotateyaw(-90,3,0.5,0.5);
self.doormodel movez(-90);


edited on Jun. 27, 2009 07:57 am by CoDLiNK
Share |
SPIDYpiet
General Member
Since: Jan 18, 2008
Posts: 8
Last: Apr 30, 2012
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Saturday, Jun. 27, 2009 04:43 pm
rotatepitch instead of rotateyaw
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Saturday, Jun. 27, 2009 06:29 pm
yea try the rotatepitch instead of yaw. if that doesnt work move your "origin" brush off of the floor and make it seem like its standing.
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 02:31 pm
Thanks alot for your help guys! It works![tongue]
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

»