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

Members Online

»
0 Active | 8 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: Multiplayer mp_fx.gsc file tool
Shoot
General Member
Since: Jun 22, 2002
Posts: 260
Last: Mar 22, 2008
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Sunday, May. 28, 2006 09:19 pm
After having serveral compile errors due to fat fingered scripting in map_fx.gsc files I decided to create a text based tool to be able to copy and paste out of into the fx files for my multiplayer maps - all I have to is place the pieces in the correct part of the fx file and replace the (x,y,z) with the correct coordinates. I haven't changed the delay times from what they were in the stock maps so I don't know exact effects from changing those.

They are listed in based on the following criteria - each entry has 2 lines.
The first line goes in the precacheFX() code portion - second part goes in the ambientFX() portion as follows:

Code:
main()
{
precacheFX();
ambientFX();
}
precacheFX()
{
level._effect[........ ( a line is required for each effect)
}
ambientFX()
{
maps\_fx::loopfx(..... (line is required for each position the effect is played at)
maps\_fx::soundfx(..... (line is required for each postion the sound is played at)
}


Here is the contents of the file:

Fog
----------------------

level._effect["fogbank_small_duhoc"] = loadfx ("fx/misc/fogbank_small_duhoc.efx");
maps\mp\_fx::loopfx("fogbank_small_duhoc", (X,Y,Z), 2, (X,Y,Z));

level._effect["fogbank_hidecliff_duhoc"] = loadfx ("fx/misc/fogbank_hidecliff_duhoc.efx");
maps\_fx::loopfx("fogbank_hidecliff_duhoc", (X,Y,Z), 1, (X,Y,Z));

Smoke
----------------------

level._effect["battlefield_smokebank_S"] = loadfx ("fx/smoke/battlefield_smokebank_S.efx");
maps\mp\_fx::loopfx("battlefield_smokebank_S", (X,Y,Z), 1, (X,Y,Z));

level._effect["thin_light_smoke_L"] = loadfx "fx/smoke/thin_light_smoke_L.efx");
maps\mp\_fx::loopfx("thin_light_smoke_L", (X,Y,Z), 1, (X,Y,Z));

level._effect["thin_light_smoke_M"] = loadfx ("fx/smoke/thin_light_smoke_M.efx");
maps\mp\_fx::loopfx("thin_light_smoke_M", (X,Y,Z), 1, (X,Y,Z));

level._effect["thin_black_smoke_M"] = loadfx ("fx/smoke/thin_black_smoke_M.efx");
maps\mp\_fx::loopfx("thin_black_smoke_M", (X,Y,Z), 1, (X,Y,Z));

level._effect["thin_black_smoke_S"] = loadfx ("fx/smoke/thin_black_smoke_S.efx");
maps\mp\_fx::loopfx("thin_black_smoke_S", (X,Y,Z), 0.6, (X,Y,Z));

level._effect["smoke_plumeBG"] = loadfx ("fx/smoke/smoke_plumeBG_toujane.efx");
maps\mp\_fx::loopfx("smoke_plumeBG", (X,Y,Z), 1, (X,Y,Z));

Dust
----------------------

level._effect["dust_wind"] = loadfx("fx/dust/dust_wind_eldaba.efx");
maps\mp\_fx::loopfx("dust_wind", (X,Y,Z), 1, (X,Y,Z));

level._effect["dust_wind_night"] = loadfx ("fx/dust/dust_wind_night.efx");
maps\mp\_fx::loopfx("dust_wind_night", (X,Y,Z), .6, (X,Y,Z));

level._effect["dust_wind_brown"] = loadfx ("fx/dust/dust_wind_brown.efx");
maps\_fx::loopfx("dust_wind_brown", (X,Y,Z), 0.3, (X,Y,Z));

Snow
----------------------

***(snow_light is a global effect)***
level._effect["snow_light"] = loadfx ("fx/misc/snow_light_mp_downtown.efx");
maps\mp\_fx::loopfx("snow_light", (X,Y,Z), 0.8, (X,Y,Z));

level._effect["snow_wind_cityhall"] = loadfx ("fx/misc/snow_wind_cityhall.efx");
maps\mp\_fx::loopfx("snow_wind_cityhall", (X,Y,Z), 0.5, (X,Y,Z));

Building Fire
----------------------

level._effect["building_fire_small"] = loadfx ("fx/fire/building_fire_small.efx");
maps\mp\_fx::loopfx("building_fire_small", (X,Y,Z), 2, (X,Y,Z));

level._effect["building_fire_large"] = loadfx ("fx/fire/building_fire_large.efx");
maps\mp\_fx::loopfx("building_fire_large", (X,Y,Z), 2, (X,Y,Z));

Tank Fire
----------------------

level._effect["tank_fire_engine"] = loadfx ("fx/fire/tank_fire_engine.efx");
maps\mp\_fx::loopfx("tank_fire_engine", (X,Y,Z), 1, (X,Y,Z));

level._effect["tank_fire_turret"] = loadfx ("fx/fire/tank_fire_turret_small.efx");
maps\mp\_fx::loopfx("tank_fire_turret", (X,Y,Z), 1, (X,Y,Z));

level._effect["tank_fire_turret_large"] = loadfx ("fx/fire/tank_fire_turret_large.efx");
maps\mp\_fx::loopfx("tank_fire_turret_large", (X,Y,Z), 1, (X,Y,Z));

level._effect["med_oil_fire"] = loadfx ("fx/fire/med_oil_fire.efx");
maps\_fx::loopfx("med_oil_fire", (X,Y,Z), 2, (X,Y,Z));

Sounds
----------------------

maps\mp\_fx::soundfx("bigfire", (X,Y,Z));
maps\mp\_fx::soundfx("medfire", (X,Y,Z));
maps\mp\_fx::soundfx("smallfire", (X,Y,Z));

Misc
----------------------

level._effect["insects_carcass_flies"] = loadfx ("fx/misc/insects_carcass_flies.efx");
maps\mp\_fx::loopfx("insects_carcass_flies", (X,Y,Z), 0.3, (X,Y,Z));




It is possible to create custom effect call names so you can keep track of multiple things based on the effect name - the only issue here is ou need to precache each one as the call name will be different from the others even though it is actually playing the same effect.
Example:
Code:
main()
{
precacheFX();
ambientFX();
}
precache()
{
	level._effect["effect-call-name"] = loadfx ("fx/effecttypedir/actual-effect-file-name.efx");
}
ambientFX()
{
	maps\_fx::loopfx("effect-call-name", (X1,Y1,Z1), delay, (X2,Y2,Z2));
}



Actual Code example:
Code:
main()
{
precacheFX();
ambientFX();
}

precacheFX()
{
level._effect["tank1_fire"] = loadfx ("fx/fire/ground_fire_med_nosmoke.efx");
level._effect["tank2_fire"] = loadfx ("fx/fire/ground_fire_med_nosmoke.efx");
level._effect["crater1_fire"] = loadfx (("fx/fire/ground_fire_med_nosmoke.efx");
level._effect["crater2_fire"] = loadfx (("fx/fire/ground_fire_med_nosmoke.efx");
level._effect["crater3_fire"] = loadfx (("fx/fire/ground_fire_med_nosmoke.efx");
level._effect["sw_corner_smoke"] = loadfx ("fx/smoke/battlefield_smokebank_S.efx");
level._effect["center_smoke"] = loadfx ("fx/smoke/battlefield_smokebank_S.efx");
level._effect["east_side_smoke"] = loadfx ("fx/smoke/battlefield_smokebank_S.efx");
}

ambientFX()
{
	maps\mp\_fx::loopfx("tank1_fire", (X,Y,Z), 2, (X,Y,Z));
	maps\mp\_fx::soundfx("medfire", (X,Y,Z));

	maps\mp\_fx::loopfx("tank2_fire", (X,Y,Z), 2, (X,Y,Z));
	maps\mp\_fx::soundfx("medfire", (X,Y,Z));

	maps\mp\_fx::loopfx("crater1_fire", (X,Y,Z), 2, (X,Y,Z));
	maps\mp\_fx::soundfx("medfire", (X,Y,Z));

	maps\mp\_fx::loopfx("crater2_fire", (X,Y,Z), 2, (X,Y,Z));
	maps\mp\_fx::soundfx("medfire", (X,Y,Z));

	maps\mp\_fx::loopfx("crater3_fire", (X,Y,Z), 2, (X,Y,Z));
	maps\mp\_fx::soundfx("medfire", (X,Y,Z));

	maps\mp\_fx::loopfx("sw_corner_smoke", (X,Y,Z), 2, (X,Y,Z));

	maps\mp\_fx::loopfx("center_smoke", (X,Y,Z), 2, (X,Y,Z));

	maps\mp\_fx::loopfx("east_side_smoke", (X,Y,Z), 2, (X,Y,Z));
}


I would only recommend this in complicated fx.gsc files - as you can also group things by comment statments
to do this with also - simply place // in front of the comment line or code - everything after the // will be ignored
You will notice in this example that some are as lines denoting a section of code in the ambientFX() section and others are commenting an individual line - either is effective.

example:
Code:
main()
{
precacheFX();
ambientFX();
}

precacheFX()
{
level._effect["ground_fire_med_nosmoke"] = loadfx ("fx/fire/ground_fire_med_nosmoke.efx");
level._effect["battlefield_smokebank_S"] = loadfx ("fx/smoke/battlefield_smokebank_S.efx");
}

ambientFX()
{
//tank1
	maps\mp\_fx::loopfx("ground_fire_med_nosmoke", (X,Y,Z), 2, (X,Y,Z));
	maps\mp\_fx::soundfx("medfire", (X,Y,Z));
//tank2
	maps\mp\_fx::loopfx("ground_fire_med_nosmoke", (X,Y,Z), 2, (X,Y,Z));
	maps\mp\_fx::soundfx("medfire", (X,Y,Z));
//crater1
	maps\mp\_fx::loopfx("ground_fire_med_nosmoke", (X,Y,Z), 2, (X,Y,Z));
	maps\mp\_fx::soundfx("medfire", (X,Y,Z));
//crater2
	maps\mp\_fx::loopfx("ground_fire_med_nosmoke", (X,Y,Z), 2, (X,Y,Z));
	maps\mp\_fx::soundfx("medfire", (X,Y,Z));
//crater3
	maps\mp\_fx::loopfx("ground_fire_med_nosmoke", (X,Y,Z), 2, (X,Y,Z));
	maps\mp\_fx::soundfx("medfire", (X,Y,Z));
//smoke
	maps\mp\_fx::loopfx("battlefield_smokebank_S", (X,Y,Z), 2, (X,Y,Z));    //sw corner
	maps\mp\_fx::loopfx("battlefield_smokebank_S", (X,Y,Z), 2, (X,Y,Z));	//center
	maps\mp\_fx::loopfx("battlefield_smokebank_S", (X,Y,Z), 2, (X,Y,Z));	//east side
}


Both methods accomplish the exact same result - custom effect call names or by using the //
It is all up to you and what you prefer.

Happy mapping.....
Shoot...Out

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

»