Mortar Field: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
''By Mxthe''
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.


__TOC__
==Making the platform==


The invisible platform must be a <code>func_tracktrain</code>. Create a thin 128 &times; 128 [[unit]] <code>nodraw</code> brush and tie it to <code>func_tracktrain</code>.


== Warming Up ==
Name : MortarTrain
 
DisableShadow : yes
We need various entities to make the mortarfield work...
DisableReceivingShadows : yes
 
FirstStopTarget : MortarTrack1
This is a technique i used in 2 of my maps, fy_battlefield and fy_ww1
StartSpeed : 500
 
MaxSpeed : 500
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 :
Go in flags, and check :


No Pitch (X-rot)
* No Pitch (X-rot)
 
* No User Control
No User Control
* Passable  
 
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.
Then place various <code>path_track</code> entities around the map (wherever you want your mortar to blow randomly). Their path must finally come back to its starting position.


Now if you want more effect, you can add an env_shooter and make it shoot gibs of rocks.
Name the first <code>path_track</code> <code>MortarTrack1</code>.


Parent the env_shooter to MortarTrain
==Rigging the explosion==


And pick the model from the debris folder
Above the platform, place various <code>env_explosion</code> entities. Make it so that there are three at the base placed diagonally, then up and up until there is only one <code>env_explosion</code> on the top of the stack. In other words, make it look like a pyramid of entities. However, leave some space between the <code>env_explosion</code>s so it wont be too concentrated.


Simulate a physic and choose the rest.
When they are place, select all of them and give them the following properties:


== The Sounds ==
Name : ExplosionMortar1
Parent : MortarTrain
Magnitude : 180 (Its small, but there are a lot, so its a lot)


So now, we should have an explosion moving around the map, but we want some sounds like an incoming sound.
Go in flags, and check <code>Repeatable</code>.


Put an ambient_generic, in the air approximatively in the center of all the env_Explosions.
Now you've got a quite big explosion. If it's too big for your taste, delete a few <code>env_explosion</code> entities.


Name : MortarIncomming1
If you want more effect, you can add an <code>env_shooter</code> and make it shoot gibs of rocks when the explosion occurs.


Sound : Search for the mortar incomming sound
# Parent the <code>env_shooter</code> to <code>MortarTrain</code>.
# Pick the model from the debris folder.
# Simulate a physic and choose the rest.


Volume : 10
==Adding the sound effect==


MaxAudibleDistance : 4500
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.


SourceEntityName : MortarTrain
Put an <code>ambient_generic</code> in the air, approximately in the center of all the <code>env_explosion</code> entities.


Then if you want another sound for when the mortar explodes, you can put a new ambient_generic and do the same.
Name : MortarIncoming1
Sound : The incoming mortar sound
Volume : 10
MaxAudibleDistance : 4500
SourceEntityName : MortarTrain


== Making It Blow ==
Then, if you want another sound for when the mortar hits, you can put another ambient_generic in.


To make it blow, is the best part.
==Tying it all together==


Place a logic_timer somewhere in your map:
Place a <code>logic_timer</code> somewhere in your map:


UseRandomTime : yes
UseRandomTime : yes
MinimumInterval : Your choice
MaximumInterval : Your choice


MinimumInterval : You can choose
Then go in outputs:


MaximumInterval : You can choose too
Ontimer : MortarIncoming1  Playsound Delay 0
OnTimer : ExplosionMortar1 Explode  Delay 1


Then go in outputs :
If you want to put an env_shooter in, just add


Ontimer : MortarIncomming1 Playsound Delay 0
Ontimer : Env_shooter Shoot, Delay 1


OnTimer : ExplosionMortar1 Explode  Delay 1
Now, compile it and you should have a working mortar field!


And thats it, if you put an env_shooter, just add
==See also==


Ontimer : Env_shooter Shoot, Delay 1
* [http://www.pcgamemods.com/mod/12220.html Downloadable example map]


Allright compile and its done!


[[Category:Level Design]]
[[Category:Level Design]]
[[Category:Tutorials]]

Latest revision as of 03:06, 12 June 2022

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 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 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 path_track MortarTrack1.

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 Repeatable.

Now you've got a quite big explosion. If it's too big for your taste, delete a few env_explosion entities.

If you want more effect, you can add an env_shooter and make it shoot gibs of rocks when the explosion occurs.

  1. Parent the env_shooter to MortarTrain.
  2. Pick the model from the debris folder.
  3. 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.

Put an ambient_generic in the air, approximately in the center of all the env_explosion entities.

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

Place a 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!

See also