View Single Post
Afronanny
Veteran Member
Join Date: Aug 2009
Old 06-17-2010 , 15:44   Re: [TF2] Homing Rocket
Reply With Quote #4

Fun idea, but a better way to code this would be with the Think hook with SDKHooks rather than doing all this expensive code in OnGameFrame. SDKHooks would be much quicker and would use far less resources (you don't need all these timers and an array of tries for each player). I've done homing rockets in SourcePawn using SDKHooks, it works wonders. The reason I suggest that you use SDKHooks is because tries have excellent lookup times, but can become sluggish when adding more keys to them.

If you want an example of decent tracking code, take a look at TFDodgeball's tracking code. The only thing you'll have to compensate for is the CBaseEntity::FVisible function, because there's no way to pass a NULL double pointer CBaseEntity into a SDKCall from sourcepawn as of now, but a TraceRay can be used to make up for that (I think KAC has some decent visibility-checking code in the anti-wallhack module )

Also, instead of setting the angles and velocity with SetEntPropVector, take a look at TeleportEntity


That is all.

Last edited by Afronanny; 06-17-2010 at 17:35.
Afronanny is offline