Call of Duty 5: Adding FXs: Difference between revisions

From COD Modding & Mapping Wiki
Jump to navigation Jump to search
(New page: Image:Nutshell.png As many of you have discovered, attempting to dynamically spawn your FX like we did in COD4 isnt working in COD5 "as is" because COD5 doesnt use the createfx folder....)
 
mNo edit summary
Line 1: Line 1:
[[Image:Nutshell.png]] As many of you have discovered, attempting to dynamically spawn your FX like we did in COD4 isnt working in COD5 "as is" because COD5 doesnt use the createfx folder. You can completely remove it, or void the GSCs in there and it makes no difference to the map's FX.
[[Image:Nutshell.png]] As many of you have discovered, attempting to dynamically spawn your FX like we did in COD4 isnt working in COD5 "as is" because COD5 doesnt use the createfx folder. You can completely remove it, or void the GSCs in there and it makes no difference to the map's FX.


[[Image:Warning.png]] <font color="red">The code is by no means finished, and is in fact a "WIP", but by this method, you can have a oneshotfx or a loopfx.</font>
[[Image:Warning.png]] <font color="red">The code is by no means finished, and is in fact a "WIP", but by this method, you can have a oneshotfx or a loopfx.</font>


That means, that the arrays defined in createfx aren't built and so have no effect on scripts to trigger FX. So, we have to build our own array's using the code IW gave us.


This is from mp_airfield.gsc. I kept the precache FX level definitions used in Airfield, and did this:
*That means, that the arrays defined in createfx aren't built and so have no effect on scripts to trigger FX. So, we have to build our own array's using the code IW gave us.
*This is from mp_airfield.gsc. I kept the precache FX level definitions used in Airfield, and did this:


<pre>
<pre>
Line 51: Line 52:




[[Image:spawned_fx.jpg]]
[[Image:spawned_fx.jpg|600px|center]]





Revision as of 13:56, 2 December 2008

As many of you have discovered, attempting to dynamically spawn your FX like we did in COD4 isnt working in COD5 "as is" because COD5 doesnt use the createfx folder. You can completely remove it, or void the GSCs in there and it makes no difference to the map's FX.


The code is by no means finished, and is in fact a "WIP", but by this method, you can have a oneshotfx or a loopfx.


  • That means, that the arrays defined in createfx aren't built and so have no effect on scripts to trigger FX. So, we have to build our own array's using the code IW gave us.
  • This is from mp_airfield.gsc. I kept the precache FX level definitions used in Airfield, and did this:
main()
{
----------------- snip -----------------------

	createFX( "oneshotfx", ( 1843, 2485, 10 ), ( 270, 0, 0 ), level._effect["mp_fire_medium"], 1 );
	createFX( "oneshotfx", ( 1843, 2485, -10 ), ( 270, 0, 0 ),level._effect["mp_smoke_column_tall"], 0.05 );

}

createFX( type, origin, angles, FXid, delay )
{
	FX_ent				= spawnstruct();
	FX_ent.v["origin"] 		= origin;
	FX_ent.v["angles"] 		= angles;
	FX_ent.v["up"] 			= anglestoup( FX_ent.v["angles"]);
	FX_ent.v["forward"] 	= anglestoforward( FX_ent.v["angles"] );
	FX_ent.v["FXid"]		= FXid;
	FX_ent.v["delay"]		= delay;
	FX_ent.v["type"]		= type;
	
	if( FX_ent.v["type"] == "loopfx" )
		FX_ent thread loopfxthread();
	if( FX_ent.v["type"] == "oneshotfx" )
		FX_ent thread oneshotfxthread();
	
	
}

loopfxthread()
{
	PlayLoopedFX( self.v["FXid"], self.v["delay"], self.v["origin"] );
}

oneshotfxthread()
{
	self.looper = spawnFx( self.v["FXid"], self.v["origin"] );
	triggerFx( self.looper, self.v["delay"] );
}
  • This gives you this:



  • That's a medium sized fire FX, and a smoke column billowing out of it.

The code is by no means finished, and is in fact a "WIP", but by this method, you can have a oneshotfx or a loopfx.

You could have the code anywhere. Its organisation can be anything you want. As it is, I kept it at the foot of the GSC, but you could have a seperate FX GSC file, and have the lot in there.


by Tally Dec. 2, 2008 05:34 am