Mounted weapon can shoot bullets, laser, blast or rockets. All of types have similar settings. If you want to make laser weapon, make sure you know how to operate env_laser entity. 1. Make sure you have created room with light and info_player_start.
All Mounted Weapons
Mounted Weapon is made of two parts: the moving one (Barrel) and the static func_wall (or func_detail). The static part is a decoration.
1. Make a nice barrel, that will rotate and shoot. It needs some nice brushwork. It can be anything. Double barrel heavy rocket launcher, stationary machine gun or even crossbow-shaped alien gun. The only think you need to know is that func_tank needs origin brush to rotate around.
2. Turn the brush with the origin into: func_tank ---> shoot bullets. func_tanklaser ---> shoot laser beam. func_tankrocket ---> shoot explosive rockets. func_tankmortar ---> produces instant explosion without projectiles.
3. Make the front of the weapon face east in x/y view, and then use YAW compass to specify barrel direction. It's necessary for gun to work properly.
4. Keyvalues to set up: Turret can be automatic (shooting player) or controllable (player can use). Check both keyvalues and flags to achieve desired effect.
name --> it's required to have player controlled turret. yaw rate --> how fast barrel moves horizontally. yaw range --> the range, in degrees, of barrel horizontal movement. pitch rate --> how fast barrel moves vertically. pitch range --> the range, in degrees, of barrel vertical movement. barrel length --> the distance between origin and barrel end (where the bullets comes from) barrel horizontal --> the distance between origin center and barrel width (if origin is already on barrel's center, the value should be set to 0).
barrel vertical --> the distance between origin center and barrel height (if origin center is already on barrel's center, the value should be set to 0).
smoke sprite --> smoke sprite produced. flash sprite --> muzzle flash sprite. sprite scale --> scale of sprites produced. rotate sound --> sound playing when moving barrel. rate of fire --> shoots per second. damage per bullet --> damage dealt by each bullet. firing persistence --> how many seconds the turret will continue shooting after losing player from field of view- automatic turret only. bullet accuracy --> the accuracy of the bullet, multiple options available. minimum target range --> used only for automatic turret. maximum target range --> used only for automatic turret.
Flags different for func_tank types: bullet --> bullet projectiles appearance. env_laser entity --> name of env_laser entity to copy laser settings. Required. explosion magnitude --> explosion magnitude (damage & range).
Func_tankrocket have no special settings.
5. Now let's go into "flags" tab:
active --> make automatic turret active on start. only direct --> fires only if target is in line of sight- automatic turret only. controllable --> turns turret into weapon controllable by player. use relations--> I found this function buggy. Enables all "R ..." keyvalues.
6. To make a mounted weapon controllable place func_tankcontrolls on map, with tank entity name set to func_tank name. This entity works as button for weapon, it must be placed in front of barrel. Also make sure you set controllable flag to true.
Func_tank can be both controllable and automatic. The turret will try to kill players until someone takes control over the weapon. After dismount the func_tank starts to hunt players again.
Monster Controlling Gun
Mounted weapons controlled by monster is an automatic type of func_tank. We need to place a "dummy" monster to simulate control over the gun. 1. Create a func_tank as normal (you can use every type). Name it, and enable active flag.
2. Place a monster on your map. It can be anyone you want. Go to properties and set trigger condition to "death", then set trigger condition target to func_tank name. That makes monster disables func_tank on death.
3. Go to monster flags and set prisoner to true. That disables the AI of opponent so "he can focus on shooting". Any other flags should stay unchecked.
We can achieve similar monster mounting effect using scripted_sequence.
|
|