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       

Special level ending sequence
Page 2 of 2 Goto page Previous  1, 2
DieHard Wolfers Forum Index -> SDL 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
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:38 ago.

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

PostPosted: Fri Sep 23, 2016 4:08 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

AlumiuN wrote:
2) I'm not entirely sure what you want here, but you could add something also using the 'trapped' flag to end the level when the player tries to move through any door of a particular type in TryMove in WL_AGENT. You might want to rethink what the end-level trigger is, though; suddenly ending the level when the player runs through a door isn't exactly convincing. My recommendation would be to have the level end when the 'trapped' flag is set and the player's health dips below a certain amount.
Add to that, if a player crosses a square that does nothing, and then the level ends when he passes over that same square again, I'm pretty sure you couldn't explain to the player what happened and how it worked. Smile
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:04 ago.

Topics: 37
Posts: 2401
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Fri Sep 23, 2016 4:55 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Tricob wrote:
AlumiuN wrote:
2) I'm not entirely sure what you want here, but you could add something also using the 'trapped' flag to end the level when the player tries to move through any door of a particular type in TryMove in WL_AGENT. You might want to rethink what the end-level trigger is, though; suddenly ending the level when the player runs through a door isn't exactly convincing. My recommendation would be to have the level end when the 'trapped' flag is set and the player's health dips below a certain amount.
Add to that, if a player crosses a square that does nothing, and then the level ends when he passes over that same square again, I'm pretty sure you couldn't explain to the player what happened and how it worked. Smile


Exactly; at least not without doing something to the environment on the other side of the door first.
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Sat Oct 22, 2016 4:59 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I have this working, but I am having one problem.

Whenever the level ends, it's also supposed to reduce the player to bestweapon = pistol and 0 ammo, starting the next level with a knife. This is happening, but the game doesn't register it until I attempt to fire a shot. What am I missing? Here is my code that handles my special level ending sequence.

if (gamestate.captured == 1)
{
gamestate.health = 10;
gamestate.chosenweapon = wp_knife;
gamestate.bestweapon = wp_pistol;
gamestate.ammo = 0;
playstate = ex_completed;
gamestate.captured = 0;

_________________
Atomprojekt Download: http://www.wolfenvault.com/files/barry/ATOM.3.zip
Passage to Hollenteufel Download: http://www.wolfenvault.com/files/barry/PTH.2.zip
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:04 ago.

Topics: 37
Posts: 2401
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Sat Oct 22, 2016 5:28 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Where is this code located?
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Sat Oct 22, 2016 5:48 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

It's in TakeDamage in wl.agent.cpp.

I have made enemies invincible when gamestate.captured = 1 and then I am doing the level ending sequence in TakeDamage.

_________________
Atomprojekt Download: http://www.wolfenvault.com/files/barry/ATOM.3.zip
Passage to Hollenteufel Download: http://www.wolfenvault.com/files/barry/PTH.2.zip
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:04 ago.

Topics: 37
Posts: 2401
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Sat Oct 22, 2016 7:11 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hmm, OK; can you post the entire TakeDamage function?
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Sun Oct 23, 2016 12:28 am
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I figured it out I think.

If I don't call DrawWeapon() and DrawAmmo() the status bar won't be correct even if the gamestate is.

if (gamestate.health<=0)
{
if (gamestate.captured == 1)
{
gamestate.health = 10;
gamestate.bestweapon = wp_pistol;
gamestate.weapon = wp_knife;
gamestate.chosenweapon = wp_pistol;
gamestate.ammo = 0;
DrawAmmo();
DrawWeapon();
playstate = ex_completed;
gamestate.captured = 0;

}

_________________
Atomprojekt Download: http://www.wolfenvault.com/files/barry/ATOM.3.zip
Passage to Hollenteufel Download: http://www.wolfenvault.com/files/barry/PTH.2.zip
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:04 ago.

Topics: 37
Posts: 2401
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Sun Oct 23, 2016 2:08 am
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Ah, yes, that would do it.
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Wed Oct 26, 2016 1:26 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I have one more outstanding problem with my capture code.

If the player is firing their weapon when the new code to end the level in TakeDamage (shown above) is executed, the player's weapon will remain in attack mode until they attempt to use it again in the next level. Any idea why this is happening?

My guess is it has something to do with gamestate.attackframe or gamestate.weaponframe but I am not certain. Shouldn't playstate = ex_completed reset these or do I need to manually reset them to 0?

_________________
Atomprojekt Download: http://www.wolfenvault.com/files/barry/ATOM.3.zip
Passage to Hollenteufel Download: http://www.wolfenvault.com/files/barry/PTH.2.zip
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:38 ago.

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

PostPosted: Wed Oct 26, 2016 4:30 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

I always had to manually reset them to Zero. If it still isn't correcting the animation frames like it should, have it do a "DrawLevel ()" command after resetting those values.

If all that doesn't do the trick, I guess we'll have to ask you to post the code in its current form. Smile
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 2 of 2 Goto page Previous  1, 2
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [help] Intermission Screens on SDL
Author: RichterBelmont12
19 2867 Thu Jun 22, 2017 10:06 pm
AlumiuN View latest post
No new posts [help] Three things & questions
Author: RichterBelmont12
54 4666 Sat Mar 12, 2011 8:56 pm
gerolf View latest post
No new posts [Help] Disabling "Full Screen" Mode
Author: WSJ
4 1026 Sat Aug 02, 2008 6:42 pm
Tricob View latest post
No new posts [CODE] Health Shown as a message with full screen view
Author: Raziel
13 2111 Thu Jul 31, 2008 8:07 pm
Raziel View latest post
No new posts [Wolf4SDL Help] Inserting a second palette (like in SoD)
Author: Andy_Nonymous
10 2403 Mon Jun 02, 2008 3:59 pm
Adam Biser 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