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

Members Online

»
0 Active | 5 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 MP Mapping
CoD 2 mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: mortar's MP
chasewolf
General Member
Since: Jun 21, 2004
Posts: 161
Last: Mar 8, 2007
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Thursday, Jan. 4, 2007 06:15 am
Hey guys know this guy who has a couple mortar launchers in his map. Havent seen him in awhile and am wondering if anyone else would know how to do this
Share |
KillerKlown75
General Member
Since: Sep 27, 2006
Posts: 39
Last: Jan 31, 2008
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Thursday, Jan. 4, 2007 01:03 pm
I have two mortars in my latest map and to keep it short, I'll just go through what you need to fire the axis mortar (The Allied is exactly the same, but with different objects). Basically, I have the following items in the map:

Mortar Launcher (Script Brushmodel - named axismortar)
Mortar (Script Brushmodel - named axismortarmodel)
CraterOrigin (Script origin - named alliedcraterorigin)
CraterBefore (Script Brushmodel - named alliednocrater)
CraterAfter (Script Brushmodels - named alliedcrater1 and alliedcrater2 )


I hide the crater and the mortar (which is located in the tube of the mortar launcher). Once a player uses the mortar trigger, the launcher plays a noise, a effect, the mortar becomes visible and shoots off into the sky (It then becomes invisible and moves back inside the launcher).

The origin of the crater plays the incoming mortar sound, there is an explosion and depending if this is the first time the mortar is fired, the crater covering is deleted and the crater shown. Here's the code:


// By {FKR}KillerKlown
main()
{
//Set up the effects
level._effect["large_snow_explode1"] = loadfx("fx/explosions/large_snow_explode1.efx");
level._effect["mortar_flash"] = loadfx("fx/muzzleflashes/mortar_flash.efx");

//Hide the axis mortar in the launcher
axismortar = getent("axismortar","targetname");
axismortar hide();

//set the allied terrain
alliedcrater1 = getent ("alliedcrater1","targetname");
alliedcrater2 = getent ("alliedcrater2","targetname");
alliedcrater1 hide();
alliedcrater2 hide();

level.axisMortarFiring = false; // Axis mortar not being fired
level.axisMortarFired = false; // Flag to state if mortar previously fired

thread mortar_axis_start();
}



mortar_axis_start()
{
axistrig = getent("axismortartrigger","targetname");

while (1)
{
axistrig waittill ("trigger");
if (!level.axisMortarFiring)
thread mortar_axis_fire();
}
}



mortar_axis_fire()
{
level.axisMortarFiring = true;
iprintlnBold("Axis mortar launched");
axismortarmodel = getent("axismortarmodel","targetname");
axismortar = getent("axismortar","targetname");

axorigin = axismortarmodel getorigin();
mortorigin = axismortar getorigin();

//Effects for the mortar
axismortarmodel playsound ("mortar_load");
wait 0.5;
axismortarmodel playsound ("mortar_launch");
playfx(level._effect["mortar_flash"], axorigin);

// Launch the mortar into the air, hide it and return to origin
axismortar show();
axismortar moveto ((1975, -1808, 1500),1);
axismortar waittill ("movedone");
axismortar hide();
axismortar moveto ((mortorigin),1);
axismortar waittill ("movedone");

wait 1;

//Get the origin of the crater
alliedcraterorigin = getent("alliedcraterorigin","targetname");
alliedexplosion = alliedcraterorigin getorigin();

alliedcraterorigin playsound("incoming_mortar");
wait 2;
alliedcraterorigin playsound("explosion_ground");

playfx(level._effect["large_snow_explode1"], alliedexplosion);
// Radius damage to kill players in the area (origin, range, maxdistance, mindistance)
radiusDamage(alliedexplosion, 4000, 8000, 1000);
earthquake(0.3, 3, alliedexplosion, 5000);

if (level.axisMortarFired == false)
{
alliedcrater1 = getent("alliedcrater1","targetname");
alliedcrater2 = getent("alliedcrater2","targetname");
alliednocrater = getent ("alliednocrater","targetname");

alliednocrater delete();
alliedcrater1 show();
alliedcrater2 show();

level.axisMortarFired = true;
}

// Wait one minute until it can be fired again
wait 60;
level.axisMortarFiring = false;
}




Hope it's of use.
Share |
chasewolf
General Member
Since: Jun 21, 2004
Posts: 161
Last: Mar 8, 2007
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Thursday, Jan. 4, 2007 09:44 pm
Could you maybe explain a little more on setting up the map items, that would be great, thanks
Share |
KillerKlown75
General Member
Since: Sep 27, 2006
Posts: 39
Last: Jan 31, 2008
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Friday, Jan. 5, 2007 09:54 am
Sure, when I get a spare minute I'll go through the steps and include a few screenies.
Share |
elim
General Member
Since: Feb 6, 2004
Posts: 527
Last: Jan 12, 2011
[view latest posts]
Level 6
Category: CoD2 MP Mapping
Posted: Friday, Jan. 5, 2007 10:08 am
YES

i think i know what you mean i have just done a mortar when you walk close by it but would also like a mortar to fire so will watch this post
Share |
KillerKlown75
General Member
Since: Sep 27, 2006
Posts: 39
Last: Jan 31, 2008
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Saturday, Jan. 6, 2007 05:07 pm
OK, first of all put the xmodel prop_mortar_static into your map and make it a script_model: You'll see from the screenies the targetnames I have given these objects - If you do the same, then the code at the bottom will work for your map as well.




Now put the xmodel prop_mortar_ammunition into your map, make it a script_model and you'll need to rotate it so it fits snugly inside the barrel of the mortar:




Now create a tigger use for the mortar:






Now for the crater. Create a terrain patch, make it a script_brushmodel and use the paint height feature of the patch editor to create a hole in your terrain.




Duplicate the crater brush you just created, apply a crater decal to it and fit it over the crater. Make sure you change the targetname of this script_brushmodel in the entity editor:




Now create a script_origin and place it in the bottom of the crater:




Finally, cover it the crater over with some terrain. Create a terrain patch, make it a script_brushmodel and make sure you fit the patch over the crater by bonding the vertices of the patch to the surrounding terrain:



Then use this code:

// By {FKR}KillerKlown
main()
{
//Set up the effects
level._effect["large_snow_explode1"] = loadfx("fx/explosions/large_snow_explode1.efx");
level._effect["mortar_flash"] = loadfx("fx/muzzleflashes/mortar_flash.efx");

//Hide the axis mortar in the launcher
axismortar = getent("axismortar","targetname");
axismortar hide();

//set the allied terrain
alliedcrater1 = getent ("alliedcrater1","targetname");
alliedcrater2 = getent ("alliedcrater2","targetname");
alliedcrater1 hide();
alliedcrater2 hide();

level.axisMortarFiring = false; // Axis mortar not being fired
level.axisMortarFired = false; // Flag to state if mortar previously fired

thread mortar_axis_start();
}



mortar_axis_start()
{
axistrig = getent("axismortartrigger","targetname");

while (1)
{
axistrig waittill ("trigger");
if (!level.axisMortarFiring)
thread mortar_axis_fire();
}
}



mortar_axis_fire()
{
level.axisMortarFiring = true;
iprintlnBold("Axis mortar launched");
axismortarmodel = getent("axismortarmodel","targetname");
axismortar = getent("axismortar","targetname");

axorigin = axismortarmodel getorigin();
mortorigin = axismortar getorigin();

//Effects for the mortar
axismortarmodel playsound ("mortar_load");
wait 0.5;
axismortarmodel playsound ("mortar_launch");
playfx(level._effect["mortar_flash"], axorigin);

// Launch the mortar into the air, hide it and return to origin
axismortar show();
axismortar moveto ((1975, -1808, 1500),1);
axismortar waittill ("movedone");
axismortar hide();
axismortar moveto ((mortorigin),1);
axismortar waittill ("movedone");

wait 1;

//Get the origin of the crater
alliedcraterorigin = getent("alliedcraterorigin","targetname");
alliedexplosion = alliedcraterorigin getorigin();

alliedcraterorigin playsound("incoming_mortar");
wait 2;
alliedcraterorigin playsound("explosion_ground");

playfx(level._effect["large_snow_explode1"], alliedexplosion);
// Radius damage to kill players in the area (origin, range, maxdistance, mindistance)
radiusDamage(alliedexplosion, 4000, 8000, 1000);
earthquake(0.3, 3, alliedexplosion, 5000);

if (level.axisMortarFired == false)
{
alliedcrater1 = getent("alliedcrater1","targetname");
alliedcrater2 = getent("alliedcrater2","targetname");
alliednocrater = getent ("alliednocrater","targetname");

alliednocrater delete();
alliedcrater1 show();
alliedcrater2 show();

level.axisMortarFired = true;
}

// Wait one minute until it can be fired again
wait 60;
level.axisMortarFiring = false;
}



Share |
chasewolf
General Member
Since: Jun 21, 2004
Posts: 161
Last: Mar 8, 2007
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Sunday, Jan. 7, 2007 03:28 am
Wow killer looks good, been busy but gonna do it will let you know, My Vista just crashed with everything in it. I know I had it backed up, just have to seach 600 gigs to find it. But thank you for your time
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»