Mortar Field: Difference between revisions
No edit summary |
No edit summary |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
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 <code>func_tracktrain</code>. Create a thin 128 × 128 [[unit]] <code>nodraw</code> brush and tie it to <code>func_tracktrain</code>. | |||
Name : MortarTrain | |||
DisableShadow : yes | |||
DisableReceivingShadows : yes | |||
FirstStopTarget : MortarTrack1 | |||
StartSpeed : 500 | |||
MaxSpeed : 500 | |||
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 <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. | |||
Name the first <code>path_track</code> <code>MortarTrack1</code>. | |||
==Rigging the explosion== | |||
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. | |||
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 <code>Repeatable</code>. | |||
Now you've got a quite big explosion. If it's too big for your taste, delete a few <code>env_explosion</code> entities. | |||
If you want more effect, you can add an <code>env_shooter</code> and make it shoot gibs of rocks when the explosion occurs. | |||
# Parent the <code>env_shooter</code> to <code>MortarTrain</code>. | |||
# 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. | |||
Put an <code>ambient_generic</code> in the air, approximately in the center of all the <code>env_explosion</code> 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: | Place a <code>logic_timer</code> somewhere in your map: | ||
UseRandomTime : yes | 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 : | Ontimer : Env_shooter Shoot, Delay 1 | ||
Now, compile it and you should have a working mortar field! | |||
==See also== | |||
* [http://www.pcgamemods.com/mod/12220.html Downloadable example map] | |||
[[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_explosion
s 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.
- Parent the
env_shooter
toMortarTrain
. - 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.
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!