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

Members Online

»
0 Active | 66 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 subscribe
Author Topic: i need to know how to place custom fx in a map
iCoDMapping360
General Member
Since: Feb 22, 2011
Posts: 87
Last: May 19, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Tuesday, May. 17, 2011 06:18 pm
i have a custom fx of a flickering light i have tried everything it just wont happen i get punkbuster is disable script compile error
Share |
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 1293
Last: Jul 9, 2016
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Tuesday, May. 17, 2011 07:05 pm
I just posted this in another thread. It will work just the same, just change the names of the FX. Adding custom FX are the same as stock FX.

There are many ways to add FX to your map. This is only " 1 " way to do it.




Pick out an FX that you want to use.

1. Navigate to the following path: Call of Duty 4 - Modern Warfare\raw\maps\mp

2. Create a new text file in the " mp " folder. Change the file extension to .gsc. Name this file: mp_yourmapname_fx.gsc

3. Open this file and place the following inside it:
Code:
main()
{
	level._effect[ "fire_sm" ]	= loadfx( "fire/firelp_small_dl_c" );
}


Let's say you had two fx. It would simply look like this:
Code:
main()
{
	level._effect[ "fire_sm" ]	= loadfx( "fire/firelp_small_dl_c" );
	level._effect[ "fire_light" ]	= loadfx( "fire/fire_light" );
}


This file is what your map needs to load your fx's. Now what you want to do is edit the line or lines to fit your fx's you want to use.




In the first example, level._effect[ "fire_sm" ], what is highlighted in red is kinda like an alias or generic name you as the mapper gets to create.




Let's say I was adding a waterfall. I would change what's in red to " waterfall ". Or, whatever you want, just as long as you know what it is. We will need to reference this alias later.




Now, the second part is the actual effect that needs to be loaded. Here is where you define what effect you want to use.
= loadfx( "fire/firelp_small_dl_c" ); What is highlighted in red is the path and file of the fx.
My new line would look like this:
Code:
main()
{
	level._effect[ "waterfall" ]	= loadfx( "misc/waterfall_hunted" );
}



As you can see, you are only editing what is in red.




4. Once you have your fx loaded, save and close it. Since you've just created a new file, your map needs to know about it. We need to load this new .gsc now from your main map .gsc.




5. Navigate to: Call of Duty 4 - Modern Warfare\raw\maps\mp and open your maps main .gsc " mp_yourmapname.gsc ". In the place where you load your scripts add this new script using the following line.
Code:
	maps\mp\mp_yourmapname_fx::main();





6. Save and close. Now your zone file needs to know about it. This way it can pack that script into your FF file. Open your zone file and add the following line:
Code:
rawfile,maps/mp/mp_yourmapname_fx.gsc



7. Now we need to define where these fx would play in the map. Navigate to: Call of Duty 4 - Modern Warfare\raw\maps\createfx and if the " createfx " folder doesn't exist, create it. In this folder create a new text file and change the extension to .gsc. What is important here is that we are naming this script the same name as the other script we've created. The only difference is, they are in different paths. Name the file:
mp_yourmapname_fx.gsc

8. Open this script and paste the following:
Code:
//_createfx generated. Do not touch!!
main()
{	
	ent = maps\mp\_utility::createOneshotEffect( "misc/waterfall_hunted" );	
	ent.v[ "origin" ] = ( -2432, -826, 98 );
	ent.v[ "angles" ] = ( 270, 0, 0 );
	ent.v[ "fxid" ] = "waterfall";
	ent.v[ "delay" ] = -1;
	ent.v[ "soundalias" ] = "";
}


As you can see, I've already edited the lines. Look at how they match up with the line that loads the effect. This is how it is done. Pay attention to the pattern.




main()


{


ent = maps\mp\_utility::createOneshotEffect( "misc/waterfall_hunted" );


ent.v[ "origin" ] = ( -2432, -826, 98 );


ent.v[ "angles" ] = ( 270, 0, 0 );


ent.v[ "fxid" ] = "waterfall";


ent.v[ "delay" ] = -1;


ent.v[ "soundalias" ] = "";


}




Since we don't have coordinates yet, which we will get soon, just leave the default (x,y,z) coordinates in there. The angles ( 270, 0, 0 ) shows that this effect with play just as it does in the FX editor, by default. Use these default angles first before you edit this line. Most effects will use these angles. Now that we have a place for the effect to play you can save and close.
Just like your first script, if you wanted to add another place for an fx to play, you can simply copy the code like this:
Code:
//_createfx generated. Do not touch!!
main()
{	
	ent = maps\mp\_utility::createOneshotEffect( "misc/waterfall_hunted" );	
	ent.v[ "origin" ] = ( -2432, -826, 98 );
	ent.v[ "angles" ] = ( 270, 0, 0 );
	ent.v[ "fxid" ] = "waterfall";
	ent.v[ "delay" ] = -1;
	ent.v[ "soundalias" ] = "";

	ent = maps\mp\_utility::createOneshotEffect( "misc/waterfall_hunted" );	
	ent.v[ "origin" ] = ( -2432, -826, 98 );
	ent.v[ "angles" ] = ( 270, 0, 0 );
	ent.v[ "fxid" ] = "waterfall";
	ent.v[ "delay" ] = -1;
	ent.v[ "soundalias" ] = "";
}


Obviously they both wouldn't be identical, it is just for example purposes only. You can see the line about the soundalias? If you have a soundalias and your fx needs to make a sound, you would plug in your soundalias between the quotes.




9. Navigate to: Call of Duty 4 - Modern Warfare\raw\maps\mp and open your maps main .gsc " mp_yourmapname.gsc ". In the place where you load your scripts add this new script using the following line. Notice the change in the path.
Code:
	maps\createfx\mp_yourmapname_fx::main();





10. Save and close. Now your zone file needs to know about it. This way it can pack that script into your FF file. Open your zone file and add the following line:
Code:
rawfile,maps/createfx/mp_yourmapname_fx.gsc


11. Now open up radiant and navigate to the place where you want the fx to play. Right click the 2D window and create a script > origin. Move the origin into place. Deselect the origin, and then reselect it. Press N. Collect the (x,y,z) and paste them into the FX file that now needs our coordinates. The file we want is located in the createfx folder. If you paste the coordinates from radiant, you will have to add back in the commas, or the map will give you an error on load. Save and close the script. You can leave in that script origin if you want as a place holder, but if your map is high in entities, just delete it. I would suggest deleting the origin once you get your fx working and placed ingame.




12. Last thing to do is to add the actual effect to your zone file. Open your zone file and since in this example I used the waterfall effect. You would add the following line to the zone file:
Code:

fx,misc/waterfall_hunted
Share |
iCoDMapping360
General Member
Since: Feb 22, 2011
Posts: 87
Last: May 19, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Tuesday, May. 17, 2011 09:03 pm
Share |
[DAR]TommyToy1074
General Member
Since: Apr 24, 2011
Posts: 72
Last: Nov 6, 2011
[view latest posts]
Level 3
Category: CoD4 MP Mapping
Posted: Tuesday, May. 17, 2011 10:07 pm
I just got this error screen, just not with the punkbuster thing. And it was the way I added the name of the fx. I fixed that and it would play again but still don't have the fx working yet but we are still working on it. You can see my entire thread under " Help using stock waterfall FX" it may help you out.
Share |
Restricted Access Topic is Locked 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

»