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       

Character Selection?
Page 1 of 1
DieHard Wolfers Forum Index -> Feature Fanatics 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
doom44
Bring 'em On
Bring 'em On


Joined: 23 Jun 2011
Last Visit: 20 Feb 2014

Topics: 11
Posts: 139
Location: Florida, USA
usa.gif

PostPosted: Sun Jul 17, 2011 11:06 am
   Subject: Character Selection?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Character Selection?

I was wondering if this was actually possible with Wolfenstien 3D. If it is, then I will put it to good use with some of my mods in the concept stage. For Example:

BJ: +100% to Awesomeness +35% to Stength
PJ: 35% to Agility 10% to Power

Does this make sense?
Cheers, Doom44

_________________
My Projects
Doom44's Mapset: In work
Mystery Project: In planning
Castle Todkrieg: In a grave... OR IS IT?!?!?!?!?! :O
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 11:06 ago.

Topics: 163
Posts: 8146
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sun Jul 17, 2011 12:56 pm
   Subject: Re: Character Selection?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yes, it's doable; you need to build another menu with the source code and have the game work with it. You'll also need to expand the "gamestate" structure to include the selected character, his "awesomeness", strength, agility, and power.

The catch is - if you don't program it the right way, the game will keep "forgetting" the settings you give it. I know there's a way to avoid the problem, but I've never figured it out 100%. Sad
insurrectionman
DieHard Mutant
DieHard Mutant


Joined: 07 May 2005
Last Visit: 11 Jun 2018

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

PostPosted: Sun Jul 17, 2011 2:39 pm
   Subject: Character Selection?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I have found a way to remember all of those settings. It needs to be put in the savegame/loadgame functions. I created a new "gamestate" like struct for power-ups, and such, its very handy, and it keeps the code clean. I can give you a few hints, but I cannot guarantee this 100% as I haven't tested it myself.

If you place your so-called power-ups in the gamestate struct, then you should be okay.

If not, you can add your new struct info here:

in wl_menu.cpp:

::: CODE :::
boolean SaveTheGame(FILE *file,int x,int y)


Find this block:

::: CODE :::

    DiskFlopAnim(x,y);
    fwrite(&gamestate,sizeof(gamestate),1,file);
    checksum = DoChecksum((byte *)&gamestate,sizeof(gamestate),checksum);


It tells the save game that it will write all of the gamestate.* information to the save game.

There is a similar patch in LoadTheGame, but it has an fread function instead.

They have to be placed in the same order, otherwise the read/write will be off.
::: CODE :::

typedef struct
{
    short ammo;
    short health;
} gametype;


This what the gamestate struct is, theres more than this in it tho, I just put two examples for space-sake.

I made a powerup struct

::: CODE :::
typedef struct
{
    short awesome;
    short strength;
} poweruptype;


There's a slight amount more to do this, but if you search for "gametype" and just place the same things, gametype turns into gamestate in the wl_game.cpp file.

In the Save/Load functions I explained above, you would put your powerup information in those two functions as well.

I hope this helps. It isn't a 100% tutorial, just a little help to give you an idea of how its done.

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

New Site: http://www.treesapthief.com
Twitter: @treesapthief
Tragos2d
Don't Hurt Me
Don't Hurt Me


Joined: 05 Jul 2011
Last Visit: 14 Sep 2011

Topics: 8
Posts: 55

usa.gif

PostPosted: Sun Aug 21, 2011 7:49 am
   Subject: Re: Character Selection?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

What about switching to another character in game? Like another soldier in a team of 4.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 11:06 ago.

Topics: 163
Posts: 8146
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sun Aug 21, 2011 7:29 pm
   Subject: Re: Character Selection?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

You'd have each character defined with a particular "Actor type" (such as en_bj1, en_bj2, etc.), and that type would automatically be saved/loaded in any saved game. The code to switch to another team member would probably be in WL_AGENT. Of course, you'd still need sprites designed to represent all four soldier types, unless you want all four soldiers to look exactly alike. Smile
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Feature Fanatics 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 Wolfenstein 3d Deathmatch Concept
Author: gerolf
4 1352 Thu Feb 23, 2017 1:40 am
Ginyu View latest post
No new posts Would you play a Unity3D and/or MUGEN FPS game that I make?
Author: stathmk
3 1253 Sun Aug 25, 2013 7:19 pm
stathmk View latest post
No new posts Some ideas for some Wolfenstein 3D mods.
Author: undead merc
0 1267 Fri Mar 27, 2009 5:17 pm
undead merc View latest post
No new posts Few good ideas to make your games more interesting!
Author: Duartuss
8 2445 Thu Sep 11, 2008 4:06 am
Duartuss 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