Game Development Community

Projectile Spread Center (Solved)

by Jonathan Noyola · in Torque 3D Beginner · 09/01/2010 (7:32 am) · 3 replies

Does projectile spread do what we think it does?
Take a close look at this image.
torque.abigholeintheweb.com/public_system/useruploads/projectile_spread_issue.jpgThe projectile spread is supposed to be centered around the middle of the crosshairs, but instead it's centered around the bottom-right of the crosshairs. I looked through my (stock T3D) code, and it seems to me like it should be working correctly, but it's not. Please post any help.

About the author

I've been programming for 10 years now. Proficient in many programming languages. Stanford '16: BS CS, BS Math, MS CS (Artificial Intelligence). Favorite games: GW2, LoL, Borderlands, NWN2


#2
09/07/2010 (10:19 am)
Could you post what the cause and solution was?
Comes in handy if someone else runs into the same issue.
#3
09/07/2010 (3:06 pm)
Yes, I forgot to do that.
The reason was that the gun wasn't pointing where the crosshairs were, and it seems to me like correctMuzzleVector doesn't do anything.
So, in scripts/server/weapon.cs in WeaponImage::onFire at about line 182,
change this
initialPosition = %obj.getMuzzlePoint(%slot);
to this
initialPosition = %this.correctMuzzleVector ? %obj.getEyePoint() : %obj.getMuzzlePoint(%slot);