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

Members Online

»
0 Active | 111 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 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
Page
Next Page
subscribe
Author Topic: Rotating Fan with light effect in COD4
amishthunder
General Member
Since: Oct 24, 2004
Posts: 364
Last: Dec 23, 2008
[view latest posts]
Level 5
MODSCON
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Monday, Dec. 31, 2007 06:03 am
Rotating Fan with light effect in COD4 - AmishThunder
www.kramerartanddesign.com

This tutorial involves some scripting and lighting familiarity, lets get dirty.

Create your area you want your fan and light.

First make a fan.
Right click on the grid -> script -> script_model
Select the model "icbm_turbofan64" or any other size you want.
Now give it the "Key/Value" of "targetname / fan1"

Now make your spot light.
Create your light entity, null, and connect them.
Refer to Lighting 101 if unsure how.
Select "Primary_Spot" for your light and customize the rest so that the light clearly touches the surface you want your shadow on..

You are now done in your map!

--------------------------------------------------------------

Lets begin the scripting part, its not has hard as you may suspect.

Open your .gsc
If you don't have one yet then open "mp_test.gsc" and adjust accordingly with your map name.

Create your thread
Add this to the first main() bracket.
Quote:

thread fanSpin();


Now under the last } for the main() bracket add this code.
Quote:

fanSpin() {
fan1 = getEnt( "fan1" , "targetname" );
//fan2 = getEnt( "fan2" , "targetname" );

//Code by AmishThunder
// www.kramerartanddesign.com
while (1)
{
fan1 rotateyaw( 360, 5, 0, 0 );
//fan1 rotateyaw( degrees, time in seconds, 0, 0 );

//fan2 rotateyaw( 360, 5, 0, 0 );

wait 4.9;
}
}


You may add as many fans as you like but copy a new segment and up the number by 1.

Share |
P.C.Invasion
General Member
Since: Mar 22, 2005
Posts: 700
Last: Oct 21, 2013
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Monday, Dec. 31, 2007 09:02 am
Can we shelve the tuts for cod4 along with the constant inquiries of the whereabouts of the mod tools until, well, people actually have the mod tools.

Yeah. It's jealousy. I'm not bashful.

[crazy]
Share |
lazygit
General Member
Since: Dec 13, 2003
Posts: 296
Last: Nov 3, 2022
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Monday, Dec. 31, 2007 09:04 am
whahahahaha yeh its sorta like a custard pie aint it rub it in your face lol [lol]
Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Monday, Dec. 31, 2007 10:37 am
You can clean that code up a bit though, maybe get rid of some of the comments.

Code:

fanSpin() 
{
fan1 = getEnt( "fan1" , "targetname" );
while (1)
{
fan1 rotateyaw( 360, 5, 0, 0 );
wait 4.9;
}
}
Share |
OLD_MAN_WITH_GUN
General Member
Since: May 13, 2006
Posts: 754
Last: Jan 23, 2010
[view latest posts]
Level 7
Category: CoD4 MP Mapping
Posted: Monday, Dec. 31, 2007 02:20 pm
I think, this code is more usable for more fans
Code:
fanspin()
{
	fan = getentarray("fan", "targetname");
	for(i = 0; i < fan.size; i++)
		fan[i] thread fanrotate(randomint(4) + 2);
}

fanrotate(speed)
{
	while(1)
	{
		self rotateyaw(360, speed, 0 ,0);
		wait(speed - 0.1);
	}
}

That way all fans must have the same targetname (fan).
If you add more fans, you don't need to touch the code.
All fans are caught by the code and rotate with random speeds. [wink]
Share |
amishthunder
General Member
Since: Oct 24, 2004
Posts: 364
Last: Dec 23, 2008
[view latest posts]
Level 5
MODSCON
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Monday, Dec. 31, 2007 04:28 pm
The code was meant to be user friendly to the new scripters out there and the comments were for explanation. However with any script, there are hundreds of ways to do the same thing.
Share |
MestHead
General Member
Since: Jan 31, 2007
Posts: 95
Last: Dec 17, 2012
[view latest posts]
Level 3
Category: CoD4 MP Mapping
Posted: Thursday, Jan. 10, 2008 11:56 pm
How are you guys making maps for cod4 if the tools havnt been released yet?
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Forum Moderator
Category: CoD4 MP Mapping
Posted: Friday, Jan. 11, 2008 12:00 am
'Some' people have the beta release of the tools.

[wave]
Share |
paulb39
General Member
Since: Jan 3, 2006
Posts: 492
Last: Oct 16, 2011
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Friday, Jan. 11, 2008 12:41 am
I'm glad this tuts up- i wanted to do this once the tools were released

would u do this the same way in cod2 radiant?
Share |
amishthunder
General Member
Since: Oct 24, 2004
Posts: 364
Last: Dec 23, 2008
[view latest posts]
Level 5
MODSCON
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Friday, Jan. 11, 2008 01:42 am
No, COD2 does not have any real dynamic lights.
Share |
Restricted Access Topic is Locked
Page
Next Page
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

»