source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

Combine Dropship Gun Doesn't Rotate (appeared in 2007)

Open ihonnyboy opened this issue 7 years ago • 2 comments

In npc_combinedropship.cpp, the gun no longer rotates during game play. This completely breaks the dropship holdout in d2_coast_10: it makes it much easier for players to camp the spawn location of the soldiers. It's also frustrating to design levels around.

This bug actually appeared back during the orange box update, so this bug is probably a much deeper issue. The gun rotates just fine in the Source SDK 2006 base, and the code for the gun doesn't look that different. The code seems to checkout, it looks just like the code for vehicles. The .mdl might be the issue (even though it hasn't changed either), so I hooked up a func_tank to the model. The rotation up and down is reversed, but I don't think that would cause the gun to not move period. I can't make sure of this, however, without the source .smd files.

ihonnyboy avatar Jul 25 '16 19:07 ihonnyboy

I also believe the container model has animations for opening/closing the container door, but ingame the door just moves instanteniously

DimasDSF avatar Oct 12 '16 00:10 DimasDSF

The cause of this is that the dropship looks up the pose parameter indices for the weapon using the dropship's own model. It should be using the container model. I fixed this by adding this:

m_poseWeapon_Pitch      = m_hContainer->LookupPoseParameter( "weapon_pitch" );
m_poseWeapon_Yaw        = m_hContainer->LookupPoseParameter( "weapon_yaw" );

To CNPC_CombineDropship::Spawn in the if( m_hContainer ) check.

A proper fix should be done here: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/hl2/npc_combinedropship.cpp#L392-L393

I'm guessing that at one point the container was part of the dropship model, which is why this wasn't a problem before. That, or somebody changed it and used the wrong entity to get the parameters.

SamVanheer avatar Oct 18 '16 18:10 SamVanheer