View Single Post
Author Message
sarysa
Senior Member
Join Date: Mar 2014
Old 11-21-2014 , 13:52   [TF2] Reorienting a sentry gun
Reply With Quote #1

It's really only useful for an aesthetic, but in the neverending quest to find new ways to mess with engineers in Freak Fortress 2, I figured out this hidden prop:

Code:
		// force the angle now
		new angleOffsetB = FindSendPropInfo("CObjectSentrygun", "m_iAmmoShells") - 16;
		new angleOffsetA = angleOffsetB - 12;
		SetEntDataVector(sentry, angleOffsetA, Sentry_CurrentAngle[sentryIdx]);
		SetEntDataVector(sentry, angleOffsetB, Sentry_CurrentAngle[sentryIdx]);
A couple things to keep in mind:
- It needs to be done every frame or a sentry will slowly revert to the closest target.
- The gun will fire normally only if the closest target is within a certain angle deviation from its reticle.
- Wrangler will either completely block this or result in a race condition.

Still, it can be used for fun mods that mess with players...like making the gun always face the engie. My particular use is to have the gun appear to go haywire.
__________________
sarysa is offline