Mortar Field

From Valve Developer Community
Revision as of 16:29, 14 November 2005 by Mxthe (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

By Mxthe


Warming Up

We need various entities to make the mortarfield work...

This is a technique i used in 2 of my maps, fy_battlefield and fy_ww1

Theses maps were not really, maps they were more like...Examples

Here are to download them.

http://www.pcgamemods.com/mod/12220.html

The idea of that mortarfield is, to make explosions move parented to an invisible platform wich moves around the map, and the explosions blow at radom time, with an incoming sound before.


The Movement

The invisible platform must be a func_tracktrain,

Create a 128 X 128 nodraw brush , thin, and tie it to func_Tracktrain.

Name : MortarTrain

DisableShadow : yes

DisableReceivingShadows : yes

FirstStopTarget : MortarTrack1

StartSpeed : 500

MaxSpeed : 500

Go in flags, and check :

No Pitch (X-rot)

No User Control

Passable


Then place various path_track around the map, wherever you want your mortar to blow randomly, his path must finally come back to its starting position.

Name the first path_track : MortarTrack1


The Explosion

Above the platform, place various env_explosion, 3 at the base, diagonally placed, then up and up until one env_explosion on the top, put it like a pyramid, put some space between the env_Explosions so it wont be too concentrate. When they are place, select them all and :

Name : ExplosionMortar1

Parent : MortarTrain

Magnitude : 180 (Its small, but there are a lot, so its a lot)

Go in flags, and check Repeatable

Now you got a quite big explosion, if its too big for your taste delete a few env_explosion.

Now if you want more effect, you can add an env_shooter and make it shoot gibs of rocks.

Parent the env_shooter to MortarTrain

And pick the model from the debris folder

Simulate a physic and choose the rest.

The Sounds

So now, we should have an explosion moving around the map, but we want some sounds like an incoming sound.

Put an ambient_generic, in the air approximatively in the center of all the env_Explosions.

Name : MortarIncomming1

Sound : Search for the mortar incomming sound

Volume : 10

MaxAudibleDistance : 4500

SourceEntityName : MortarTrain

Then if you want another sound for when the mortar explodes, you can put a new ambient_generic and do the same.

Making It Blow

To make it blow, is the best part.

Place a logic_timer somewhere in your map:

UseRandomTime : yes

MinimumInterval : You can choose

MaximumInterval : You can choose too

Then go in outputs :

Ontimer : MortarIncomming1 Playsound Delay 0

OnTimer : ExplosionMortar1 Explode Delay 1

And thats it, if you put an env_shooter, just add

Ontimer : Env_shooter Shoot, Delay 1

Allright compile and its done!