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 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: Scriptbrush rotation
madmax101
General Member
Since: Aug 28, 2009
Posts: 40
Last: Jun 12, 2013
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Thursday, Sep. 2, 2010 01:04 pm
Guys need looping rotation for scriptbrush....it is for windmill...can sombody help me with this pls?..
Share |
Tristan4592
General Member
Since: Apr 26, 2007
Posts: 235
Last: Nov 11, 2010
[view latest posts]
Level 4
MODSCON
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Thursday, Sep. 2, 2010 06:13 pm
This function will do the rotation

RotatePitch( pitch angle, time, acceleration time, deceleration time)

You may need to substitute RotatePitch with RotateYaw or RotateRoll depending on the axis you want it to rotate about.

Note that the last two parameters are optional, in your case you probably don't want to use them as you would want the windmill to rotate at a constant speed.

To make the rotation loop, I would specify 360 degrees in the angle parameter, and put the rotation command in a loop like this :

Code:
while(1)
{
    mybrushmodel RotatePitch(360, 20);
    waittill("RotateDone");
}
Share |
madmax101
General Member
Since: Aug 28, 2009
Posts: 40
Last: Jun 12, 2013
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Sep. 3, 2010 12:19 am
Tristan4592 writes...
Quote:
This function will do the rotation

RotatePitch( pitch angle, time, acceleration time, deceleration time)

You may need to substitute RotatePitch with RotateYaw or RotateRoll depending on the axis you want it to rotate about.

Note that the last two parameters are optional, in your case you probably don't want to use them as you would want the windmill to rotate at a constant speed.

To make the rotation loop, I would specify 360 degrees in the angle parameter, and put the rotation command in a loop like this :

Code:
while(1)
{
    mybrushmodel RotatePitch(360, 20);
    waittill("RotateDone");
}

im very low about script so after first try i get error

******* script compile error *******
bad syntax: (file 'maps/mp/mp_windmill.gsc', line 4)
waittill("RotateDone");
*
Share |
-CoDMapper
General Member
Since: Nov 29, 2009
Posts: 83
Last: Oct 23, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Sep. 3, 2010 12:26 am
windmill()
{
windmill = getent("windmill","targetname");
for (;;)
{
windmill RotatePitch(360, 5);
}
}

Make sure the windmill brushmodels are one entity, and don't forget to use

level thread windmill();
Share |
madmax101
General Member
Since: Aug 28, 2009
Posts: 40
Last: Jun 12, 2013
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Sep. 3, 2010 01:02 am
lol i have the Weird problem ...some time when i test my maps cod2 just stop responding and i need to close it..with ctrl+alt+delete....but after using this code cod2 try load map and just not respond now like 6 in row never happened to me like this? is posible that script can do this to my game?

Code:
main()
{
level thread windmill();
}

windmill()
{
windmill = getent("windmill","targetname");
while(1)
{
windmill RotatePitch(360, 5);
}
}
Share |
Tristan4592
General Member
Since: Apr 26, 2007
Posts: 235
Last: Nov 11, 2010
[view latest posts]
Level 4
MODSCON
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Sep. 3, 2010 01:12 am
You still need the rotate done part, or else it keeps trying to do multiple rotations without waiting for it to stop. I just gave it to you incorrectly the first time.

It should look like:

Code:
windmill waittill("rotatedone");


edited on Sep. 2, 2010 09:14 pm by Tristan4592
Share |
madmax101
General Member
Since: Aug 28, 2009
Posts: 40
Last: Jun 12, 2013
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Sep. 3, 2010 06:47 am
hmm.. now i can enter my map but the problem is that thing rotate around windmill ... i have try RotatePitch ,RotateYaw or RotateRoll ..what i need is rotation on place..[cry]
Share |
clanhelio
General Member
Since: Aug 30, 2008
Posts: 223
Last: Mar 24, 2011
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Sep. 3, 2010 07:53 am
Make sure when you create your brushmodel, you included an origin texture, because this specifies the center.
Share |
madmax101
General Member
Since: Aug 28, 2009
Posts: 40
Last: Jun 12, 2013
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Sep. 3, 2010 10:15 am
thx guys [thumbs_up] works nice now...i totaly forgot about orgin texture [drink]
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

»