DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

[Tutorial] No Score Increase when Debug Keys Activated
Page 1 of 1
DieHard Wolfers Forum Index -> Code Tutorials View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
KyleRTCW
DieHard Officer
DieHard Officer


Joined: 30 Jul 2003
Last Visit: 09 Nov 2017

Topics: 45
Posts: 510
Location: Ohio
usa.gif

PostPosted: Thu Sep 09, 2004 2:36 pm
   Subject: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Doing this doesn't give you a score if you use Debug Keys.

Step 1:

Open WL_DEF.H and add this somewhere or you can add it in WL_AGENT.C:

::: CODE :::
extern int DebugOk;


Step 2:

Open WL_AGENT.C and do a search for "Give Points"(no quotes!) you should see something like this:


::: CODE :::
/*
=============
=
=Give Points
=
=============
*/

void GivePoints (long points)
{
 gamestate.score += points;
 while (gamestate.score >= gamestate.nextextra)
{
gamestate.nextextra += EXTRAPOINTS;
GiveExtraMan ();
}
DrawScore ();
}


Step 3: Change it to: (DON'T forget to add the "}" (no quotes) after "DrawScore ();" !

::: CODE :::
/*
=============
=
=Give Points
=
=============
*/

void GivePoints (long points)
{
if (!DebugOk)
{

gamestate.score += points;
while (gamestate.score >= gamestate.nextextra)
{
gamestate.nextextra += EXTRAPOINTS;
GiveExtraMan ();
}
DrawScore ();
}
}


Compile and Link up!

Now when you use debug keys you can't get no score.

_________________
Steam: http://steamcommunity.com/id/stormx312
Dugtrio17
Code Master
Code Master


Joined: 11 Mar 2003
Last Visit: 03 Oct 2013

Topics: 49
Posts: 903
Location: Seattle
usa.gif

PostPosted: Thu Sep 09, 2004 2:40 pm
   Subject: Re: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Only thing is that you forgot to make it so that when you use debugmode DebugOK is set to one. I'll let you correct it, since it's your tutorial and it was of course a minor oversight Smile

_________________
KyleRTCW
DieHard Officer
DieHard Officer


Joined: 30 Jul 2003
Last Visit: 09 Nov 2017

Topics: 45
Posts: 510
Location: Ohio
usa.gif

PostPosted: Sun Sep 12, 2004 4:57 am
   Subject: Re: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

No I don't think so, what exactly do you mean?

I see this in the Debug Cheat Part:
::: CODE :::

                //
   // OPEN UP DEBUG KEYS
   //
#ifndef SPEAR
   if (Keyboard[sc_BackSpace] &&
      Keyboard[sc_LShift] &&
      Keyboard[sc_Alt] &&
      MS_CheckParm("goobers"))
#else
   if (Keyboard[sc_BackSpace] &&
      Keyboard[sc_LShift] &&
      Keyboard[sc_Alt] &&
      MS_CheckParm("debugmode"))
#endif
   {
    ClearMemory ();
    CA_CacheGrChunk (STARTFONT+1);
    ClearSplitVWB ();
    VW_ScreenToScreen (displayofs,bufferofs,80,160);

    Message("Debugging keys are\nnow available!");
    UNCACHEGRCHUNK(STARTFONT+1);
    PM_CheckMainMem ();
    IN_ClearKeysDown();
    IN_Ack();

    DrawAllPlayBorderSides ();
    DebugOk=1;
   }

DebugOk=1; is already there in unmodified source. So I don't think that's a problem.
It should work for both wolf and spear by looking at it.

_________________
Steam: http://steamcommunity.com/id/stormx312
Dugtrio17
Code Master
Code Master


Joined: 11 Mar 2003
Last Visit: 03 Oct 2013

Topics: 49
Posts: 903
Location: Seattle
usa.gif

PostPosted: Sun Sep 12, 2004 7:18 am
   Subject: Re: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Oh, didn't check that. I was thrown off by the fact that it was defined. Guess the extern should have tipped me off.

_________________
Matthew
DieHard SS
DieHard SS


Joined: 02 Jul 2007
Last Visit: 10 Oct 2017

Topics: 91
Posts: 464

usa.gif

PostPosted: Sun Jul 15, 2007 1:25 pm
   Subject: Re: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Note: The player will be able to get around this by, after cheating, saving the game, quitting, restarting, and loading the game. Then, the player will be able to get more points again. To fix this, rather than using "DebugOk" to check whether a player has cheated, add a variable to the "gamestate" structure and use that variable, so that it is saved into the game. Also, make the game sets DebugOk to 0 whenever a player loads a game, to prevent the player from being able to use debug mode when it was activated in a previous game. And make sure the game, similarly, sets DebugOk to 0 whenever a player starts a new game.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 15:24 ago.

Topics: 160
Posts: 8007
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sun Jul 15, 2007 6:33 pm
   Subject: Re: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Couldn't you also add the DebugOK variable to the checksum that's saved and loaded in SAVEGAMx files?
Matthew
DieHard SS
DieHard SS


Joined: 02 Jul 2007
Last Visit: 10 Oct 2017

Topics: 91
Posts: 464

usa.gif

PostPosted: Mon Jul 16, 2007 9:26 am
   Subject: Re: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yes, you could. Personally, though, I prefer this option. But it's your choice. Just make sure that there's no way the player can get around it, short of hacking the save game file. When I added this feature to TTFSE, a number of times I discovered that there was a way around it, and fixed it.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 15:24 ago.

Topics: 160
Posts: 8007
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Mon Jul 16, 2007 6:32 pm
   Subject: Re: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I suggested the savegame enhancement because it might use less memory than creating another variable in the code. I could be wrong, though.
KyleRTCW
DieHard Officer
DieHard Officer


Joined: 30 Jul 2003
Last Visit: 09 Nov 2017

Topics: 45
Posts: 510
Location: Ohio
usa.gif

PostPosted: Mon Jul 23, 2007 7:11 pm
   Subject: Re: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Haha I never thought of that, Thanks Smile

_________________
Steam: http://steamcommunity.com/id/stormx312
Lingyan203
Bring 'em On
Bring 'em On


Joined: 05 Dec 2009
Last Visit: 05 Dec 2017

Topics: 16
Posts: 104
Location: Ottawa, Ontario
canada.gif

PostPosted: Sat Jan 01, 2011 12:03 pm
   Subject: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I want to make my score always stay at zero when debug mode is activated. How do I do this?
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 07 Jun 2016

Topics: 101
Posts: 1614
Location: A hole in the wall
australia.gif

PostPosted: Sat Jan 01, 2011 1:58 pm
   Subject: Re: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Lingyan203 wrote:
I want to make my score always stay at zero when debug mode is activated. How do I do this?


Do this tutorial but also reset gamestate.score to zero?

_________________
Zombieskittles

Welcome to 2016, where DHW still thinks it is okay to ban the world's most popular email service provider, and I can't have an avatar over 10kb
Lingyan203
Bring 'em On
Bring 'em On


Joined: 05 Dec 2009
Last Visit: 05 Dec 2017

Topics: 16
Posts: 104
Location: Ottawa, Ontario
canada.gif

PostPosted: Sun Jan 09, 2011 9:07 am
   Subject: Re: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

k... Which file do I do it in?
Andy_Nonymous
Moderator
<B>Moderator</B>


Joined: 02 Apr 2003
Last Visit: 17 Feb 2015

Topics: 99
Posts: 589
Location: New Jersey, USA
usa.gif

PostPosted: Sun Jan 09, 2011 5:40 pm
   Subject: [Tutorial] No Score Increase when Debug Keys Activated
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

I would put it in WL_AGENT.CPP in GivePoints (blue code is added):
::: CODE :::
/*
=============
=
=Give Points
=
=============
*/

void GivePoints (long points)
{
   if (!DebugOk)
   {
      gamestate.score += points;
      while (gamestate.score >= gamestate.nextextra)
      {
         gamestate.nextextra += EXTRAPOINTS;
         GiveExtraMan ();
      }
      DrawScore ();
   }
   else      //  DebugOK
   {
      gamestate.score = 0;
      DrawScore ();
   }

}
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Tutorials View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [Code] Shading Tutorial & Fixes - Ripper
Author: BrotherTank
80 12951 Wed Apr 29, 2015 5:06 pm
Chris View latest post
No new posts [Code] Motorbike/Motorcycle Tutorial by Kuki
Author: Kuki
37 9184 Mon Jan 09, 2012 7:31 am
Ipank7000 View latest post
No new posts [Code] Blood Splatz Tutorial - Blood Splatters
Author: Dugtrio17
45 11219 Tue Mar 11, 2008 12:02 am
AlumiuN View latest post
No new posts [Code] Creating Animated Static Objects Tutorial
Author: WSJ
15 569 Wed Aug 01, 2007 12:06 pm
Codetech84 View latest post
No new posts [Info] Changing debug mode command line parameter
Author: CoolMario
2 128 Sun Aug 03, 2003 2:46 pm
Codetech84 View latest post
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
   You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group