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 1 of 2 Goto page 1, 2  Next
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
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Sun Aug 28, 2016 6:40 pm
   Subject: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

My next project is going to have three units. Between the first and the second unit, I want BJ to be arrested and taken to a prison that he has to escape from. The way I want to accomplish this is have the player in an impossible enemy situation, and when BJ gets to 5 or 10% health (he should not die), I want the level to end, and intermission text screen to display, and then proceed to the next level. I would also want the player to start with a knife on the next level, no matter what they previous had.

How difficult would it be to accomplish this?

_________________
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:02 ago.

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

PostPosted: Sun Aug 28, 2016 11:44 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Fairly easy; I'd do it in three parts:

- Add a map object that changes a variable in gamestate (probably easiest to tie it to a pick-up object of some sort)
- Have a check in TakeDamage for BJ's health going below a certain amount that is active only if the appropriate variable is true that ends the level and resets the player's weapons/ammo/etc. (and sets the variable to false again)
- Display the intermission

The hardest of these three is the intermission code, but luckily that's also the most commonly used in other mods, so there should be a tutorial for it somewhere.
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Mon Aug 29, 2016 8:41 am
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks!

Yeah, I am thinking of tying it to a specific map, so in that case I will do gamestate.mapon cbeck instead of tying it to a pickup object.

_________________
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:02 ago.

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

PostPosted: Mon Aug 29, 2016 2:48 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Barry wrote:
Thanks!

Yeah, I am thinking of tying it to a specific map, so in that case I will do gamestate.mapon cbeck instead of tying it to a pickup object.


Well, the main problem is when doing this it will work for the entire map. If that's how you want it, it'll work fine, but if you want it to be like the end of the first episode of Doom it will require a more specific trigger.
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Mon Aug 29, 2016 3:07 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

AlumiuN wrote:
Barry wrote:
Thanks!

Yeah, I am thinking of tying it to a specific map, so in that case I will do gamestate.mapon cbeck instead of tying it to a pickup object.


Well, the main problem is when doing this it will work for the entire map. If that's how you want it, it'll work fine, but if you want it to be like the end of the first episode of Doom it will require a more specific trigger.


The thing is, I also want to ensure that it's impossible for the player to avoid it and isn't a situation where a skilled player could retreat into cleared parts of the map for cover and pick the enemies off one by one. I could however also add a flag in this new gamestate to ensure that locked doors cannot be opened when it is set to true, preventing the player from doing that.

_________________
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:02 ago.

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

PostPosted: Mon Aug 29, 2016 5:00 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Barry wrote:
AlumiuN wrote:
Barry wrote:
Thanks!

Yeah, I am thinking of tying it to a specific map, so in that case I will do gamestate.mapon cbeck instead of tying it to a pickup object.


Well, the main problem is when doing this it will work for the entire map. If that's how you want it, it'll work fine, but if you want it to be like the end of the first episode of Doom it will require a more specific trigger.


The thing is, I also want to ensure that it's impossible for the player to avoid it and isn't a situation where a skilled player could retreat into cleared parts of the map for cover and pick the enemies off one by one. I could however also add a flag in this new gamestate to ensure that locked doors cannot be opened when it is set to true, preventing the player from doing that.


I think for this situation you probably want to find another way to ensure it's impossible; never assume that the players will be unable to kill every enemy in an area, regardless of the setup. Doom fixed this problem by having a special damaging sector type with the property of ending the level when the player's health got low enough. Perhaps have a setup whereby enemies will spawn endlessly along with locking the player in the room?
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Mon Aug 29, 2016 5:52 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

AlumiuN wrote:


I think for this situation you probably want to find another way to ensure it's impossible; never assume that the players will be unable to kill every enemy in an area, regardless of the setup. Doom fixed this problem by having a special damaging sector type with the property of ending the level when the player's health got low enough. Perhaps have a setup whereby enemies will spawn endlessly along with locking the player in the room?


Good point. That's kind of why I was considering having a separate map for it. Place the player in a room with a single enemy, let them fire a shot, and then have something like 200 enemies pour in from all directions. Since there would be no health or ammo, I am not sure how the player would survive that, unless they did God mode and Tab-I. I could also accomplish this with locking a door behind the player and doing the same thing. Do you think that is something the player could survive?

If I wanted to go the infinite re spawning route, how would I go about that?

_________________
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:02 ago.

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

PostPosted: Mon Aug 29, 2016 7:07 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Barry wrote:
Good point. That's kind of why I was considering having a separate map for it. Place the player in a room with a single enemy, let them fire a shot, and then have something like 200 enemies pour in from all directions. Since there would be no health or ammo, I am not sure how the player would survive that, unless they did God mode and Tab-I. I could also accomplish this with locking a door behind the player and doing the same thing. Do you think that is something the player could survive?

If I wanted to go the infinite re spawning route, how would I go about that?


Potentially, yes; it would be very dependent on the enemy types used (in particular the amount of ammo dropped vs. how much it takes to kill them, but the knife messes with that), amount of cover, and luck, but I could see someone surviving it. It's probably unlikely with that many enemies, though. The infinite respawning route is probably not worth taking; I would possibly consider thinking about why they'd want to take you alive and then make a way of doing so that makes sense more than them shooting you until you're nearly dead (which you can normally withstand but for some reason can't now).
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Mon Aug 29, 2016 8:20 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

AlumiuN wrote:


Potentially, yes; it would be very dependent on the enemy types used (in particular the amount of ammo dropped vs. how much it takes to kill them, but the knife messes with that), amount of cover, and luck, but I could see someone surviving it. It's probably unlikely with that many enemies, though. The infinite respawning route is probably not worth taking; I would possibly consider thinking about why they'd want to take you alive and then make a way of doing so that makes sense more than them shooting you until you're nearly dead (which you can normally withstand but for some reason can't now).


Good point here.

Details of the story are still being worked out, but the basic premise is that the Nazi's are suspected of developing a nuclear weapon. BJ has to infiltrate a top-secret military installation to discover whether or not that is true and if its true, where its being developed. After discovering the plans, BJ is arrested, taken to a prison within an ancient castle, and has to escape. After he escapes, he goes to the science labs where the nuclear device is being developed and takes out the doctor overseeing the project.

I need to figure out how to work the arrest into this, both story wise and in the game.

_________________
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:35 ago.

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

PostPosted: Mon Aug 29, 2016 10:09 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I think having Hans Grosse spawned in all four directions *and* spawning the player with tables all around him will guarantee the player's death. 100% health and 200 ammo won't change that.
AlumiuN
DieHard Wolfer
DieHard Wolfer


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

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

PostPosted: Mon Aug 29, 2016 10:38 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:
I think having Hans Grosse spawned in all four directions *and* spawning the player with tables all around him will guarantee the player's death. 100% health and 200 ammo won't change that.


Tables aren't exactly realistic, but if you're willing to implement directional sprites (incredibly easy in SDL, less so in DOS) you could have a cage appear around the player (with an appropriate sound) pretty easily.
Ginyu
I am Death Incarnate
I am Death Incarnate


Joined: 29 Jan 2016
Last Visit: 10 Jun 2017

Topics: 2
Posts: 186

france.gif

PostPosted: Tue Aug 30, 2016 12:57 am
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You could also maybe pull out some kind of cinematic using classic wolf ending sequence where BJ is shown jumping.
You just keep the BJ running sprites, then guards keep coming everywhere. You replace the sprites where BJ is shown jumping with BJ with hands up.
I like the idea because the player will think he won this level. Smile
AlumiuN
DieHard Wolfer
DieHard Wolfer


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

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

PostPosted: Tue Aug 30, 2016 3:42 am
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Ginyu wrote:
You could also maybe pull out some kind of cinematic using classic wolf ending sequence where BJ is shown jumping.
You just keep the BJ running sprites, then guards keep coming everywhere. You replace the sprites where BJ is shown jumping with BJ with hands up.
I like the idea because the player will think he won this level. Smile


The only problem I have with this approach is the fact that normally BJ wouldn't just surrender, regardless of the strength of the enemy facing him.
Aryan_Wolf3D
I am Death Incarnate
I am Death Incarnate


Joined: 21 Jul 2011
Last Visit: 16 Dec 2017

Topics: 6
Posts: 172

blank.gif

PostPosted: Tue Aug 30, 2016 5:47 am
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You could try making the enemies who ambush you invincible, like in Operation: Heimzahlung when you trigger the alarm on level 10 & 15, making however much ammo the player has irrelevant. As long as it's made clear to the player that that is intentional, it shouldn't be frustrating to them.

AlumiuN wrote:
Tables aren't exactly realistic, but if you're willing to implement directional sprites (incredibly easy in SDL, less so in DOS) you could have a cage appear around the player (with an appropriate sound) pretty easily.

I really like this idea as well!
Tricob
Moderator
<B>Moderator</B>


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

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

PostPosted: Tue Aug 30, 2016 2:12 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

AlumiuN wrote:
Tricob wrote:
I think having Hans Grosse spawned in all four directions *and* spawning the player with tables all around him will guarantee the player's death. 100% health and 200 ammo won't change that.


Tables aren't exactly realistic, but if you're willing to implement directional sprites (incredibly easy in SDL, less so in DOS) you could have a cage appear around the player (with an appropriate sound) pretty easily.
Now that I think about it, animating the cage dropping around BJ isn't even necessary. You can "turn off the lights" for a second of two, and when the lights come back on, you see a cage around you.
AlumiuN
DieHard Wolfer
DieHard Wolfer


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

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

PostPosted: Tue Aug 30, 2016 3:28 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

[quote="Tricob"]
AlumiuN wrote:
Now that I think about it, animating the cage dropping around BJ isn't even necessary. You can "turn off the lights" for a second of two, and when the lights come back on, you see a cage around you.


You could probably just have the cage appear without animation or delay at all if the sound suggests an extremely fast mechanism.
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Tue Aug 30, 2016 7:20 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:
Tricob wrote:
I think having Hans Grosse spawned in all four directions *and* spawning the player with tables all around him will guarantee the player's death. 100% health and 200 ammo won't change that.


Tables aren't exactly realistic, but if you're willing to implement directional sprites (incredibly easy in SDL, less so in DOS) you could have a cage appear around the player (with an appropriate sound) pretty easily.
Now that I think about it, animating the cage dropping around BJ isn't even necessary. You can "turn off the lights" for a second of two, and when the lights come back on, you see a cage around you.


This might be a good idea. However, if I do that, how easy would it be to alert all enemies on that floor code as if a shot had been fired? Let's say I create a fake gold key in the middle of a large empty room with locked doors on all sides. When the player gets that key, the cage comes down on him, and enemies are alerted and start pouring through the locked doors. Another thing is I would want to prevent a regular shot from alerting the guards in that room as I wouldn't want them alerted without the trap being triggered.

_________________
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:02 ago.

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

PostPosted: Tue Aug 30, 2016 8:52 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Barry wrote:
Tricob wrote:
AlumiuN wrote:
Tricob wrote:
I think having Hans Grosse spawned in all four directions *and* spawning the player with tables all around him will guarantee the player's death. 100% health and 200 ammo won't change that.


Tables aren't exactly realistic, but if you're willing to implement directional sprites (incredibly easy in SDL, less so in DOS) you could have a cage appear around the player (with an appropriate sound) pretty easily.
Now that I think about it, animating the cage dropping around BJ isn't even necessary. You can "turn off the lights" for a second of two, and when the lights come back on, you see a cage around you.


This might be a good idea. However, if I do that, how easy would it be to alert all enemies on that floor code as if a shot had been fired? Let's say I create a fake gold key in the middle of a large empty room with locked doors on all sides. When the player gets that key, the cage comes down on him, and enemies are alerted and start pouring through the locked doors. Another thing is I would want to prevent a regular shot from alerting the guards in that room as I wouldn't want them alerted without the trap being triggered.


As for making noise, the line "madenoise = true;" should do it; not having them be alerted with a normal shot is a little more difficult.
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Tue Aug 30, 2016 9:07 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

AlumiuN wrote:
Barry wrote:
Tricob wrote:
AlumiuN wrote:
Tricob wrote:
I think having Hans Grosse spawned in all four directions *and* spawning the player with tables all around him will guarantee the player's death. 100% health and 200 ammo won't change that.


Tables aren't exactly realistic, but if you're willing to implement directional sprites (incredibly easy in SDL, less so in DOS) you could have a cage appear around the player (with an appropriate sound) pretty easily.
Now that I think about it, animating the cage dropping around BJ isn't even necessary. You can "turn off the lights" for a second of two, and when the lights come back on, you see a cage around you.


This might be a good idea. However, if I do that, how easy would it be to alert all enemies on that floor code as if a shot had been fired? Let's say I create a fake gold key in the middle of a large empty room with locked doors on all sides. When the player gets that key, the cage comes down on him, and enemies are alerted and start pouring through the locked doors. Another thing is I would want to prevent a regular shot from alerting the guards in that room as I wouldn't want them alerted without the trap being triggered.


As for making noise, the line "madenoise = true;" should do it; not having them be alerted with a normal shot is a little more difficult.


Thanks. It probably isn't too big of a deal if the enemies are alerted by a regular shot, but I'll make sure to create a new gamestate and NOT use gamestate.mapon as I was originally planning as I don't want the player being captured unless they trigger the trap.

_________________
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:35 ago.

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

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

Perhaps triggering the trap will automatically open up selected doors ... ones which have enemies inside? It's easy enough to design the map so that the player can't get to these doors before the trap is triggered.
AlumiuN
DieHard Wolfer
DieHard Wolfer


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

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

PostPosted: Wed Aug 31, 2016 3:24 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:
Perhaps triggering the trap will automatically open up selected doors ... ones which have enemies inside? It's easy enough to design the map so that the player can't get to these doors before the trap is triggered.


This is probably the best idea - having it open some locked doors (ideally ones you don't have a key for) and then using 'madenoise = true' immediately after doing so should work.
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

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

AlumiuN wrote:
Tricob wrote:
Perhaps triggering the trap will automatically open up selected doors ... ones which have enemies inside? It's easy enough to design the map so that the player can't get to these doors before the trap is triggered.


This is probably the best idea - having it open some locked doors (ideally ones you don't have a key for) and then using 'madenoise = true' immediately after doing so should work.


Thanks! How would I accomplish this? Is there a tutorial to open doors automatically when an item is acquired? This could also be useful because I want to have some switch activated doors in the laboratory section late in this game.

_________________
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:02 ago.

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

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

Barry wrote:
AlumiuN wrote:
Tricob wrote:
Perhaps triggering the trap will automatically open up selected doors ... ones which have enemies inside? It's easy enough to design the map so that the player can't get to these doors before the trap is triggered.


This is probably the best idea - having it open some locked doors (ideally ones you don't have a key for) and then using 'madenoise = true' immediately after doing so should work.


Thanks! How would I accomplish this? Is there a tutorial to open doors automatically when an item is acquired? This could also be useful because I want to have some switch activated doors in the laboratory section late in this game.


Not that I know of, but the following should work if all the doors are of the same type:

::: CODE :::
for (int door = 0; door < doornum; door++)
{
    if (doorobjlist[doornum].lock == dr_lock1 && doorobjlist[doornum].action == dr_closed)
        OperateDoor(doornum);
}


Change dr_lock1 to whatever type you want to be opened, and slap that code in the item pickup case in GetBonus in WL_AGENT.

EDIT: I can't remember if variable declarations inside a for loop are allowed within a case, so you might need to add 'int door;' to the top of the function and lop the int out of the for statement.
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 17 Dec 2017

Topics: 55
Posts: 2116
Location: Canada
blank.gif

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

Barry wrote:
The way I want to accomplish this is have the player in an impossible enemy situation

Challenge accepted Laughing
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

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

AlumiuN wrote:
Barry wrote:
AlumiuN wrote:
Tricob wrote:
Perhaps triggering the trap will automatically open up selected doors ... ones which have enemies inside? It's easy enough to design the map so that the player can't get to these doors before the trap is triggered.


This is probably the best idea - having it open some locked doors (ideally ones you don't have a key for) and then using 'madenoise = true' immediately after doing so should work.


Thanks! How would I accomplish this? Is there a tutorial to open doors automatically when an item is acquired? This could also be useful because I want to have some switch activated doors in the laboratory section late in this game.


Not that I know of, but the following should work if all the doors are of the same type:

::: CODE :::
for (int door = 0; door < doornum; door++)
{
    if (doorobjlist[doornum].lock == dr_lock1 && doorobjlist[doornum].action == dr_closed)
        OperateDoor(doornum);
}


Change dr_lock1 to whatever type you want to be opened, and slap that code in the item pickup case in GetBonus in WL_AGENT.

EDIT: I can't remember if variable declarations inside a for loop are allowed within a case, so you might need to add 'int door;' to the top of the function and lop the int out of the for statement.


Thanks!

I will use this and also use it when doing switch-activated doors later in the game. This will also allow me to have a different floor code in the room with the trap object, preventing the player from triggering it too soon by firing.

Chris wrote:
Barry wrote:
The way I want to accomplish this is have the player in an impossible enemy situation

Challenge accepted Laughing


Haha. Think you can survive being trapped in a 1x1 tile with 40 SS surrounding you?

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


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

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

Quick question. Let's say on a specific level I wanted to make the gold key a trap to spawn sprites to block the player, could I use "PlaceItemType (bo_arrest, tilex,tiley);" or will that only work for actors dropping items? Also, can I use a hard value for tilex and tiley? For instance, if I always wanted my item to spawn at 35,57 in the map, could I use "PlaceItemType (bo_arrest, 35,57);" ?

_________________
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:02 ago.

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

PostPosted: Thu Sep 22, 2016 2:42 am
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Barry wrote:
Quick question. Let's say on a specific level I wanted to make the gold key a trap to spawn sprites to block the player, could I use "PlaceItemType (bo_arrest, tilex,tiley);" or will that only work for actors dropping items? Also, can I use a hard value for tilex and tiley? For instance, if I always wanted my item to spawn at 35,57 in the map, could I use "PlaceItemType (bo_arrest, 35,57);" ?


Yes, to both of those questions. I would recommend adding it as a map object, though, mainly to reduce the amount of hard-coding involved.
Tricob
Moderator
<B>Moderator</B>


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

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

PostPosted: Thu Sep 22, 2016 2:12 pm
   Subject: Re: Special level ending sequence
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You might also consider having it activated with a "Deaf Guard" floor tile. The code can always change the floor tile to something else before the player begins playing the map.
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Thu Sep 22, 2016 2:34 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:
You might also consider having it activated with a "Deaf Guard" floor tile. The code can always change the floor tile to something else before the player begins playing the map.


How would I do this and what would it accomplish?

What I think I want to do is this.

1) Make a specific type of enemy...say SS..invincible on a specific map
2) When a specific locked door is opened, to spawn an invisible end-level item/tile so that the level will end when the player tries to escape. The end-level item can only exist though AFTER the SS are alerted.

_________________
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:02 ago.

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

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

Barry wrote:
Tricob wrote:
You might also consider having it activated with a "Deaf Guard" floor tile. The code can always change the floor tile to something else before the player begins playing the map.


How would I do this and what would it accomplish?

What I think I want to do is this.

1) Make a specific type of enemy...say SS..invincible on a specific map
2) When a specific locked door is opened, to spawn an invisible end-level item/tile so that the level will end when the player tries to escape. The end-level item can only exist though AFTER the SS are alerted.


1) It's probably easier (and more interesting) to make all enemies invincible when the trap is triggered. This will allow you to both use that type of enemy in the rest of the map, and allow the trap to contain more than one type of enemy, plus it's also not hard-coded to the specific map. I'd personally just change DamageActor in WL_STATE such that the line:

::: CODE :::
ob->hitpoints -= (short)damage;


Is this instead:

::: CODE :::
if (!gamestate.trapped)
    ob->hitpoints -= (short)damage;


Where gamestate.trapped is a boolean variable in the gamestate struct set to true upon the trap triggering (which will need set to false upon loading a map).

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.
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 1 of 2 Goto page 1, 2  Next
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [help] Intermission Screens on SDL
Author: RichterBelmont12
19 2866 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