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

Members Online

»
0 Active | 55 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: need some rotating script help
Zero_Rain
General Member
Since: Jun 5, 2006
Posts: 94
Last: Jan 13, 2008
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Dec. 1, 2007 02:27 am
can I get a lameman break down of this script
... i got it from a windmill prefab, but want to change the rotation direction like a helicpoter, I have allready set the target up in radiant just need scrip help

THANKS!!

main()
{
rotate_obj = getentarray("rotate","targetname");
if(isdefined(rotate_obj))
{
for(i=0;i {
rotate_obj thread ra_rotate();
}
}
}

ra_rotate()
{
if (!isdefined(self.speed))
self.speed = 5;
if (!isdefined(self.script_noteworthy))
self.script_noteworthy = "z";

while(true)
{
// rotateYaw(float rot, float time, , );
if (self.script_noteworthy == "y")
self rotateYaw(360,self.speed);
else if (self.script_noteworthy == "x")
self rotateRoll(360,self.speed);
else if (self.script_noteworthy == "z")
self rotatePitch(360,self.speed);
wait ((self.speed)-0.1); // removes the slight hesitation that waittill("rotatedone"); gives.
// self waittill("rotatedone");
}
}
Share |
sevensniff
General Member
Since: Feb 12, 2005
Posts: 365
Last: Apr 8, 2010
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Saturday, Dec. 1, 2007 05:10 am
simply change

self.script_noteworthy = "z";

to

self.script_noteworthy = "x";

if its not x then try y
Share |
Zero_Rain
General Member
Since: Jun 5, 2006
Posts: 94
Last: Jan 13, 2008
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Dec. 1, 2007 03:01 pm
thought it would be that eaisy thanks m8
Share |
playername
Preferred Member
Since: Aug 24, 2006
Posts: 821
Last: Apr 15, 2011
[view latest posts]
Level 7
Forum Moderator
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Dec. 1, 2007 03:29 pm
I have a qeustion... why do you have an extra part of the script...


Code:
main()
{
rotate_obj = getentarray("rotate","targetname");
if(isdefined(rotate_obj))
{
for(i=0;i {
rotate_obj thread ra_rotate();
}
}
}

ra_rotate()
{
if (!isdefined(self.speed))
self.speed = 5;
if (!isdefined(self.script_noteworthy))
self.script_noteworthy = "x";

while(true)
{
// rotateYaw(float rot, float time, , );
if (self.script_noteworthy == "y")
self rotateYaw(360,self.speed);
else if (self.script_noteworthy == "x")
self rotateRoll(360,self.speed);
wait ((self.speed)-0.1); // removes hesitation that waittill("rotatedone"); gives.
}
}


If you know it isn't going to be rotating on Y just take out the if(self.script_noteworthy == "y")
self rotateYaw----;

If X DOES NOT work then change
If(!isdefined(self.script_noteworthy))
self.script_noteworthy = "x" to "y"

then delete the else if --------)
self rotateRoll-----;

If you have any qeustions just ask...

edited on Dec. 1, 2007 10:33 am by playername
nullFew tips for coding.
1. Keep the script as short as possible.
2. Don't comment every line. Only comment portions where they may be needed to point something out.
3. Don't over complicate the script, keep it organized and easy to read.

These help you find simple errors and makes it easy to make changes.
Share |
Zero_Rain
General Member
Since: Jun 5, 2006
Posts: 94
Last: Jan 13, 2008
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Dec. 1, 2007 03:36 pm
I just went with the tutoral... A/W

can you rotate a prefab?
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

»