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       

[Code] End Level Object - Adam Biser
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
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 12 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Fri Nov 05, 2004 10:11 am
   Subject: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

WL_DEF.H - Add:
::: CODE :::
#define EXITLEVEL      105

WL_AGENT.C - go to void Thrust and find this near the end. (Find the blue lines, add the red ones)
::: CODE :::
   if (*(mapsegs[1] + offset) == EXITTILE)
      VictoryTile ();

   if (*(mapsegs[1] + offset) == EXITLEVEL)
      playstate = ex_completed;

That should work. There might also be a tutorial somewhere also.

EDIT: That will at least take you to the intermission screen. You'd have to do the flash and such yourself, but that's the level end object you wanted.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Guest




Last Visit:





PostPosted: Fri Nov 05, 2004 3:07 pm
   Subject: Re: "End Level and goto Next" object?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks loads, Adam. You're the best!

EDIT: Also, I'm assuming when I add the new object to FloEdit II's database, I use 105 as the Object's ID?
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 12 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Fri Nov 05, 2004 6:55 pm
   Subject: Re: "End Level and goto Next" object?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

That's correct.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
lucky_foot
Don't Hurt Me
Don't Hurt Me


Joined: 05 Nov 2004
Last Visit: 19 Sep 2010

Topics: 13
Posts: 69
Location: Pennsylvania
usa.gif

PostPosted: Sat Nov 06, 2004 4:03 am
   Subject: Re: "End Level and goto Next" object?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Is that the same end level object that is used in Himmler's SS add-on?

_________________
JonathanS
Lucky foot Productions

www.luckyfootproductions.jtworld.net
Dugtrio17
Code Master
Code Master


Joined: 11 Mar 2003
Last Visit: 03 Oct 2013

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

PostPosted: Sat Nov 06, 2004 6:53 am
   Subject: Re: "End Level and goto Next" object?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

No, I believe in Himmler's SS it was a regular object you could pick up that would make playstate = ex_completed, thus you could get around it and explore where you weren't supposed to.

_________________
lucky_foot
Don't Hurt Me
Don't Hurt Me


Joined: 05 Nov 2004
Last Visit: 19 Sep 2010

Topics: 13
Posts: 69
Location: Pennsylvania
usa.gif

PostPosted: Sat Nov 06, 2004 9:31 am
   Subject: Re: "End Level and goto Next" object?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

that sounds like it. Do you know where the turotiral is for that?

It's like the fade-out when you reach a point it fades immediatly to the ending screen where you get your score tallied. It then launches the next level.

_________________
JonathanS
Lucky foot Productions

www.luckyfootproductions.jtworld.net
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 12 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Sat Nov 06, 2004 10:29 am
   Subject: Re: "End Level and goto Next" object?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

@lucky_foot: The one posted above will do what you want. It's acts the same as switching the elevator in the original, except you just walk over it.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
lucky_foot
Don't Hurt Me
Don't Hurt Me


Joined: 05 Nov 2004
Last Visit: 19 Sep 2010

Topics: 13
Posts: 69
Location: Pennsylvania
usa.gif

PostPosted: Sat Nov 06, 2004 1:18 pm
   Subject: Re: "End Level and goto Next" object?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

LOL. Thanks, Adam.

That shows you how much I know Code. I'm a tutorial user and I didn't recognize it. Thanks. Smile

_________________
JonathanS
Lucky foot Productions

www.luckyfootproductions.jtworld.net
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: Thu Mar 03, 2005 12:25 am
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

This is a quicker way, that saves memory (not for Spear users):

::: CODE :::
   
case   bo_spear: //This is an endlevel trigger
      //spearflag = true;
      //spearx = player->x;
      //speary = player->y;
      //spearangle = player->angle;
   playstate = ex_completed;
   break;


Fairly simple, and if you don't want people walking past it, just make it that they can't. This doesn't require any extra defines (except for the sprite in WL_ACT1.C) and therefore saves memory, which is getting an absolute necessity nowadays.[/code]

_________________
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
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 12 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Thu Mar 03, 2005 6:09 am
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

@Deathshead: I would think that that yours uses more memory (though not much) actually, because you actually have to create a new object type in the static object list. The #define is used as a constant and doesn't use memory (though I may be wrong). I believe that the compiler goes through your code and replaces the constants by their actual value when compiling, so that is the same as using a number, just a bit easier to read. Good idea, though.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Thu Mar 03, 2005 8:58 am
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Correct Adam...

Adding new bo_??? defines actually does increase memory usage more than just adding the two statements that you used for your tutorial. The way that you have given to do it is much easier to code and easier for new coders to follow, besides using less memory.

@Deathshead: Yes, your way does in fact work.. It's just that Adam's is more efficient and uses less memory.

Greg
BrotherTank
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 30 Oct 2017

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

PostPosted: Thu Mar 03, 2005 11:34 am
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Actually, Deathshead's way requires no alteration whatsoever (beyond changing an object to use the bo_spear action); you can even do it with a hex editor just by changing one byte to 020 in wolf3d's exe. Adam's way is more efficiant though, in my opinion, unless you actually want to use a sprite picture with the endlevel trigger.

Like Dugtrio17 said, though, sometimes you can actually walk around sprites without touching them; especially when going backwards. So that would give Adam's method another advantage over the one Deathshead described. I think the easiest way to get rid of that bug would be to add something like this to the ThreeDRefresh() function of WL_DRAW.C:

::: CODE :::
//
// follow the walls from there to the right, drawwing as we go
//
   if (spotvis[player->tilex][player->tiley] == 0)
      spotvis[player->tilex][player->tiley] = 1;


   VGAClearScreen ();

   WallRefresh ();

Now the object under you is always there in the DrawScaleds() table; atleast. Wink
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: Thu Mar 03, 2005 10:45 pm
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks Chris for supporting my method. And that code you posted...is that so that players can collect objects backwards? I couldn't work out where Darkone put that in his NewWolf Classic. Wicked, I wanted to put this in. Thanks again!

_________________
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
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Fri Mar 04, 2005 8:22 am
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Deathshead wrote:
Thanks Chris for supporting my method. And that code you posted...is that so that players can collect objects backwards? I couldn't work out where Darkone put that in his NewWolf Classic. Wicked, I wanted to put this in. Thanks again!


Firstly, I hope you didn't think that Adam and I weren't supporting your method. We both stated that yes it does work... The only thing that we see is it has a few drawbacks:

1) that it uses more memory than the method that Adam posted. When you get to a point where memory becomes an issue, you start looking for everything you can to make sure that you don't run out.

2) is the problem if someone is actually using the Spear side of the code. Using your way has now rendered the "You have the Spear" teleportation to the final boss level useless.

When you look at the overall picture, then Adam's addition makes even more sense as it becomes universal to both sides of the source (Wolf3d and Spear)....




On the Bonus problem where you are walking backwards and sometimes are not picking up things... Darkone used the following line in his DrawScaleds routine to fix the problem:

::: CODE :::

      if(TransformTile(statptr->tilex, statptr->tiley, &visptr->viewx, &visptr->viewheight) &&
         statptr->flags&FL_BONUS && statptr->tilex==player->tilex && statptr->tiley==player->tiley)
      {
         GetBonus(statptr);
         continue;
      }


Which updates the following lines from the original Wolf3d source in the DrawScaleds routine:

::: CODE :::

      if (TransformTile (statptr->tilex,statptr->tiley
         ,&visptr->viewx,&visptr->viewheight) && statptr->flags & FL_BONUS)
      {
         GetBonus (statptr);
         continue;
      }


Basically it just adds a little more to the if statement check to see if the player is actually standing on the space where the bonus item appears. Adding the additional check actually makes the player pick up everything (even if walking backwards). Seeing as picking up bonus items uses the "GetBonus" routine in the wl_agent.c file, a quick search for all places that call that routine easily points out the changes Darkone made. Hope that helps...

Greg
BrotherTank

_________________

The probability of someone watching you is directly related to the Stupidity of your actions
&
The two most abundant things in the Universe are Hydrogen & Stupidity - H.Ellison

Which of those is more relevant to you??
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 Mar 05, 2005 9:42 pm
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yeah. I thought that GETTING RID OF CODE saved memory. All I did was get rid of code. To make it universal, what if you were to:


::: CODE :::

   case   bo_spear: // Endlevel trigger
#ifdef SPEAR
      spearflag = true;
      spearx = player->x;
      speary = player->y;
      spearangle = player->angle;
#endif
      playstate = ex_completed;
      break;


This keeps the 'You got the spear' thing, but Works as an Endgame trigger in Wolf. And in Wolf, this saves memory, as those few spear lines are kept out of the compilation.

_________________
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
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Sun Mar 06, 2005 7:42 am
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Again.... That would work...

BUT... then you have no actual "End Level" trigger for the Spear side of the code. The reason Adam's is the better way is this:

1) It preserves the 'bo_spear' object in the Spear side of the code.
2) It works with both sides of the code... ie: both Spear and Wolf3d.

Also, your way doesn't save much memory as those variables are still defined elsewhere in the game (read as take up memory). I would suggest that you load the bit of code that I gave a while back so that you can actually see the differences - Click Here for the Free Memory View Code - If you load this code, each time you run your program it will show you what your changes have done to the actual usable memory.

Again, what you have done isn't bad, but it isn't universal... it's just that Adam's does both without affecting the Spear side of the code.

Greg
BrotherTank

Edit - Found the information that maybe explains things better:

Adam's way of programming it is especially benificial if you are using fixes from the "Freeing Up Memory - A Must Read" thread. In there Adam gives a section of code which effectively removes unused Spear variables when you are coding the Wolf side of things - See: Removing Spear Variables.

Again... No-one is saying what you are doing is wrong or bad... It's just that Adam's way is universal, and uses less memory. Trust me if you are using code for your "EZCode" project... Adam's is the code to add and use.

Greg
BrotherTank
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: Sun Mar 06, 2005 4:12 pm
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I understand completely BT.

BrotherTank wrote:

BUT... then you have no actual "End Level" trigger for the Spear side of the code. The reason Adam's is the better way is this:

1) It preserves the 'bo_spear' object in the Spear side of the code.


The ex_completed is still defined in Spear, so you still have the endlevel trigger when you get the Spear.

_________________
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
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Sun Mar 06, 2005 9:22 pm
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Deathshead wrote:
I understand completely BT.

BrotherTank wrote:

BUT... then you have no actual "End Level" trigger for the Spear side of the code. The reason Adam's is the better way is this:

1) It preserves the 'bo_spear' object in the Spear side of the code.


The ex_completed is still defined in Spear, so you still have the endlevel trigger when you get the Spear.


It's not the same thing. I guess you haven't read the rest of the code and that is why you aren't getting this. In the spear side of the code, when you pick up the spear you are taken to the last level. It acts similar to the secret level code but with a difference.... There is no intermission and it places the player in the exact same spot where the spear was taken from... hence if you look at the maps in Spear... The two maps are the same at the point where the spear is picked up. Think of it more as glorified Warping.... That is what the bo_spear object does in the spear side of the code.

Yes, it triggers an end of the current level, but it is fixed in spear as to where it goes and what it does.
Yes, it is and will work as you have defined in the wolf side of the code, but it is not the same in the Spear side.

What Adam's code does is allow you to have an End Level trigger rather than having to find an elevator and throw the switch. It can be used on any level at any time. That is the difference. With Adam's code it works on both sides of the code... and still keeps the "You weild the spear" portion of the code proper to spear.

I don't know how to explain it any better than what I have.... Maybe when you have studied the code a little more, it will all make more sense to you.... I know that you are trying to produce tutorials and get your name in lights (so to speak), but this code idea that you are using has been hashed out before (back in the days of the Dome Forums I believe) and Adam's solution was the best solution to the problem.

Greg
BrotherTank
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 30 Oct 2017

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

PostPosted: Mon Mar 07, 2005 5:06 am
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

BrotherTank wrote:
but this code idea that you are using has been hashed out before (back in the days of the Dome Forums I believe)

It's used in a few older addons too (Armageddon and Chemical Warfare; for instance). I'd recommend playing them to find it, as the 020 "bo_spear in wolf3d" is used in some interesting ways. Here's how the Chokage document describes it:

http://www.canadianphilatelics.com/choksta/backup/chokage.txt

Just scroll down to "Why are all the empty wells blocked off". Probably one of the lamest stories I've ever written. Wink
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 9:48 ago.

Topics: 69
Posts: 3673

blank.gif

PostPosted: Fri Sep 08, 2006 1:32 pm
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

When you use an end level object on a secret level, it takes you to the next level instead of the level after the one where you found the secret elevator. Is there a way to solve this problem?
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 12 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Fri Sep 08, 2006 2:03 pm
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You're using the multiple end level objects with the "alternative path" stuff, right? You'll need to place the correct end level object in order to go back.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 9:48 ago.

Topics: 69
Posts: 3673

blank.gif

PostPosted: Sat Sep 09, 2006 2:56 am
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I've removed the idea of alternative paths out of my mod, because it was getting to messy.
Anonymous
Guest



Last Visit:





PostPosted: Thu Feb 01, 2007 4:12 am
   Subject: Re: [Code] End Level Object - Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Hi guys, this looks really interesting.

I'm thinking about making a game where you need to save someone in the end, to get to the next level.

For now I've thought up this: I'd make a table object (one you can't walk through) and make it look as a person that has been tied so they can't move.
But I'd like to have it that once you press space, you move on to the next level. Well I mean, the level ends.

Is it easy to make something like that from this code? And if possible, could one of you guys help me with that? Thanx.
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] Add Text to Screen at Skill Level select - Chris
Author: Chris
3 2438 Tue Sep 28, 2010 6:59 pm
Tricob View latest post
No new posts [Code] Display Different Ammo Types on Statusbar-BrotherTank
Author: BrotherTank
1 2381 Fri Feb 11, 2005 9:18 pm
Zombie_Plan View latest post
No new posts [Code] Adding a Frames per Second Counter - Darkone
Author: BrotherTank
0 1703 Sat Mar 13, 2004 2:07 pm
BrotherTank View latest post
No new posts [Code] Changing an Enemies Attack Strength - BrotherTank
Author: BrotherTank
0 1969 Tue Jan 27, 2004 10:29 am
BrotherTank View latest post
No new posts [Code] Changing Weapons -CheckWeaponChange- BrotherTank
Author: BrotherTank
2 2700 Sun Oct 26, 2003 1:21 am
Guest 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