Page 1 of 1

Tutorial: Creating level effects

Posted: January 21st, 2008, 8:39 am
by Marshall
Ok, so now you want to add some fire? smoke? maybe other effect?

--

Creating a burning barrel with smoke ~ contained bonfire

Image

--

Mapping

Open your map. (assuming it currently works, tried and tested)

Right click on the grid, select Misc > Model..

..Locate the CoD4Root > raw > xmodel > folder.

Select the model called com_barrel_fire.

Place the Barrel where you want it..  obviously.

Right click on the grid, select Light,

Press key N..

..Add the following keys and values:

Code: Select all

Key: radius
Values: 210
Close that window, but with the Light selected, press key K

This should open the color selection box, select a yellow / orange color.

Place the Light directly over the barrel, but 16 units above the barrel.

Why 16 units above?

So that the flame simulates white light, not to mention preventing shadows.

Save.

--

Pre-Script

With the map open, press key 1. (to select grid size 1)

Select the light, switch your grid panel, to X and Y. (birdseye view)

Put your cursor in the middle of the light..

.. take note of the X and Y co-ordinates.

Then switch to the Z view panel. (side view)

Once again place your cursor in the centre of the light..

.. take note of the Z co-ordinates.

This is shown below all:

Image

--

.GSC Files Creation

If you don't allready have a .GSC file, now's the time.

Create a text file on your Desktop, and open it up.

Copy and Paste the following:

Code: Select all

main()
{


            level._effect["fire"] = loadfx ("fx/fire/fire_barrel_fragm_a.efx");
           maps\mp\_fx::loopfx("fire", (-864, -305, 64), 3);

            level._effect["smoke"] = loadfx ("fx/smoke/thin_black_smoke_M.efx");
           maps\mp\_fx::loopfx("smoke", (1241, -96, 64), 3);


	maps\mp\_load::main();
	
	maps\mp\_compass::setupMiniMap("compass_map_mp_shipment");
	
	//setExpFog(500, 3500, .5, 0.5, 0.45, 0);
	ambientPlay("ambient_middleeast_ext");
	//VisionSetNaked( "mp_vacant" );
	
	game["allies"] = "marines";
	game["axis"] = "opfor";
	game["attackers"] = "axis";
	game["defenders"] = "allies";
	game["allies_soldiertype"] = "desert";
	game["axis_soldiertype"] = "desert";

	setdvar( "r_specularcolorscale", "1" );

	setdvar("r_glowbloomintensity0",".1");
	setdvar("r_glowbloomintensity1",".1");
	setdvar("r_glowskybleedintensity0",".1");
	setdvar("compassmaxrange","1500");

thread plat1();



}
Take a look at this extract from the .GSC file:

Code: Select all

            level._effect["fire"] = loadfx ("fire/firelp_barrel_pm");
           maps\mp\_fx::loopfx("fire", (-864, -305, 58), 3);

            level._effect["smoke"] = loadfx ("smoke/steam_large_vent");
           maps\mp\_fx::loopfx("smoke", (-864, -305, 54), 3);
Now insert your noted co-ordinates into the following lines:

Code: Select all

           maps\mp\_fx::loopfx("fire", (-864, -305, 58), 3);

Code: Select all

           maps\mp\_fx::loopfx("smoke", (-864, -305, 54), 3);
NOTE:

Enter the co-ordinates into those lines, in this order: (from left to right)

X, Y, Z

Make sure that you deduct 8 units from the noted co-ordinates

for the fire effect~

Make sure that you deduct 12 units from the noted co-ordinates

for the smoke effect~

--

Once that is finished, save as the text file as mp_testmap.gsc.

(or whatever your map is called)

Move that new .GSC file into the following folder:

Code: Select all

Call of Duty 4 Root > raw > maps > mp >
Remember to repack your FastFiles once changing the .GSC files.

Also remember to recompile Reflections, when adding new effects.



NOTE:

If you want to find more effects, not only fire and smoke..

..then explore the fx folder, located below

Code: Select all

Call of Duty 4 Root > raw > fx >

Image

Posted: January 21st, 2008, 8:54 am
by JDogg
Awesome tut!

Re: Tutorial: Creating level effects

Posted: March 31st, 2009, 2:10 am
by DMShadow
Thanks! recompiling my map now to see if it worked :)