Fixing first time HL2DM compile problems: Difference between revisions
No edit summary |
(Rewrite Template:Lang to Template:LanguageBar. This action was performed by a bot.) |
||
(6 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{LanguageBar|Fixing first time HL2DM compile problems}} | |||
==The Error== | ==The Error== | ||
Line 25: | Line 27: | ||
<syntaxhighlight lang="cpp">return OnTakeDamage_Alive( info );</syntaxhighlight> | <syntaxhighlight lang="cpp">return OnTakeDamage_Alive( info );</syntaxhighlight> | ||
This will correct all the errors throughout the project. | This will correct all the errors throughout the project. | ||
Line 37: | Line 37: | ||
This may be to-do with this fix or not, but the side effect I get is the game window minimises and maximises rapidly, and to stop it, you need to Start+D out of it once it is assumed the menu loads up, then click back on the "Moddnamehere" in the stat bar to get it back up. | This may be to-do with this fix or not, but the side effect I get is the game window minimises and maximises rapidly, and to stop it, you need to Start+D out of it once it is assumed the menu loads up, then click back on the "Moddnamehere" in the stat bar to get it back up. | ||
If your mod fails you in any aspects, follow this https://developer.valvesoftware.com/wiki/Compiling_under_VS2008#Fix_grenade_tripmine.cpp | |||
[[Category:Tutorials]] | [[Category:Tutorials]] | ||
[[Category:Programming]] | [[Category:Programming]] | ||
[[Category:Help]] | [[Category:Help]] |
Latest revision as of 17:52, 18 July 2025
The Error
If this is the first time you compiled a HL2DM project you may get an error that looks like this:
Build: 1 succeeded, 1 failed, 0 up-to-date 0, skipped
And somewhere in the output log, you will may or may-not have something something similar to this:
2>grenade_tripmine.cpp 2>.\hl2mp\grenade_tripmine.cpp(276) : error C2039: 'OnTakeDamage_Alive' : is not a member of 'CBaseGrenade' 2> c:\moddir\src\game\shared\basegrenade_shared.h(34) : see declaration of 'CBaseGrenade'
This is not your fault, it is a code error!
The Fix
The problem is to do with this small code block being defined wrongly:
return BaseClass::OnTakeDamage_Alive( info );
It should actually look like this:
return OnTakeDamage_Alive( info );
This will correct all the errors throughout the project.
Then hit build solution, and you will have your mod up and running!
Notes
This may be to-do with this fix or not, but the side effect I get is the game window minimises and maximises rapidly, and to stop it, you need to Start+D out of it once it is assumed the menu loads up, then click back on the "Moddnamehere" in the stat bar to get it back up.
If your mod fails you in any aspects, follow this https://developer.valvesoftware.com/wiki/Compiling_under_VS2008#Fix_grenade_tripmine.cpp