Shooting anything in abstract form

This tutorial will show you how to shoot almost anything.

Bullets
Make an and use this table as a reference for the settings for each weapon. Since  won't do damage, the damage should be done with a.


 * AirboatGunImpact
 * BloodImpact
 * cball_bounce
 * cball_explode
 * GlassImpact
 * HelicopterImpact
 * StunstickImpact
 * WaterSurfaceExplosion

Projectiles

 * 1) Make an entity from the list below and name it  (or whatever you want).
 * 2) Make a, name it  and set Template 1 to.
 * 3) Make an, and configure it however is needed for your projectile and use case (i.e. fire a crossbow bolt when a button is pressed).

Punting
Making a fake gravity gun punt is actually not terribly complex, though this setup is not quite 1-to-1. If the gravity gun-like object you're making is able to move, remember to parent all the triggers, visual effects, etc. to whatever the moving part is.

Make a over the area an object should have to be in to get punted. It should be very thin. Set these properties:

Set the flags how you wish, you'll probably want Physics Objects checked.

Make a inside the. Name it. Set the same flags, and make these outputs:

Make a, name it , set these outputs:

The last output won't do anything except temporarily disable the relay, to act as a refire rate. You can adjust the rate by changing the delay. Make sure Allow fast retrigger is NOT checked! Any other special effects you want should be activated from OnTrigger.

Now for the flashy bits! Make an where you want the punting beam to come from. Make sure it isn't in anything solid. Give it these settings (adjust as you wish, adapted from the Ep2 intro):

Make an and name it. Place it however is necessary so that the laser will point in the direction you want to punt objects.

Make an close to the gun and set these properties:

Make another  closeby and set these properties:

The gun is now fully ready to punt anything in its way. It will push multiple objects at once, but there's no perfect solution to that. When the time is right, send the TouchTest input to gg_checkforpuntables.

Grabbing
Make a similar to the first one, but bigger and longer. If you want to be accurate to the real gun, make it about 900 units long. Set these properties:

Make a and set these:

Make a small at the front of the gun:

Any grab-related effects, like beams, should be activated here from OnStartTouchAll.

Make an near the front of the gun, but a bit farther away than. Name it.

If your gun can move around, you need to make the next three entities so that this  moves with it:
 * Two more s. We'll call them   and.
 * A with these settings:
 * Entity to Measure:
 * Measure Reference:
 * Entity to Move:
 * Movement Reference: (moving part of gun)

Move the s so that they have the same distance between each other, and   and the moving part of the gun.

Make a :

Make a named   and set these:

Any trying-to-grab effects should be activated here from OnTrigger. Make sure Allow fast retrigger is NOT checked.

Make a named   and set these:

Any dropping effects should be activated here from OnTrigger.

To finish, a few sounds. Make an.

Another.

And another.

Last one.

That's everything. When you want to grab stuff, send the Test input to gg_holding. The gun will try to grab objects for up to three seconds before giving up.