Call of Duty 5: FXs: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
==Creating your FX== | |||
*Create a GSC file, [[Intro_To_Scripting|Intro To Scripting]] but fill it with the text below instead. | |||
<pre> | <pre> | ||
#include maps\mp\_utility; | #include maps\mp\_utility; | ||
Line 18: | Line 18: | ||
spawnFX() | spawnFX() | ||
{ | { | ||
myEffect = playLoopedFx(level._effect["fx_mp_fire_medium"], 4, (0,0,0), 0, anglestoforward ((270,0,0)), anglestoup((270,0,0))); | |||
} | } | ||
</pre> | </pre> | ||
'''2.''' Save the file as mp_yourmapname_fx.gsc in the same directory as your main script file.<br><br> | |||
'''3.''' Add the below line to your mp_yourmapname.gsc right under "maps\mp\_load::main();". | |||
'''3.''' Add the below line to your mp_yourmapname.gsc right under | |||
<pre> | <pre> | ||
maps\mp\mp_yourmapname_fx::main(); | maps\mp\mp_yourmapname_fx::main(); | ||
</pre> | </pre> | ||
'''4.''' Update your zone file with "rawfile,maps\mp\mp_yourmapname_fx.gsc" if it is missing.<br><br> | |||
===Description of your FX GSC=== | ===Description of your FX GSC=== | ||
'''1.''' Your main function. | |||
<pre> | <pre> | ||
main() | main() | ||
Line 52: | Line 41: | ||
*This can do everything if you want but for organization purposes it is advised you have at least these two functions to separate the steps. | *This can do everything if you want but for organization purposes it is advised you have at least these two functions to separate the steps. | ||
'''2.''' precacheFX() function | |||
<pre> | <pre> | ||
precacheFX() | precacheFX() | ||
Line 62: | Line 51: | ||
*'''loadfx("maps/mp_maps/fx_mp_fire_medium")''' is the path to the tagged FX, notice that there is no extension on the end of the path. | *'''loadfx("maps/mp_maps/fx_mp_fire_medium")''' is the path to the tagged FX, notice that there is no extension on the end of the path. | ||
== spawnFX() function == | |||
<pre> | <pre> | ||
spawnFX() | spawnFX() | ||
{ | { | ||
myEffect = playLoopedFx(level._effect["fx_mp_fire_medium"], 4, (0,0,0), 0, anglestoforward ((270,0,0)), anglestoup((270,0,0))); | |||
} | } | ||
</pre> | </pre> | ||
* | *myEffect = playLoopedFx(level._effect["'''FX Name'''"], '''Repeat Rate in seconds''', ('''position XYZ'''), 0, anglestoforward(('''Front direction XYZ''')), anglestoup(('''Up direction XYZ'''))); | ||
[[Image:Add FX.jpg|400px]] | [[Image:Add FX.jpg|400px]] | ||
Sources: [http://wiki.treyarch.com/wiki/FX_In_A_Map Treyarch's Wiki] | Sources: [http://wiki.treyarch.com/wiki/FX_In_A_Map Treyarch's Wiki] |
Revision as of 19:48, 23 December 2008
Creating your FX
- Create a GSC file, Intro To Scripting but fill it with the text below instead.
#include maps\mp\_utility; main() { precacheFX(); spawnFX(); } precacheFX() { level._effect["mp_fire_medium"] = loadfx("maps/mp_maps/fx_mp_fire_medium"); } spawnFX() { myEffect = playLoopedFx(level._effect["fx_mp_fire_medium"], 4, (0,0,0), 0, anglestoforward ((270,0,0)), anglestoup((270,0,0))); }
2. Save the file as mp_yourmapname_fx.gsc in the same directory as your main script file.
3. Add the below line to your mp_yourmapname.gsc right under "maps\mp\_load::main();".
maps\mp\mp_yourmapname_fx::main();
4. Update your zone file with "rawfile,maps\mp\mp_yourmapname_fx.gsc" if it is missing.
Description of your FX GSC
1. Your main function.
main() { precacheFX(); spawnFX(); }
- This can do everything if you want but for organization purposes it is advised you have at least these two functions to separate the steps.
2. precacheFX() function
precacheFX() { level._effect["mp_fire_medium"] = loadfx("maps/mp_maps/fx_mp_fire_medium"); }
- level._effect["mp_fire_medium"] is the name "mp_fire_medium" that will be referenced by all your scripts, this can be anything.
- loadfx("maps/mp_maps/fx_mp_fire_medium") is the path to the tagged FX, notice that there is no extension on the end of the path.
spawnFX() function
spawnFX() { myEffect = playLoopedFx(level._effect["fx_mp_fire_medium"], 4, (0,0,0), 0, anglestoforward ((270,0,0)), anglestoup((270,0,0))); }
- myEffect = playLoopedFx(level._effect["FX Name"], Repeat Rate in seconds, (position XYZ), 0, anglestoforward((Front direction XYZ)), anglestoup((Up direction XYZ)));
Sources: Treyarch's Wiki