Author Topic: Making Q2 SP mod, code fails to compile  (Read 11027 times)

Offline EmeraldTiger

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
  • Rated:
Making Q2 SP mod, code fails to compile
« on: March 23, 2011, 10:32:28 AM »
I`m trying to create a SP Mod for Quake 2 with some new weapons and enemies. So I downloaded the source code and have been trying to add a new weapon called the Perforator, which shoots projectiles that have large amounts of knockback, much like Painkiller`s stake gun. I`m pretty new to C++ / C but I`m mainly taking bits and pieces from other part`s of id`s code to help me out.

I`ve been following these tutorials located here:

http://webadvisor.aupr.edu/noc/Othertutorials/MSGBoardTuts/adding%20new%20weapons.htm
http://webadvisor.aupr.edu/noc/Othertutorials/MSGBoardTuts/new%20weapons%20part%20two.htm

I admittedly did some things differently on purpose since my weapon is different but mostly I tried to keep in mind what he was saying. The closest weapon to the Perforator is the RL so I copied the Rocket Launcher`s code in p_weapon.c and made some changes such as removing the splash damage and adding kick. (I`m assuming that`s knockback, right?) Now, when I go to compile it, it does not succeed in compiling, failing to produce a gamex86.dll like I am wanting. I am using Microsoft Visual Basic Studio 2008.

Why is it not working for me? Why is my compiler so -sensitive- to errors? Is there a way to continue compiling regardless of warnings / errors just so I can get it to work? Please, I really need your help! Thanks so much in advance!

 :help:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline reaper

  • Opulent Member
  • *
  • Posts: 2872
  • Nice night for a walk, eh? - Nice night for a walk
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #1 on: March 23, 2011, 11:23:56 AM »
I believe someone has a tutorial on compiling the code which gets rid of unneeded warnings and sets up the compiler right.  Maybe you could post the compilation errors?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy

Offline EmeraldTiger

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #2 on: March 23, 2011, 12:08:05 PM »
Here it is. Interestingly enough the compiler is pointing out warnings for files I didn`t even modify. The only things I messed with were the files mentioned in the tutorial in the two links I gave earlier. And I`m sure I was careful, putting brackets where they need to be, etc. So clearly it`s not my fault.

Code: [Select]
1>------ Build started: Project: game, Configuration: Release Win32 ------
1>Compiling...
1>q_shared.c
1>.\q_shared.c(266) : warning C4100: 'f' : unreferenced formal parameter
1>.\q_shared.c(418) : warning C4100: 'p' : unreferenced formal parameter
1>.\q_shared.c(418) : warning C4100: 'emaxs' : unreferenced formal parameter
1>.\q_shared.c(418) : warning C4100: 'emins' : unreferenced formal parameter
1>.\q_shared.c(876) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>.\q_shared.c(897) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>.\q_shared.c(923) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\q_shared.c(1056) : warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'vsprintf'
1>.\q_shared.c(1112) : warning C4127: conditional expression is constant
1>.\q_shared.c(1230) : warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'vsprintf'
1>.\q_shared.c(1234) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>.\q_shared.c(1264) : warning C4127: conditional expression is constant
1>.\q_shared.c(1308) : warning C4127: conditional expression is constant
1>.\q_shared.c(1334) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>p_weapon.c
1>.\p_weapon.c(1448) : error C2059: syntax error : ')'
1>.\p_weapon.c(1449) : error C2059: syntax error : ')'
1>.\p_weapon.c(1462) : warning C4013: 'fire_perforator' undefined; assuming extern returning int
1>.\p_weapon.c(1467) : error C2065: 'MZ_PERFORATOR' : undeclared identifier
1>p_view.c
1>.\p_view.c(42) : warning C4100: 'angles' : unreferenced formal parameter
1>p_trail.c
1>p_hud.c
1>.\p_hud.c(234) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\p_hud.c(245) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>p_client.c
1>.\p_client.c(46) : warning C4127: conditional expression is constant
1>.\p_client.c(70) : warning C4100: 'self' : unreferenced formal parameter
1>.\p_client.c(179) : warning C4100: 'damage' : unreferenced formal parameter
1>.\p_client.c(179) : warning C4100: 'kick' : unreferenced formal parameter
1>.\p_client.c(179) : warning C4100: 'other' : unreferenced formal parameter
1>.\p_client.c(179) : warning C4100: 'self' : unreferenced formal parameter
1>.\p_client.c(211) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\p_client.c(504) : warning C4100: 'point' : unreferenced formal parameter
1>.\p_client.c(849) : warning C4127: conditional expression is constant
1>.\p_client.c(934) : warning C4100: 'point' : unreferenced formal parameter
1>.\p_client.c(934) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\p_client.c(934) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\p_client.c(1382) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\p_client.c(1387) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>.\p_client.c(1427) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>m_tank.c
1>.\m_tank.c(49) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_tank.c(288) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_tank.c(288) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_tank.c(753) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_tank.c(753) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_tank.c(753) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_supertank.c
1>.\m_supertank.c(452) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_supertank.c(452) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_supertank.c(657) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_supertank.c(657) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_supertank.c(657) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_supertank.c(657) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_soldier.c
1>.\m_soldier.c(409) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_soldier.c(409) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_soldier.c(409) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_soldier.c(792) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_soldier.c(1144) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_soldier.c(1144) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_parasite.c
1>.\m_parasite.c(65) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_parasite.c(275) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_parasite.c(275) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_parasite.c(275) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_parasite.c(471) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_parasite.c(471) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_parasite.c(471) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_mutant.c
1>.\m_mutant.c(62) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_mutant.c(308) : warning C4100: 'surf' : unreferenced formal parameter
1>.\m_mutant.c(308) : warning C4100: 'plane' : unreferenced formal parameter
1>.\m_mutant.c(496) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_mutant.c(496) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_mutant.c(496) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_mutant.c(574) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_mutant.c(574) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_mutant.c(574) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_move.c
1>m_medic.c
1>.\m_medic.c(116) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_medic.c(317) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_medic.c(317) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_medic.c(317) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_medic.c(413) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_medic.c(413) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_medic.c(413) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\m_medic.c(494) : warning C4100: 'eta' : unreferenced formal parameter
1>m_insane.c
1>.\m_insane.c(477) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_insane.c(477) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_insane.c(477) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_insane.c(581) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_insane.c(581) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_insane.c(581) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_infantry.c
1>.\m_infantry.c(215) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_infantry.c(215) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_infantry.c(215) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_infantry.c(299) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_infantry.c(386) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_infantry.c(386) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_infantry.c(386) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\m_infantry.c(466) : warning C4100: 'eta' : unreferenced formal parameter
1>m_hover.c
1>.\m_hover.c(43) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_hover.c(487) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_hover.c(487) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_hover.c(541) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_hover.c(541) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_hover.c(541) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_gunner.c
1>.\m_gunner.c(46) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_gunner.c(283) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_gunner.c(283) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_gunner.c(335) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_gunner.c(335) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_gunner.c(335) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\m_gunner.c(409) : warning C4100: 'eta' : unreferenced formal parameter
1>m_gladiator.c
1>.\m_gladiator.c(49) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_gladiator.c(240) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_gladiator.c(240) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_gladiator.c(240) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_gladiator.c(308) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_gladiator.c(308) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_gladiator.c(308) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_flyer.c
1>.\m_flyer.c(52) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_flyer.c(531) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_flyer.c(531) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_flyer.c(531) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_flyer.c(564) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_flyer.c(564) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_flyer.c(564) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_flyer.c(564) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_float.c
1>.\m_float.c(41) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_float.c(566) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_float.c(566) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_float.c(566) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_float.c(603) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_float.c(603) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_float.c(603) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_float.c(603) : warning C4100: 'inflictor' : unreferenced formal parameter
1>Generating Code...
1>f:\quake 2 folder\source code\quake2-3.21\game\p_hud.c(423) : warning C4701: potentially uninitialized local variable 'cells' used
1>Compiling...
1>m_flipper.c
1>.\m_flipper.c(223) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_flipper.c(223) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_flipper.c(223) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_flipper.c(327) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_flipper.c(332) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_flipper.c(332) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_flipper.c(332) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_flash.c
1>m_chick.c
1>.\m_chick.c(266) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_chick.c(266) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_chick.c(353) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_chick.c(353) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_chick.c(353) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\m_chick.c(430) : warning C4100: 'eta' : unreferenced formal parameter
1>.\m_chick.c(619) : warning C4100: 'other' : unreferenced formal parameter
1>m_brain.c
1>.\m_brain.c(48) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_brain.c(542) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_brain.c(542) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_brain.c(542) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_brain.c(586) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_brain.c(586) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_brain.c(586) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_boss32.c
1>.\m_boss32.c(555) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_boss32.c(555) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_boss32.c(601) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_boss32.c(673) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_boss32.c(673) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_boss32.c(673) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_boss31.c
1>.\m_boss31.c(31) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
1>.\m_boss31.c(416) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_boss31.c(416) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_boss31.c(560) : warning C4100: 'self' : unreferenced formal parameter
1>.\m_boss31.c(589) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_boss31.c(589) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_boss31.c(589) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_boss31.c(589) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_boss3.c
1>.\m_boss3.c(31) : warning C4100: 'activator' : unreferenced formal parameter
1>.\m_boss3.c(31) : warning C4100: 'other' : unreferenced formal parameter
1>m_boss2.c
1>.\m_boss2.c(470) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_boss2.c(470) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_boss2.c(507) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_boss2.c(507) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_boss2.c(507) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_boss2.c(507) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_berserk.c
1>.\m_berserk.c(39) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_berserk.c(222) : warning C4100: 'self' : unreferenced formal parameter
1>.\m_berserk.c(315) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_berserk.c(315) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_berserk.c(381) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_berserk.c(381) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_berserk.c(381) : warning C4100: 'inflictor' : unreferenced formal parameter
1>m_actor.c
1>.\m_actor.c(230) : warning C4100: 'damage' : unreferenced formal parameter
1>.\m_actor.c(230) : warning C4100: 'kick' : unreferenced formal parameter
1>.\m_actor.c(339) : warning C4100: 'point' : unreferenced formal parameter
1>.\m_actor.c(339) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\m_actor.c(339) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\m_actor.c(401) : warning C4100: 'activator' : unreferenced formal parameter
1>.\m_actor.c(401) : warning C4100: 'other' : unreferenced formal parameter
1>.\m_actor.c(496) : warning C4100: 'surf' : unreferenced formal parameter
1>.\m_actor.c(496) : warning C4100: 'plane' : unreferenced formal parameter
1>g_weapon.c
1>.\g_weapon.c(455) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_weapon.c(845) : warning C4127: conditional expression is constant
1>g_utils.c
1>.\g_utils.c(130) : warning C4127: conditional expression is constant
1>.\g_utils.c(396) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_utils.c(553) : warning C4127: conditional expression is constant
1>g_turret.c
1>.\g_turret.c(278) : warning C4100: 'point' : unreferenced formal parameter
1>g_trigger.c
1>.\g_trigger.c(66) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_trigger.c(72) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_trigger.c(72) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_trigger.c(111) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_trigger.c(111) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_trigger.c(189) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_trigger.c(212) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_trigger.c(326) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_trigger.c(394) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_trigger.c(394) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_trigger.c(455) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_trigger.c(455) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_trigger.c(468) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_trigger.c(468) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_trigger.c(532) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_trigger.c(532) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_trigger.c(566) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_trigger.c(566) : warning C4100: 'plane' : unreferenced formal parameter
1>g_target.c
1>.\g_target.c(26) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_target.c(26) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_target.c(58) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_target.c(58) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_target.c(93) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>.\g_target.c(121) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>.\g_target.c(123) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>.\g_target.c(118) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_target.c(118) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_target.c(154) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_target.c(189) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_target.c(244) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_target.c(338) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_target.c(380) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_target.c(380) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_target.c(416) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_target.c(416) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_target.c(451) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_target.c(451) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_target.c(523) : warning C4127: conditional expression is constant
1>.\g_target.c(576) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_target.c(687) : warning C4127: conditional expression is constant
1>.\g_target.c(679) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_target.c(679) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_target.c(785) : warning C4100: 'other' : unreferenced formal parameter
1>g_svcmds.c
1>.\g_svcmds.c(249) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
1>.\g_svcmds.c(251) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
1>.\g_svcmds.c(255) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
1>g_spawn.c
1>.\g_spawn.c(380) : warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(324) : see declaration of 'sscanf'
1>.\g_spawn.c(424) : warning C4127: conditional expression is constant
1>.\g_spawn.c(433) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>.\g_spawn.c(543) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>.\g_spawn.c(544) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>.\g_spawn.c(554) : warning C4127: conditional expression is constant
1>.\g_spawn.c(812) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_spawn.c(819) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>.\g_spawn.c(822) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(157) : see declaration of 'strncpy'
1>g_save.c
1>.\g_save.c(281) : warning C4054: 'type cast' : from function pointer 'void (__cdecl *)(void)' to data pointer 'byte *'
1>.\g_save.c(227) : warning C4100: 'f' : unreferenced formal parameter
1>.\g_save.c(378) : warning C4054: 'type cast' : from function pointer 'void (__cdecl *)(void)' to data pointer 'byte *'
1>.\g_save.c(470) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
1>.\g_save.c(475) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_save.c(496) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
1>.\g_save.c(636) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
1>.\g_save.c(645) : warning C4054: 'type cast' : from function pointer 'void (__cdecl *)(void)' to data pointer 'void *'
1>.\g_save.c(691) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
1>.\g_save.c(714) : warning C4054: 'type cast' : from function pointer 'void (__cdecl *)(void)' to data pointer 'void *'
1>.\g_save.c(727) : warning C4127: conditional expression is constant
1>g_phys.c
1>g_monster.c
1>.\g_monster.c(91) : warning C4100: 'kick' : unreferenced formal parameter
1>.\g_monster.c(440) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_monster.c(483) : warning C4100: 'other' : unreferenced formal parameter
1>Generating Code...
1>f:\quake 2 folder\source code\quake2-3.21\game\g_utils.c(215) : warning C4706: assignment within conditional expression
1>f:\quake 2 folder\source code\quake2-3.21\game\g_utils.c(232) : warning C4706: assignment within conditional expression
1>Compiling...
1>g_misc.c
1>.\g_misc.c(31) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_misc.c(31) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(104) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_misc.c(104) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(130) : warning C4100: 'point' : unreferenced formal parameter
1>.\g_misc.c(130) : warning C4100: 'damage' : unreferenced formal parameter
1>.\g_misc.c(130) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\g_misc.c(130) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\g_misc.c(281) : warning C4100: 'point' : unreferenced formal parameter
1>.\g_misc.c(281) : warning C4100: 'damage' : unreferenced formal parameter
1>.\g_misc.c(281) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\g_misc.c(281) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\g_misc.c(342) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_misc.c(342) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_misc.c(422) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_misc.c(422) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_misc.c(545) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_misc.c(545) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(593) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_misc.c(593) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(665) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_misc.c(683) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_misc.c(683) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(745) : warning C4100: 'point' : unreferenced formal parameter
1>.\g_misc.c(745) : warning C4100: 'damage' : unreferenced formal parameter
1>.\g_misc.c(809) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_misc.c(814) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_misc.c(814) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(873) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_misc.c(873) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_misc.c(966) : warning C4100: 'point' : unreferenced formal parameter
1>.\g_misc.c(966) : warning C4100: 'damage' : unreferenced formal parameter
1>.\g_misc.c(966) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\g_misc.c(1021) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_misc.c(1021) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(1157) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_misc.c(1157) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(1217) : warning C4100: 'point' : unreferenced formal parameter
1>.\g_misc.c(1217) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\g_misc.c(1217) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\g_misc.c(1330) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_misc.c(1330) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_misc.c(1330) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(1358) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(1452) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_misc.c(1452) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(1577) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_misc.c(1577) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(1700) : warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\time.inl(114) : see declaration of 'localtime'
1>.\g_misc.c(1740) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_misc.c(1783) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_misc.c(1783) : warning C4100: 'plane' : unreferenced formal parameter
1>g_main.c
1>.\g_main.c(149) : warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'vsprintf'
1>.\g_main.c(161) : warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'vsprintf'
1>.\g_main.c(234) : warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(207) : see declaration of 'strdup'
1>.\g_main.c(236) : warning C4996: 'strtok': This function or variable may be unsafe. Consider using strtok_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(166) : see declaration of 'strtok'
1>.\g_main.c(240) : warning C4996: 'strtok': This function or variable may be unsafe. Consider using strtok_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(166) : see declaration of 'strtok'
1>.\g_main.c(253) : warning C4996: 'strtok': This function or variable may be unsafe. Consider using strtok_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\string.h(166) : see declaration of 'strtok'
1>g_items.c
1>.\g_items.c(44) : warning C4211: nonstandard extension used : redefined extern to static
1>.\g_items.c(45) : warning C4211: nonstandard extension used : redefined extern to static
1>.\g_items.c(46) : warning C4211: nonstandard extension used : redefined extern to static
1>.\g_items.c(706) : warning C4100: 'item' : unreferenced formal parameter
1>.\g_items.c(762) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_items.c(762) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_items.c(893) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_items.c(893) : warning C4100: 'other' : unreferenced formal parameter
1>g_func.c
1>.\g_func.c(428) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_func.c(428) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_func.c(436) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_func.c(436) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_func.c(600) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_func.c(600) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_func.c(606) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_func.c(606) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_func.c(737) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_func.c(743) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_func.c(743) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_func.c(755) : warning C4100: 'point' : unreferenced formal parameter
1>.\g_func.c(755) : warning C4100: 'damage' : unreferenced formal parameter
1>.\g_func.c(755) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\g_func.c(949) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_func.c(980) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_func.c(980) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_func.c(1113) : warning C4100: 'point' : unreferenced formal parameter
1>.\g_func.c(1113) : warning C4100: 'damage' : unreferenced formal parameter
1>.\g_func.c(1113) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\g_func.c(1125) : warning C4100: 'surf' : unreferenced formal parameter
1>.\g_func.c(1125) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_func.c(1633) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_func.c(1699) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_func.c(1777) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_func.c(1825) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_func.c(1825) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_func.c(1886) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_func.c(1886) : warning C4100: 'other' : unreferenced formal parameter
1>.\g_func.c(1960) : warning C4100: 'point' : unreferenced formal parameter
1>.\g_func.c(1960) : warning C4100: 'damage' : unreferenced formal parameter
1>.\g_func.c(1960) : warning C4100: 'inflictor' : unreferenced formal parameter
1>.\g_func.c(2037) : warning C4100: 'activator' : unreferenced formal parameter
1>.\g_func.c(2037) : warning C4100: 'other' : unreferenced formal parameter
1>g_combat.c
1>.\g_combat.c(370) : warning C4100: 'attacker' : unreferenced formal parameter
1>.\g_combat.c(370) : warning C4100: 'targ' : unreferenced formal parameter
1>g_cmds.c
1>.\g_cmds.c(34) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_cmds.c(57) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_cmds.c(58) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_cmds.c(722) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_cmds.c(725) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_cmds.c(808) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_cmds.c(809) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_cmds.c(810) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_cmds.c(821) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_cmds.c(828) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>.\g_cmds.c(893) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        F:\Quake 2 Folder\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
1>.\g_cmds.c(897) : warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>g_chase.c
1>g_ai.c
1>.\g_ai.c(61) : warning C4127: conditional expression is constant
1>.\g_ai.c(771) : warning C4100: 'dist' : unreferenced formal parameter
1>Generating Code...
1>f:\quake 2 folder\source code\quake2-3.21\game\g_combat.c(249) : warning C4701: potentially uninitialized local variable 'index' used
1>f:\quake 2 folder\source code\quake2-3.21\game\g_combat.c(209) : warning C4701: potentially uninitialized local variable 'power' used
1>f:\quake 2 folder\source code\quake2-3.21\game\g_func.c(859) : warning C4706: assignment within conditional expression
1>Build log was saved at "file://f:\Quake 2 Folder\Source Code\quake2-3.21\game\intermediates\BuildLog.htm"
1>game - 3 error(s), 381 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

If anyone knows of how to solve this (such as what reaper mentioned), that will be greatly appreciated. :yessign:
« Last Edit: March 23, 2011, 12:17:37 PM by EmeraldTiger »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1373
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #3 on: March 23, 2011, 04:04:01 PM »
The C4xxx warnings you can pretty much ignore. They are about minor inconsistencies in the code, C4100 for instance means a parameter was passed in function arguments but wasn't used in the function, a very minor problem but Q2 uses a lot of functions with the same arguments, never worrying about using them or not.

C4127 means the conditional expression to terminate a loop is constant, a potential infinite loop. The truth of the matter is many times in the code you will see:
while(1) {
...
// do something in here and break the loop when a condition is met
...
}

The while(1) is an infinite loop unless you code a way out of it. The MS compiler doesn't look at that as an acceptable style for some reason. Perhaps they don't want their developers using while(1), I don't know.

If you want to edit the code and keep the warning, change while(1) to for ( ; ; ) It does exactly the same thing and the compiler is happy to oblige.

If you want a clean compile, put the following at the top of q_shared.h:


// q_shared.h -- included first by ALL program modules

#ifdef _WIN32
#pragma warning(disable : 4244)   // C4244 conversion from 'type1' to 'type2', possible loss of data
#pragma warning(disable : 4100)   // C4100 unreferenced formal parameter
#pragma warning(disable : 4127)   // C4127 conditional expression is constant
#if _MSC_VER > 1500
#pragma warning(disable : 4996)   // disable warnings from VS about 'unsafe' CRT functions.
#endif
#endif


These pragmas are commands to the MS compiler to ignore those warnings in all modules that will be including q_shared.h.

Your errors on the other hand are the real problem. You left out a semicolon or some other trivial syntax error and the compiler choked on that. The point in the file where the compiler detected the error is line 1448 and 1449 of p_weapon.c, look for your error in that line or a line or two above it. The VC2008 IDE can help you find matching parentheses when you put the cursor on them.

.\p_weapon.c(1448) : error C2059: syntax error : ')'
1>.\p_weapon.c(1449) : error C2059: syntax error : ')'
1>.\p_weapon.c(1462) : warning C4013: 'fire_perforator' undefined; assuming extern returning int
1>.\p_weapon.c(1467) : error C2065: 'MZ_PERFORATOR' : undeclared identifier


You failed to define MZ_PERFORATOR. The MZ_* constants are enumerated in q_shared.h, you can search them out and add your constant to that list.
You didn't define or you improperly defined fire_perforator or you forgot to write a prototype for it and it's defined after the point in the code where you call it. This is called a forward reference, you referred to it before the compiler knows what it is. Add the function prototype in g_local.h or create a perforator.h file.

Q2 coding standards were very loose. They scattered a lot of stuff around sometimes and put stuff related to some functions all into g_local.h or even put function prototypes just ahead of the point of use just to make the compiler happy, probably intending to fix it later but never getting back to it. This is why adding a new weapon or feature can be so much fun and the tutorials have you messing around so much with other source files.


Syntax error ) means you opened a parenthetical but didn't close it or added an extra one.
All these are in p_weapon.c where you probably added your new weapon.

Apply the pragmas, recompile and you should be able to see the serious stuff where you went wrong. Repost the new error list if you still have problems.

QW
« Last Edit: March 23, 2011, 04:25:04 PM by QwazyWabbit »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline EmeraldTiger

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #4 on: March 23, 2011, 04:52:12 PM »
I have the Perforator weapon defined in g_local.h, so I`m not sure what is causing it to make a forward reference. I referred to it in the index section:

Code: [Select]
#define WEAP_PERFORATOR 12
And in the means of death section (34, after mod_target_blaster which is 33)

Code: [Select]
#define MOD_PERFORATOR 34
And I`m not sure how I should set up a file focusing on one specific weapon, as with perforator.h like you mentioned. I`m not sure about the syntax errors either. Luckily, since all of these errors seem to be in p_weapon.c I`ll post the code for the section for my new weapon, maybe there is something I have overseen. It is strange though because the code was copied, I did not build it from the ground up, so there`s less likelihood of errors since I`m using code that is "correct".

Here is the code for my new weapon, in p_weapon.c: (I fixed some things such as the mz* thing by using the mz* of the railgun, there`s probably other errors though)

Code: [Select]
/*
======================================================================

PERFORATOR

======================================================================
*/

void Weapon_Perforator_Fire (edict_t *ent)
{
vec3_t offset, start;
vec3_t forward, right;
int damage;
int kick;

damage = 50;
kick = 400;
if (is_quad)
{
damage *= 4;
}

AngleVectors (ent->client->v_angle, forward, right, NULL);

VectorScale (forward, -2, ent->client->kick_origin);
ent->client->kick_angles[0] = -1;

VectorSet(offset, 8, 8, ent->viewheight-8);
P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start);
fire_perforator (ent, start, forward, damage, 650, kick);

// send muzzle flash
gi.WriteByte (svc_muzzleflash);
gi.WriteShort (ent-g_edicts);
gi.WriteByte (MZ_RAILGUN | is_silenced);
gi.multicast (ent->s.origin, MULTICAST_PVS);

ent->client->ps.gunframe++;

PlayerNoise(ent, start, PNOISE_WEAPON);

if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
ent->client->pers.inventory[ent->client->ammo_index]--;
}

void Weapon_Perforator (edict_t *ent)
{
static int pause_frames[] = {25, 33, 42, 50, 0};
static int fire_frames[] = {5, 0};

Weapon_Generic (ent, 4, 12, 50, 54, pause_frames, fire_frames, Weapon_Perforator_Fire);
}

New error list:
Code: [Select]
1>------ Build started: Project: game, Configuration: Release Win32 ------
1>Linking...
1>   Creating library .\..\release/gamex86.lib and object .\..\release/gamex86.exp
1>p_weapon.obj : error LNK2019: unresolved external symbol _fire_perforator referenced in function _Weapon_Perforator_Fire
1>..\release\gamex86.dll : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://f:\Quake 2 Folder\Source Code\quake2-3.21\game\intermediates\BuildLog.htm"
1>game - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/doe]
« Last Edit: March 23, 2011, 04:55:34 PM by EmeraldTiger »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1373
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #5 on: March 23, 2011, 05:46:50 PM »
You are missing the function fire_perforator. This is the function that creates the objects that the game needs to determine what particles, sounds, models and touch function(s) to use. You missed copying something over from the perforator mod. These functions are usually in the g_weapons.c file.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline EmeraldTiger

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #6 on: March 23, 2011, 05:59:07 PM »
I am still getting problems. This time 84 errors popped up, just by adding one new section to g_weapon.c. I hope to have hair left by the time I fix this problem.

Code: [Select]
1>------ Build started: Project: game, Configuration: Release Win32 ------
1>Compiling...
1>g_weapon.c
1>.\g_weapon.c(455) : warning C4100: 'plane' : unreferenced formal parameter
1>.\g_weapon.c(845) : warning C4127: conditional expression is constant
1>.\g_weapon.c(962) : error C2143: syntax error : missing ';' before 'type'
1>.\g_weapon.c(966) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(966) : warning C4047: '=' : 'int' differs in levels of indirection from 'edict_t *'
1>.\g_weapon.c(967) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(967) : error C2223: left of '->s' must point to struct/union
1>.\g_weapon.c(967) : error C2065: 'start' : undeclared identifier
1>.\g_weapon.c(967) : error C2109: subscript requires array or pointer type
1>.\g_weapon.c(967) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(967) : error C2223: left of '->s' must point to struct/union
1>.\g_weapon.c(967) : error C2065: 'start' : undeclared identifier
1>.\g_weapon.c(967) : error C2109: subscript requires array or pointer type
1>.\g_weapon.c(967) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(967) : error C2223: left of '->s' must point to struct/union
1>.\g_weapon.c(967) : error C2065: 'start' : undeclared identifier
1>.\g_weapon.c(967) : error C2109: subscript requires array or pointer type
1>.\g_weapon.c(968) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(968) : error C2223: left of '->movedir' must point to struct/union
1>.\g_weapon.c(968) : error C2065: 'dir' : undeclared identifier
1>.\g_weapon.c(968) : error C2109: subscript requires array or pointer type
1>.\g_weapon.c(968) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(968) : error C2223: left of '->movedir' must point to struct/union
1>.\g_weapon.c(968) : error C2065: 'dir' : undeclared identifier
1>.\g_weapon.c(968) : error C2109: subscript requires array or pointer type
1>.\g_weapon.c(968) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(968) : error C2223: left of '->movedir' must point to struct/union
1>.\g_weapon.c(968) : error C2065: 'dir' : undeclared identifier
1>.\g_weapon.c(968) : error C2109: subscript requires array or pointer type
1>.\g_weapon.c(969) : error C2065: 'dir' : undeclared identifier
1>.\g_weapon.c(969) : warning C4047: 'function' : 'vec_t *' differs in levels of indirection from 'int'
1>.\g_weapon.c(969) : warning C4024: 'vectoangles' : different types for formal and actual parameter 1
1>.\g_weapon.c(969) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(969) : error C2223: left of '->s' must point to struct/union
1>.\g_weapon.c(969) : error C2198: 'vectoangles' : too few arguments for call
1>.\g_weapon.c(970) : error C2065: 'dir' : undeclared identifier
1>.\g_weapon.c(970) : warning C4047: 'function' : 'vec_t *' differs in levels of indirection from 'int'
1>.\g_weapon.c(970) : warning C4024: 'VectorScale' : different types for formal and actual parameter 1
1>.\g_weapon.c(970) : error C2065: 'speed' : undeclared identifier
1>.\g_weapon.c(970) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(970) : error C2223: left of '->velocity' must point to struct/union
1>.\g_weapon.c(970) : error C2198: 'VectorScale' : too few arguments for call
1>.\g_weapon.c(971) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(971) : error C2223: left of '->movetype' must point to struct/union
1>.\g_weapon.c(972) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(972) : error C2223: left of '->clipmask' must point to struct/union
1>.\g_weapon.c(973) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(973) : error C2223: left of '->solid' must point to struct/union
1>.\g_weapon.c(974) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(974) : error C2223: left of '->s' must point to struct/union
1>.\g_weapon.c(975) : error C2065: 'rocket' : undeclared identifier
1>.\g_weapon.c(975) : error C2223: left of '->mins' must point to struct/union
1>.\g_weapon.c(975) : error C2065: 'rocket' : undeclared identifier
1>.\g_weapon.c(975) : error C2223: left of '->mins' must point to struct/union
1>.\g_weapon.c(975) : error C2065: 'rocket' : undeclared identifier
1>.\g_weapon.c(975) : error C2223: left of '->mins' must point to struct/union
1>.\g_weapon.c(976) : error C2065: 'rocket' : undeclared identifier
1>.\g_weapon.c(976) : error C2223: left of '->maxs' must point to struct/union
1>.\g_weapon.c(976) : error C2065: 'rocket' : undeclared identifier
1>.\g_weapon.c(976) : error C2223: left of '->maxs' must point to struct/union
1>.\g_weapon.c(976) : error C2065: 'rocket' : undeclared identifier
1>.\g_weapon.c(976) : error C2223: left of '->maxs' must point to struct/union
1>.\g_weapon.c(977) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(977) : error C2223: left of '->s' must point to struct/union
1>.\g_weapon.c(978) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(978) : error C2223: left of '->owner' must point to struct/union
1>.\g_weapon.c(978) : error C2065: 'self' : undeclared identifier
1>.\g_weapon.c(979) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(979) : error C2223: left of '->touch' must point to struct/union
1>.\g_weapon.c(980) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(980) : error C2223: left of '->nextthink' must point to struct/union
1>.\g_weapon.c(980) : error C2065: 'speed' : undeclared identifier
1>.\g_weapon.c(981) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(981) : error C2223: left of '->think' must point to struct/union
1>.\g_weapon.c(982) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(982) : error C2223: left of '->dmg' must point to struct/union
1>.\g_weapon.c(982) : error C2065: 'damage' : undeclared identifier
1>.\g_weapon.c(983) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(983) : error C2223: left of '->s' must point to struct/union
1>.\g_weapon.c(984) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(984) : error C2223: left of '->classname' must point to struct/union
1>.\g_weapon.c(986) : error C2065: 'self' : undeclared identifier
1>.\g_weapon.c(986) : error C2223: left of '->client' must point to struct/union
1>.\g_weapon.c(987) : error C2065: 'self' : undeclared identifier
1>.\g_weapon.c(987) : warning C4047: 'function' : 'edict_t *' differs in levels of indirection from 'int'
1>.\g_weapon.c(987) : warning C4024: 'check_dodge' : different types for formal and actual parameter 1
1>.\g_weapon.c(987) : error C2065: 'rocket' : undeclared identifier
1>.\g_weapon.c(987) : error C2223: left of '->s' must point to struct/union
1>.\g_weapon.c(987) : error C2065: 'dir' : undeclared identifier
1>.\g_weapon.c(987) : warning C4047: 'function' : 'vec_t *' differs in levels of indirection from 'int'
1>.\g_weapon.c(987) : warning C4024: 'check_dodge' : different types for formal and actual parameter 2
1>.\g_weapon.c(987) : error C2065: 'speed' : undeclared identifier
1>.\g_weapon.c(987) : warning C4047: 'function' : 'vec_t *' differs in levels of indirection from 'int'
1>.\g_weapon.c(987) : warning C4024: 'check_dodge' : different types for formal and actual parameter 3
1>.\g_weapon.c(987) : error C2198: 'check_dodge' : too few arguments for call
1>.\g_weapon.c(989) : error C2065: 'perforator' : undeclared identifier
1>.\g_weapon.c(989) : warning C4047: 'function' : 'edict_t *' differs in levels of indirection from 'int'
1>.\g_weapon.c(989) : warning C4024: 'function through pointer' : different types for formal and actual parameter 1
1>.\g_weapon.c(991) : fatal error C1075: end of file found before the left brace '{' at '.\g_weapon.c(950)' was matched
1>Build log was saved at "file://f:\Quake 2 Folder\Source Code\quake2-3.21\game\intermediates\BuildLog.htm"
1>game - 84 error(s), 15 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I don`t get it. I added the new section for the perforator so it should be working, but compiler doesn`t think so, despite the fact that I copied old code and did not build it from the ground up.

Here`s the code for the perforator in g_weapon.c:

Code: [Select]
/*
=================
fire_perforator
=================
*/
void perforator_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
{
vec3_t origin;
int n;

if (other == ent->owner)
return;

if (surf && (surf->flags & SURF_SKY))
{
G_FreeEdict (ent);
return;
}

if (ent->owner->client)
PlayerNoise(ent->owner, ent->s.origin, PNOISE_IMPACT);

// calculate position for the explosion entity
VectorMA (ent->s.origin, -0.02, ent->velocity, origin);

if (other->takedamage)
{
T_Damage (other, ent, ent->owner, ent->velocity, ent->s.origin, plane->normal, ent->dmg, 0, 0, MOD_PERFORATOR);
}
else
{
// don't throw any debris in net games
if (!deathmatch->value && !coop->value)
{
if ((surf) && !(surf->flags & (SURF_WARP|SURF_TRANS33|SURF_TRANS66|SURF_FLOWING)))
{
n = rand() % 5;
while(n--)
ThrowDebris (ent, "models/objects/debris2/tris.md2", 2, ent->s.origin);
}
}

void fire_perforator (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int kick)
{
edict_t *perforator;

perforator = G_Spawn();
VectorCopy (start, perforator->s.origin);
VectorCopy (dir, perforator->movedir);
vectoangles (dir, perforator->s.angles);
VectorScale (dir, speed, perforator->velocity);
perforator->movetype = MOVETYPE_FLYMISSILE;
perforator->clipmask = MASK_SHOT;
perforator->solid = SOLID_BBOX;
perforator->s.effects |= EF_ROCKET;
VectorClear (rocket->mins);
VectorClear (rocket->maxs);
perforator->s.modelindex = gi.modelindex ("models/objects/rocket/tris.md2");
perforator->owner = self;
perforator->touch = rocket_touch;
perforator->nextthink = level.time + 8000/speed;
perforator->think = G_FreeEdict;
perforator->dmg = damage;
perforator->s.sound = gi.soundindex ("weapons/rockfly.wav");
perforator->classname = "perforator";

if (self->client)
check_dodge (self, rocket->s.origin, dir, speed);

gi.linkentity (perforator);
}

Thanks for your help so far. I hope to get this resolved soon. Extremely frustrating... :bomb:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1373
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #7 on: March 23, 2011, 06:14:39 PM »
Tee hee. Welcome to the wonderful world of modding Q2.

You are missing some code or some closing braces on the end of the perforator_touch function. Bad copy-paste.

Can you post a link to the original code you are copying?

As a matter of style, I usually write a new_weapon.c and new_weapon.h file as you might do in C++. The .h file contains some of the constants and all of the prototypes for all of the new_weapon code. This makes adding it a little easier. There is nothing carved in stone that the weapons have to be in the old g_weapon.c and p_weapon.c files. IMHO, it's actually a bad practice and the only reason people have been doing it all these years is because they acquired the bad habits from the original code and first modders who copy-pasted a lot of the weapons from place to place in the original source files, apparently not knowing a better method.

The header file defines the interface to your new weapon code, the code file defines the functions needed. I put all the weapon_touch, fire_weapon, Weapon_Fire and all the other functions related to that weapon in the .c file, this way, you have everything for that weapon in two files that are not dependent on any others. The reason these change case is because the lower-case functions are actually "private" to the weapons and never called except by the mixed-case functions which are called by the game.

  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline EmeraldTiger

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #8 on: March 23, 2011, 06:23:34 PM »
Here is the code I am copying from, in g_weapon.c:

Code: [Select]
/*
=================
fire_rocket
=================
*/
void rocket_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
{
vec3_t origin;
int n;

if (other == ent->owner)
return;

if (surf && (surf->flags & SURF_SKY))
{
G_FreeEdict (ent);
return;
}

if (ent->owner->client)
PlayerNoise(ent->owner, ent->s.origin, PNOISE_IMPACT);

// calculate position for the explosion entity
VectorMA (ent->s.origin, -0.02, ent->velocity, origin);

if (other->takedamage)
{
T_Damage (other, ent, ent->owner, ent->velocity, ent->s.origin, plane->normal, ent->dmg, 0, 0, MOD_ROCKET);
}
else
{
// don't throw any debris in net games
if (!deathmatch->value && !coop->value)
{
if ((surf) && !(surf->flags & (SURF_WARP|SURF_TRANS33|SURF_TRANS66|SURF_FLOWING)))
{
n = rand() % 5;
while(n--)
ThrowDebris (ent, "models/objects/debris2/tris.md2", 2, ent->s.origin);
}
}
}

T_RadiusDamage(ent, ent->owner, ent->radius_dmg, other, ent->dmg_radius, MOD_R_SPLASH);

gi.WriteByte (svc_temp_entity);
if (ent->waterlevel)
gi.WriteByte (TE_ROCKET_EXPLOSION_WATER);
else
gi.WriteByte (TE_ROCKET_EXPLOSION);
gi.WritePosition (origin);
gi.multicast (ent->s.origin, MULTICAST_PHS);

G_FreeEdict (ent);
}

void fire_rocket (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage)
{
edict_t *rocket;

rocket = G_Spawn();
VectorCopy (start, rocket->s.origin);
VectorCopy (dir, rocket->movedir);
vectoangles (dir, rocket->s.angles);
VectorScale (dir, speed, rocket->velocity);
rocket->movetype = MOVETYPE_FLYMISSILE;
rocket->clipmask = MASK_SHOT;
rocket->solid = SOLID_BBOX;
rocket->s.effects |= EF_ROCKET;
VectorClear (rocket->mins);
VectorClear (rocket->maxs);
rocket->s.modelindex = gi.modelindex ("models/objects/rocket/tris.md2");
rocket->owner = self;
rocket->touch = rocket_touch;
rocket->nextthink = level.time + 8000/speed;
rocket->think = G_FreeEdict;
rocket->dmg = damage;
rocket->radius_dmg = radius_damage;
rocket->dmg_radius = damage_radius;
rocket->s.sound = gi.soundindex ("weapons/rockfly.wav");
rocket->classname = "rocket";

if (self->client)
check_dodge (self, rocket->s.origin, dir, speed);

gi.linkentity (rocket);
}

I`ll try to look into putting the code in a perforator.c, but I`m not sure exactly how you manage that. So basically you put the info from g_weapon.c / p_weapon.c into perforator.c? How do you set it up?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1373
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #9 on: March 23, 2011, 07:00:50 PM »
Lots to fix up, I think.

First, in p_weapon.c, find and cut the following lines and put them in g_local.h where they belong, this is old code from ancient days:

Code: [Select]
qboolean is_quad;
byte is_silenced;

Insert them in g_local.h near the armor definitions.

Code: [Select]
extern gitem_armor_t jacketarmor_info;// = { 25,  50, .30, .00, ARMOR_JACKET};
extern gitem_armor_t combatarmor_info;// = { 50, 100, .60, .30, ARMOR_COMBAT};
extern gitem_armor_t bodyarmor_info;// = {100, 200, .80, .60, ARMOR_BODY};

static qboolean is_quad;
static byte is_silenced;

Next, create your perforator.h and perforator.c files and write them like this:

perforator.h:
Code: [Select]
/*
 *
 *  perforator.h
 * 
 *
 */

//#include "g_local.h"

#ifndef PERFORATOR_H
#define PERFORATOR_H

void Weapon_Perforator_Fire (edict_t *ent);
void Weapon_Perforator (edict_t *ent);
void perforator_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf);
void fire_perforator (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int kick);

#endif


perforator.c:
Code: [Select]
/*
 *
*  perforator.c
 *
 */

#include "perforator.h"

/*
 ======================================================================
 
 PERFORATOR
 
 ======================================================================
 */

void Weapon_Perforator_Fire (edict_t *ent)
{
vec3_t offset, start;
vec3_t forward, right;
int damage;
int kick;

damage = 50;
kick = 400;
if (is_quad)
{
damage *= 4;
}

AngleVectors (ent->client->v_angle, forward, right, NULL);

VectorScale (forward, -2, ent->client->kick_origin);
ent->client->kick_angles[0] = -1;

VectorSet(offset, 8, 8, ent->viewheight-8);
P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start);
fire_perforator (ent, start, forward, damage, 650, kick);

// send muzzle flash
gi.WriteByte (svc_muzzleflash);
gi.WriteShort (ent-g_edicts);
gi.WriteByte (MZ_RAILGUN | is_silenced);
gi.multicast (ent->s.origin, MULTICAST_PVS);

ent->client->ps.gunframe++;

PlayerNoise(ent, start, PNOISE_WEAPON);

if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
ent->client->pers.inventory[ent->client->ammo_index]--;
}

void Weapon_Perforator (edict_t *ent)
{
static int pause_frames[] = {25, 33, 42, 50, 0};
static int fire_frames[] = {5, 0};

Weapon_Generic (ent, 4, 12, 50, 54, pause_frames, fire_frames, Weapon_Perforator_Fire);
}

/*
 =================
 perforator_touch
 =================
 */

void perforator_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
{
vec3_t origin;
int n;

if (other == ent->owner)
return;

if (surf && (surf->flags & SURF_SKY))
{
G_FreeEdict (ent);
return;
}

if (ent->owner->client)
PlayerNoise(ent->owner, ent->s.origin, PNOISE_IMPACT);

// calculate position for the explosion entity
VectorMA (ent->s.origin, -0.02, ent->velocity, origin);

if (other->takedamage)
{
T_Damage (other, ent, ent->owner, ent->velocity, ent->s.origin, plane->normal, ent->dmg, 0, 0, MOD_PERFORATOR);
}
else
{
// don't throw any debris in net games
if (!deathmatch->value && !coop->value)
{
if ((surf) && !(surf->flags & (SURF_WARP|SURF_TRANS33|SURF_TRANS66|SURF_FLOWING)))
{
n = rand() % 5;
while(n--)
ThrowDebris (ent, "models/objects/debris2/tris.md2", 2, ent->s.origin);
}
}
}

T_RadiusDamage(ent, ent->owner, ent->radius_dmg, other, ent->dmg_radius, MOD_PERFORATOR);

gi.WriteByte (svc_temp_entity);
if (ent->waterlevel)
gi.WriteByte (TE_PERFORATOR_EXPLOSION_WATER);
else
gi.WriteByte (TE_PERFORATOR_EXPLOSION);
gi.WritePosition (origin);
gi.multicast (ent->s.origin, MULTICAST_PHS);

G_FreeEdict (ent);
}

/*
 =================
 fire_perforator
 =================
 */

void fire_perforator (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int kick)
{
edict_t *perforator;

perforator = G_Spawn();
VectorCopy (start, perforator->s.origin);
VectorCopy (dir, perforator->movedir);
vectoangles (dir, perforator->s.angles);
VectorScale (dir, speed, perforator->velocity);
perforator->movetype = MOVETYPE_FLYMISSILE;
perforator->clipmask = MASK_SHOT;
perforator->solid = SOLID_BBOX;
perforator->s.effects |= EF_ROCKET;
VectorClear (perforator->mins);
VectorClear (perforator->maxs);
perforator->s.modelindex = gi.modelindex ("models/objects/rocket/tris.md2");
perforator->owner = self;
perforator->touch = perforator_touch;
perforator->nextthink = level.time + 8000/speed;
perforator->think = G_FreeEdict;
perforator->dmg = damage;
perforator->s.sound = gi.soundindex ("weapons/rockfly.wav");
perforator->classname = "perforator";

if (self->client)
check_dodge (self, perforator->s.origin, dir, speed);

gi.linkentity (perforator);
}

Then, in any modules that need to call the perforator functions, just add:
Code: [Select]
#include "perforator.h"anywhere near the top after the #include "g_local.h"

You might get some more errors or warnings depending on which base mod you started with. You might have to un-comment the g_local.h line in perforator.h depending on your results. You will have to define some more perforator constants but I am sure you can handle this.

Keep hair in place, looking cool and serene is part of the modder's job. :)
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline EmeraldTiger

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #10 on: March 23, 2011, 08:09:51 PM »
Well, it manages to compile now, which is great! Unfortunately when I type "give perforator" in the game I`m not getting the weapon...?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1373
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #11 on: March 23, 2011, 08:16:29 PM »
Are you in DM or single player mode? The give command won't work in DM unless you set cheats 1 at startup. Weapons are usually used, not given. Try "use perforator".
Is the perforator a rocket class weapon? If so, picking up a rocket launcher will give you the perforator in DM.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline EmeraldTiger

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #12 on: March 23, 2011, 08:30:30 PM »
I am in single player mode.

Using give all, attempting to use perforator but says "unknown item perforator"
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1373
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #13 on: March 23, 2011, 09:18:57 PM »
Since you are adding a weapon rather than replacing one, the tutorial doesn't take you all the way thru what you need to do to add a new weapon class.

You will also need to add the weapon class to the itemlist array in g_items.c.

  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline EmeraldTiger

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
  • Rated:
Re: Making Q2 SP mod, code fails to compile
« Reply #14 on: March 23, 2011, 10:11:51 PM »
Okay, I added the weapon code in g_items.c, including the void Weapon_Perforator (edict_t *ent); definition:

Code: [Select]
/*QUAKED weapon_perforator (.3 .3 1) (-16 -16 -16) (16 16 16)
*/
{
"weapon_perforator",
Pickup_Weapon,
Use_Weapon,
Drop_Weapon,
Weapon_Perforator,
"misc/w_pkup.wav",
"models/weapons/g_rail/tris.md2", EF_ROTATE,
"models/weapons/v_rail/tris.md2",
/* icon */ "w_railgun",
/* pickup */ "Perforator",
0,
5,
"Rockets",
IT_WEAPON|IT_STAY_COOP,
WEAP_PERFORATOR,
NULL,
0,
/* precache */ "weapons/rg_hum.wav"
},

It doesn`t seem to choke on what I modified except for the fifth line in the code, where it says Weapon_Perforator, below Drop_Weapon. The compiler spits out an error saying "1>g_items.obj : error LNK2001: unresolved external symbol _Weapon_Perforator". This happens even though I already defined it earlier with "void Weapon_Perforator (edict_t *ent);", why is it thinking that I never put it there?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

 

El Box de Shoutamente

Last 10 Shouts:

 

Costigan_Q2

November 11, 2024, 06:41:06 AM
"Stay cozy folks.

Everything is gonna be fine."

There'll be no excuses for having TDS after January 20th, there'll be no excuses AT ALL!!!
 

|iR|Focalor

November 06, 2024, 03:28:50 AM
 

RailWolf

November 05, 2024, 03:13:44 PM
Nice :)

Tom Servo

November 04, 2024, 05:05:24 PM
The Joe Rogan Experience episode 223 that dropped a couple hours ago with Musk, they're talking about Quake lol.
 

Costigan_Q2

November 04, 2024, 03:37:55 PM
Stay cozy folks.

Everything is gonna be fine.
 

|iR|Focalor

October 31, 2024, 08:56:37 PM
 

Costigan_Q2

October 17, 2024, 06:31:53 PM
Not activated your account yet?

Activate it now! join in the fun!

Tom Servo

October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
 

|iR|Focalor

October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
 

rikwad

October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.

Show 50 latest
Welcome, Guest. Please login or register.
November 25, 2024, 10:16:18 PM

Login with username, password and session length