Fixing the Dropship gun: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(added lang subpage and preparing multipage.)
No edit summary
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{language subpage}}
{{LanguageBar}}
 
== Introduction ==
== Introduction ==
This article explains the process of fixing the [[Npc_combinedropship|Dropship]] gun's broken rotation in Source.
In {{hl2|4}}, at launch (2004) to {{src06|1}}, the Dropship gun rotation was functional, but after Valve ported Half-Life 2 to the New Engine (since {{src07|1}}/Orange Box), the Dropship gun rotation was completely broken, preventing it from shooting unless the player stands in the front of the Dropship. This issue was fixed on PC in 2022, but remains unfixed on console port ({{360}}, {{ps3}}), aswell as the SDK itself ({{srcsdk07|1}}, {{srcsdk13|1|nt=0}}).
 
This article explains the process of fixing {{ent|npc_combinedropship}} gun rotation being broken in Source engine.


== Fixing the Gun's Rotation ==
== Fixing the Gun's Rotation ==
Copy the contents of [https://github.com/DKmaster16/HL2_GRAI/blob/master/src/game/server/hl2/npc_combinedropship.cpp this page], (courtesy of [https://www.moddb.com/downloads/gameplay-rebalance-ai GRAI+]) and use it to replace {{path|src/game/server/hl2/npc_combinedropship.cpp}} — '''You're done!'''  
Copy the contents of [https://github.com/DKmaster16/HL2_GRAI/blob/master/src/game/server/hl2/npc_combinedropship.cpp this page], (courtesy of [https://www.moddb.com/downloads/gameplay-rebalance-ai GRAI+]) and use it to replace {{path|src/game/server/hl2/npc_combinedropship|cpp}} — '''You're done!'''  


Alternatively, if you wish to edit the code, the main change it does is add these two lines at the top of CNPC_CombineDropship::UpdateContainerGunFacing, immediately following the assertion statement:
Alternatively, if you wish to edit the code, the main change it does is add these two lines at the top of CNPC_CombineDropship::UpdateContainerGunFacing, immediately following the assertion statement:
<source lang=cpp>
<syntaxhighlight lang=cpp>
m_poseWeapon_Pitch = m_hContainer->LookupPoseParameter("weapon_pitch");
m_poseWeapon_Pitch = m_hContainer->LookupPoseParameter("weapon_pitch");
m_poseWeapon_Yaw = m_hContainer->LookupPoseParameter("weapon_yaw");
m_poseWeapon_Yaw = m_hContainer->LookupPoseParameter("weapon_yaw");
</source>
</syntaxhighlight>


{{Tip|If you're developing a Source 2013 mod, you could opt to use a [https://developer.valvesoftware.com/wiki/Source_SDK_2013_community_repos community repo,] and have bugs like these fixed by default.}}
{{Tip|If you're developing a {{src13|3.1}} mod, you could opt to use a [https://developer.valvesoftware.com/wiki/Source_SDK_2013_community_repos community repo], that has bugs like these fixed by default.}}
[[Category:Half-Life 2 NPCs|D]] [[Category:Flying NPCs|D]]
[[Category:Bug fixes]]

Latest revision as of 02:22, 10 April 2025

English (en)Translate (Translate)

Introduction

In Half-Life 2 Half-Life 2, at launch (2004) to Source 2006, the Dropship gun rotation was functional, but after Valve ported Half-Life 2 to the New Engine (since Source 2007/Orange Box), the Dropship gun rotation was completely broken, preventing it from shooting unless the player stands in the front of the Dropship. This issue was fixed on PC in 2022, but remains unfixed on console port (Xbox 360, PlayStation 3), aswell as the SDK itself (Source SDK Base 2007, Source SDK 2013).

This article explains the process of fixing npc_combinedropship gun rotation being broken in Source engine.

Fixing the Gun's Rotation

Copy the contents of this page, (courtesy of GRAI+) and use it to replace 🖿src/game/server/hl2/npc_combinedropship.cppYou're done!

Alternatively, if you wish to edit the code, the main change it does is add these two lines at the top of CNPC_CombineDropship::UpdateContainerGunFacing, immediately following the assertion statement:

m_poseWeapon_Pitch = m_hContainer->LookupPoseParameter("weapon_pitch");
m_poseWeapon_Yaw = m_hContainer->LookupPoseParameter("weapon_yaw");
Tip.pngTip:If you're developing a Source 2013 mod, you could opt to use a community repo, that has bugs like these fixed by default.