This Example map will show you how to make 3 different mouse-controlled guns/turrets in Counter-Strike: Source, resembling the old func_tanks from CS 1.6.Edit 052311:
Upgrades!
-
Combine Machine gun NOW works in MP game with bots. Used a different parenting method using a logic_measure_movement, where you place an env_spark on the same location as the info target, parent the env_spark to the gun, and then you use Logic_measure_movemement to use the env_spark to measure the location of the info_target.
This workaround was brought to my attention by
[frank] at interlopers. Thanks [frank]!
-Added trigger_hurt to
Combine Masheen gun, so now it does damage! =)
-Added sound, and muzzleflash to
Combine Masheen gun, following
Waffle Turret Tutorial!
Rooom for Improvement
-Trigger_hurt for
Combine Masheen Gun "times out" after like 4-5 seconds, in which case you simply take your finger off the mouse button and repress. Don't know why this happens, since it is set to
Disble ONLY on
UnpressedAttack.. =/
-get shell ejection to work on
Combine Masheen Gun-extending the range of the minigun
-help increasing the rate of fire of the 105mm cannon
-sometimes, the 105mm cannon bullets "bounce" off targets before exploding. Setting the flag "Break immediately on physics" solves this problem, but then, cannon rounds do no damage fsr..
-Would like to figure out how to "point" the turrets at a different direction than "east" once it spawns.
Note: this map is meant to be played in Counter-Strike: Source, but i use materials and models from HL2. All the content is included in the BSP using PackBSP, so if you needed to, you could extract the textures/models from it (when editing the vmf). DEVELOPMENT texture by Rimrook, and CT_DEV textures from my 3D palette based on that same texture by Rim
Minigun and 105mm Cannon
The 105mm Cannon and Minigun are built by
EnnergyFilms. I modified them slightly improving the prefabs a bit(still far from done), and parenting the func_physbox to a base rather than being parented/measured by a trigger_multiple. He has downloads for the original prefabs in the full comments.
The 105mm Cannon's controls are a bit buggy, but they work fairly ok. I'm also trying to improve the explosive attributes of the shells, to make them more consistent in their destructive capability. Another thing i would like to add this is to make the shells rapid-fire.
The minigun works pretty good but has a limited range fsr.
If you have any ideas on how to make these better, please let me know!
Combine Masheen gun
This one I built from scratch, following a video tutorial by
TopHattWaffle. (no example download available) Also i learned how to add sound, shell ejection, and a muzzle flash from
Waffle's Waffle Turret tutorial.
Thanks TophattWaffle!This mouse-controlled turret by waffle, will behave almost exactly to the old func_tanks from cs 1.6!
A couple issues: I can't get the shell ejection to work and also, the trigger hurt will "time out" after like 4-5 seconds fsr. (works again on repressing the mouse button).
I plan on using all these mouse-controllable turrets for care packages in my upcoming nuketown map. the minigun will be mounted on a moving Blackhawk helicopter and the rocket launcher will be meant to simulate a 105MM cannon on a circling AC-130 gunship.
CHANGELOG
EDIT 051811:
Upgrades and fixes
- combine masheen gun parenting issue SOLVED. Manually parenting info_target to gun doesn't work. Instead, a logic_auto(OnSpawnMap - <info target name> - setparent - gun), solves the parenting glitch. (this is how waffle said to do it in the tutorial, but i screwed it up by ALSO manually parenting the info_target to the gun.
The above parenting method only works in a sp game loaded from the console. Once you create a server and add bots, it won't work anymore. Another workaround forthcoming.
Still Needs Work
-extending the range of the minigun
-help increasing the rate of fire of the 105mm cannon
-sometimes, the 105mm cannon bullets "bounce" off targets before exploding. Setting the flag "Break immediately on physics" solves this problem, but then, cannon rounds do no damage fsr..
-need to parent trigger_hurt to combine masheen gun. (env_gunfire does no damage by itself)
EDIT 051411:
Multiple Changes
-improved destructive consistency of 105mm cannon
-improved 105mm cannon model
-added spawns to test func_tank effectiveness against bots and destructible func_phsbox blocks
-fixed "make_triangles:calc_triangle_representation: Cannot convert" error
-PackBSP'd custom content to bsp(for those without HL2)
Still Needs Work
-extending the range of the minigun
-info_target parenting problem with
combine masheen gun. (gun shoots at origin no matter what)
-help increasing the rate of fire of the 105mm cannon
I'm looking forward into seeing this in your nuketown map