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       

Episodes must be completed in order
Page 1 of 1
DieHard Wolfers Forum Index -> Code Crackers 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
stathmk
DieHard SS
DieHard SS


Joined: 21 Oct 2009
Last Visit: 0:11 ago.

Topics: 81
Posts: 424
Location: Indiana, United States
usa.gif

PostPosted: Wed Dec 08, 2010 7:00 am
   Subject: Episodes must be completed in order
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Hello.

In Wolfenstein Reloaded at http://www.kfhgames.com/projects.php?project=wolfenstein_reloaded , you can only select episode 1 until you complete it. Then you can select only either of the first 2 episodes until you complete episode 2 and so on. I want to make a mod with this feature. I emailed KFH Games asking how the coding is done for this and they havenít responded yet. Does anybody know how this is done or how to isolate code? Please link to coding tutorials. I know little about the Wolfenstein 3D coding.
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Wed Dec 08, 2010 7:59 am
   Subject: Re: Episodes must be completed in order
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yeah I got your mail yesterday. Not that it's very big of a deal to do, but I don't have the time now for coding tasks, maybe I can fit that in before christmas. But if I remember correctly it was just a modified shareware episode selection screen, I just had a variable that I would increase when player completes an episode and I saved that into config. Hope that helps at all.

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Wed Dec 08, 2010 8:58 am
   Subject: Re: Episodes must be completed in order
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Looks like I've allready ported this feature to Wolfreloaded SDL. I may aswell try to post it here today.

Edit: Here's a link for the tutorial http://diehardwolfers.areyep.com/viewtopic.php?p=75711

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
insurrectionman
DieHard Mutant
DieHard Mutant


Joined: 07 May 2005
Last Visit: 13:29 ago.

Topics: 87
Posts: 756
Location: Wisconsin
usa.gif

PostPosted: Wed Dec 08, 2010 9:39 am
   Subject: Re: Episodes must be completed in order
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Well, I've accomplished this, except my form is much more complicated, but you can do this:

in the gamestate structure you can add:

episodeCompleted

so its like gamestate.episodeCompleted, and it is saved in the config (don't quote me on that)

in the Victory()

you can do this 1 of 2 ways, bitwise (which enables separate episodes to open, if you skip on) or just a 0-n value of what episode you are on

if (gamestate.episodeCompleted < gamestate.episode)
gamestate.episodeCompleted = gamestate.episode;

that will tell you that you have completed up to those episodes

In the CP_NewGame in wl_menu.cpp

Instead of EpisodeSelect[x], I don't know how it goes, I can remember off hand

If the message it displays is that the episode needs to be purchased, change it to "This episode is locked" and the if statement should be:

if (gamestate.episode < which)

Now this was all off the top of my head, if you have a partial idea on how to program, which this is all simple logic, if statements, and such, messing around with it should not be difficult.

If you have questions, ask, because this is a crude example, not 100% explained.

_________________
I'm back! I missed this community!
Youtube Channel: TreeSapThief

New Site: http://www.treesapthief.com
Twitter: @treesapthief
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Wed Dec 08, 2010 9:44 am
   Subject: Re: Episodes must be completed in order
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I wouldn't use gamestate for episode selection menu, because it is related to your current game status. When you load a game or start a new game that information would be lost.

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
stathmk
DieHard SS
DieHard SS


Joined: 21 Oct 2009
Last Visit: 0:11 ago.

Topics: 81
Posts: 424
Location: Indiana, United States
usa.gif

PostPosted: Wed Dec 08, 2010 10:07 am
   Subject: Episodes must be completed in order
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks, guys.
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Wed Dec 08, 2010 10:25 am
   Subject: Re: Episodes must be completed in order
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

No problem. Good luck with your project!

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2255
Location: Ontario
canada.gif

PostPosted: Thu Dec 09, 2010 6:17 pm
   Subject: Re: Episodes must be completed in order
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Codetech84 wrote:
I wouldn't use gamestate for episode selection menu, because it is related to your current game status. When you load a game or start a new game that information would be lost.


But that's what the gamestate is for?? When you load a saved game, all of your information from the gamestate that you saved is loaded. If you put the information into the config file, then anyone that starts the game would have access to the levels/episodes that one person might have already achieved. So if you have mutliple people playing the one game on one computer, everyone shares the best stats or best case scenario.

Personally, I would put it in the gamestate and that way when someone starts a new game, they start from the beginning... They load a game... They start from where it left off.. including epsiodes completed. I just think that makes more sense.

Greg
BrotherTank
insurrectionman
DieHard Mutant
DieHard Mutant


Joined: 07 May 2005
Last Visit: 13:29 ago.

Topics: 87
Posts: 756
Location: Wisconsin
usa.gif

PostPosted: Thu Dec 09, 2010 6:35 pm
   Subject: Re: Episodes must be completed in order
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

It does save into the config file, that was my intention, although I created a separate struct for my values, and it strictly is in the config file, so i can branch it off into a profile system.

_________________
I'm back! I missed this community!
Youtube Channel: TreeSapThief

New Site: http://www.treesapthief.com
Twitter: @treesapthief
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Fri Dec 10, 2010 12:30 am
   Subject: Re: Episodes must be completed in order
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

BrotherTank wrote:
But that's what the gamestate is for?? When you load a saved game, all of your information from the gamestate that you saved is loaded. If you put the information into the config file, then anyone that starts the game would have access to the levels/episodes that one person might have already achieved. So if you have mutliple people playing the one game on one computer, everyone shares the best stats or best case scenario.

Personally, I would put it in the gamestate and that way when someone starts a new game, they start from the beginning... They load a game... They start from where it left off.. including epsiodes completed. I just think that makes more sense.

Greg
BrotherTank

That's a good point, it could be done this way aswell. It would require the unlocks be saved temporarily somewhere else though, starting a new game memsets gamestate to 0, but that's not a big deal.

Like throwing something like this into NewGame in wl_main.cpp:
::: CODE :::
int tmp_unlocked = gamestate.unlocked;
memset (&gamestate, 0, sizeof(gamestate));
gamestate.unlocked = tmp_unlocked;


Though this could cause an unitialized value being sent to unlock when a new player starts.
It could be fixed by throwing the memset gamestate 0 into BuildTables in wl_main.cpp:
::: CODE :::
void BuildTables (void)
{
   memset (&gamestate, 0, sizeof(gamestate));
   gamestate.unlocked = 1; // Start of with 1 episode unlocked


And ofcourse you'd have to add the unlocked variable into gamestate in wl_def.h ...
::: CODE :::
//---------------
//
// gamestate structure
//
//---------------

typedef struct
{
    short       difficulty;
    int      unlocked;


...and change the unlocked references to gamestate.unlocked.
::: CODE :::
gamestate.unlocked

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Crackers 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 Sticky: [Info] Compiling the Source Code...
Author: Guest
52 2807 Sat Feb 10, 2007 12:38 pm
Harry sr View latest post
No new posts [Info] Make a Single shot kill an enemy
Author: Guest
12 442 Sun Jun 20, 2004 3:12 pm
Guest View latest post
No new posts [Code] Run with Stamina - TekZK
Author: BrotherTank
8 2938 Sun May 16, 2004 12:54 am
Codetech84 View latest post
This topic is locked: you cannot edit posts or make replies. [Info] Source code for Darkone's NewWolf Classic
Author: Raistlin
1 1615 Tue Feb 10, 2004 10:18 am
BrotherTank View latest post
No new posts [Info] Slideshows Between Levels? - SoD side of Code
Author: Hair Machine
2 1349 Fri Dec 26, 2003 11:02 am
jamez 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