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

Members Online

0 Active | 271 Guests


New BF2 Mod
BF2 General


CoD Mapping
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Adding Mortars and Effects
Versions: You must be logged in to view history.
How to add mortars with a custom GSC for effects
OK first make the area where you want the mortar to land. For example, select the terrain mesh and press Y to bring up the terrain editor. Use the paint height to make the impact hole. Next, right click on the 2d view and go to Script>Model. Leave it as a red box and give it a targetname of mortar. Save the map and compile.

Now for the .gsc file. Create a new txt file, rename it to .gsc and put this into it:
    // Specify two different explosion effects to randomly play
    level._effect["mortar_explosion"][0] = loadfx ("fx/impacts/newimps/dirthit_mortar2day.efx");
    level._effect["mortar_explosion"][1] = loadfx ("fx/impacts/newimps/minefield.efx");
    // send down the mortars
    level thread mortars();

    // Get an array of all the mortars in the level
    mortar = getentarray ("mortar","targetname");
    // Loop over and over while the level is loaded
    while (1)
    // Wait 5-10 seconds randomly before doing a mortar explosion
    wait (5 + randomfloat(5));
    // Make sure there are no players close enough to this mortar to kill them
    GoodPosition = false;
    while (!GoodPosition)
    // Pick a random mortar location
    rand = randomint(mortar.size);
    // Check if any players are within 200 of the randomly picked mortar
    GoodPosition = true;
    players = getentarray("player", "classname");
    for(i = 0; i < players.size; i++)
    if (distance(mortar[rand].origin,players[i].origin) < 200)
    GoodPosition = false;
    // Play the incomming mortar sound effect
    mortar[rand] playsound("mortar_incoming");
    // Wait 2 seconds while the imcomming sound plays
    wait 2;
    // Do the explosion effect
    origin = mortar[rand] getorigin();
    playfx (level._effect["mortar_explosion"][randomint(2)], origin);
    // Play the explosion sound
    mortar[rand] playsound("mortar_explosion");
    // Make the explosion cause damage
    radiusDamage(mortar[rand].origin, 300, 2000, 50);

Save it and call it mortar.gsc. Now add this line into the mybspname.gsc to add it to your own map:
And that’s it….simple wasn’t it? You can download the .pk3 file from the Supplements section that contains every thing that I used to make the tutorial along with the .map file.
You can check out the page here.

This tutorial was written by adwamslayer (email).

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