A mortar field is an invisible platform which moves around the map, combined with random explosions on the area of the platform and a sound effect of an incoming mortar strike just before it hits.
Making the platform
The invisible platform must be a
func_tracktrain. Create a thin 128 × 128 unit
nodraw brush and tie it to
Name : MortarTrain DisableShadow : yes DisableReceivingShadows : yes FirstStopTarget : MortarTrack1 StartSpeed : 500 MaxSpeed : 500
Go in flags, and check :
- No Pitch (X-rot)
- No User Control
Then place various
path_track entities around the map (wherever you want your mortar to blow randomly). Their path must finally come back to its starting position.
Name the first
Rigging the explosion
Above the platform, place various
env_explosion entities. Make it so that there are three at the base placed diagonally, then up and up until there is only one
env_explosion on the top of the stack. In other words, make it look like a pyramid of entities. However, leave some space between the
env_explosions so it wont be too concentrated.
When they are place, select all of them and give them the following properties:
Name : ExplosionMortar1 Parent : MortarTrain Magnitude : 180 (Its small, but there are a lot, so its a lot)
Go in flags, and check
Now you've got a quite big explosion. If it's too big for your taste, delete a few
If you want more effect, you can add an
env_shooter and make it shoot gibs of rocks when the explosion occurs.
- Parent the
- Pick the model from the debris folder.
- Simulate a physic and choose the rest.
Adding the sound effect
Now we should have an explosion moving around the map, but we want to add something to make it sound like an incoming mortar strike.
ambient_generic in the air, approximately in the center of all the
Name : MortarIncoming1 Sound : The incoming mortar sound Volume : 10 MaxAudibleDistance : 4500 SourceEntityName : MortarTrain
Then, if you want another sound for when the mortar hits, you can put another ambient_generic in.
Tying it all together
logic_timer somewhere in your map:
UseRandomTime : yes MinimumInterval : Your choice MaximumInterval : Your choice
Then go in outputs:
Ontimer : MortarIncoming1 Playsound Delay 0 OnTimer : ExplosionMortar1 Explode Delay 1
If you want to put an env_shooter in, just add
Ontimer : Env_shooter Shoot, Delay 1
Now, compile it and you should have a working mortar field!