Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
E.J.

A couple dehacked questions

Recommended Posts

Hello.

I'm trying to do two things here.

1.) Only include 1 midi track for play in multiple levels, instead of having multiple copies of it in the wad.

2.) Have the completion of a level take you to a non-sequential follow up level like '1 to 8', '3 to 30', even '5 to the end credits screens'.

Could something like this be accomplished using a dehacked file (.deh)?

Share this post


Link to post

1) Not with dehacked. You can create hard links to the same data. That is, you import a single song inside of a WAD, and you have other lumps point to that song data. So D_RUNNIN at position 100 size 200, and D_COUNTD at position 100 size 200 for example.

2) No

Share this post


Link to post

To correct Ghasty Deaths post.

1. Is possible with Dehacked:

Text 6 6
runnintrack1

Text 6 6
stalkstrack1

These when placed in a deh file remap the music for Map01 and 02 to use the same midi, a midi called "track1"

2. Isn't possible with Dehacked.

Share this post


Link to post

Text 6 6
runnintrack1

Text 6 6
stalkstrack1

Awesome, thanks. ;)

The reason I ask about the stage skipping as it where is that I've played several pwads that went from one stage to another somehow, instead of the next in numerical order.

Is there someway to accomplish that with a vanilla doom setting?

Share this post


Link to post

In Doom 1 and Heretic you can skip maps (or take them back maps) by taking the player to the secret map early because the secret exits work on any map on the episode.

In Doom2 however, the secret exits are hardcoded to only work on Map15, 31 and 32 with hardcoded results.

Share this post


Link to post
Vermil said:

In Doom 1 and Heretic you can skip maps (or take them back maps) by taking the player to the secret map early because the secret exits work on any map on the episode.

In Doom2 however, the secret exits are hardcoded to only work on Map15, 31 and 32 with hardcoded results.


Huh...I never knew it wasn't hard coded in doom1. That's interesting...so does the game just remember which level you got to the secret stage from, and send you to the next one upon completion? Could you theoretically have multiple secret level exits (i.e. from multiple levels - of course this would be silly unless you had scripting going on, in which case no use for secret exits!!)

Share this post


Link to post
magicsofa said:

Huh...I never knew it wasn't hard coded in doom1.

It is hardcoded. The logic is "if secret exit then goto level 9".

In Doom II, since it's not cut into episodes and as a result the two secret exits are technically in the same episode, then they changed the logic to be "if secret exit and level 15 goto level 31, else if level 31 goto level 32".

Share this post


Link to post

Let's say I 'IDCLEV' to level 30 of a Doom 2 pWAD that I'm testing out for fun, and per the readme it says that level 30 is a secret level.

I beat that level, it goes to the end game screen, which I then spacebar through the enemies for fun.

How did the author do this with Vanilla Doom (+ Vanilla Dehacked) parameters?

(IE - Level 30 secret level, with level completion resulting in end-game.)

Share this post


Link to post

Put the MAP29 exit in a secret sector. There you go, you can technically argue that MAP30 is a secret level! :p

Share this post


Link to post

Regarding misplaced secret exits, I looked into this ages ago, and found some slighty surprising behaviour:

Grazza said some years ago:
In the original games, misplaced secret exits (i.e. ones not in E1M3, E2M5, E3M6, E4M2, MAP15 or MAP31) are handled as follows:

In Ultimate Doom, you are taken to that episode's secret level, but upon leaving the secret level, you go to the level that you would normally go to from there. Thus if you had a secret exit in E1M1, you would go:
E1M1->E1M9->E1M4

In Doom2, a secret exit in a map other than MAP15 or MAP31 works like this: If you have warped to the current level, then a misplaced secret exit sends you back to map01. However, if you have arrived at that map by exiting the previous level, then you go back to the start of the current level. For example, if you exit map13 (via a normal exit) and thus go to map14, and map14 has a misplaced secret exit, then it will send you to map14. I don't know if there are any further quirks or if this is the full picture.

Note that some ports change this behaviour.

As an aside, there is a place in the Dehacked Text section where "MAP31" appears as a default value. Immediately one thinks that it might be something to do with secret exits. But it isn't - well, only sort of. As fraggle worked out, it is telling the program to check if MAP31 is present, to check if the iwad is the German version. If it doesn't find MAP31 (or whatever this value has been changed to), then any secret exits are handled like normal exits (e.g., map15's secret exit takes you to map16). So not tremendously useful.

Share this post


Link to post

On a completely different topic than the secret levels, and beyond my "couple" questions quota...

Is there any way to allow creatures to ignore each other's attacks, regardless of whether they actually inflict damage? Any type creature, same type fighting, across type fighting, even with the differing attack types?

And of course, is it possible with dehacked?

Share this post


Link to post
Grazza said:

Regarding misplaced secret exits, I looked into this ages ago, and found some slighty surprising behaviour:


The surprising behavior for Doom 2 is easily explained by a look at the original source code. Basically you've got a variable that tells what is the number of the next level. Then you've got a switch statement that tells what to do in Doom 2 if it's level 15, and what to do if it's level 31; but it has no default case.

So, the function that sets the "next level number" variable, if you take the secret exit in Doom 2 MAP15 or MAP31, simply does nothing. It doesn't set the variable at all. Therefore that variable remains at whatever value it was set before.

So if you warped to the level, that variable is still set to the value of the first map by default. And if you exited normally to the level, then that variable keeps the value it was set to by the previous normal exit, which is why you loop back to the current level.

Here's the relevant part:

    // wminfo.next is 0 biased, unlike gamemap
    if ( gamemode == commercial)
    {
	if (secretexit)
	    switch(gamemap)
	    {
	      case 15: wminfo.next = 30; break;
	      case 31: wminfo.next = 31; break;
	    }
	else
	    switch(gamemap)
	    {
	      case 31:
	      case 32: wminfo.next = 15; break;
	      default: wminfo.next = gamemap;
	    }
    }
You can see that returning from a secret level (31 or 32) sends you to MAP16. Notice the clever use of having gamemap be 1-based and wminfo.next 0-based, so that the default case for normal exit can be made quite simple. (Of course, it wouldn't have been any more complicated to have wminfo.next = gamemap +1 otherwise.) But if it's a secret exit and gamemap is neither 15 nor 31, then wminfo.next is not changed at all.

And here's the full code if you're curious:
//
// G_DoCompleted 
//
boolean		secretexit; 
extern char*	pagename; 
 
void G_ExitLevel (void) 
{ 
    secretexit = false; 
    gameaction = ga_completed; 
} 

// Here's for the german edition.
void G_SecretExitLevel (void) 
{ 
    // IF NO WOLF3D LEVELS, NO SECRET EXIT!
    if ( (gamemode == commercial)
      && (W_CheckNumForName("map31")<0))
	secretexit = false;
    else
	secretexit = true; 
    gameaction = ga_completed; 
} 
 
void G_DoCompleted (void) 
{ 
    int             i; 
	 
    gameaction = ga_nothing; 
 
    for (i=0 ; i<MAXPLAYERS ; i++) 
	if (playeringame[i]) 
	    G_PlayerFinishLevel (i);        // take away cards and stuff 
	 
    if (automapactive) 
	AM_Stop (); 
	
    if ( gamemode != commercial)
	switch(gamemap)
	{
	  case 8:
	    gameaction = ga_victory;
	    return;
	  case 9: 
	    for (i=0 ; i<MAXPLAYERS ; i++) 
		players[i].didsecret = true; 
	    break;
	}
		
//#if 0  Hmmm - why?
    if ( (gamemap == 8)
	 && (gamemode != commercial) ) 
    {
	// victory 
	gameaction = ga_victory; 
	return; 
    } 
	 
    if ( (gamemap == 9)
	 && (gamemode != commercial) ) 
    {
	// exit secret level 
	for (i=0 ; i<MAXPLAYERS ; i++) 
	    players[i].didsecret = true; 
    } 
//#endif
    
	 
    wminfo.didsecret = players[consoleplayer].didsecret; 
    wminfo.epsd = gameepisode -1; 
    wminfo.last = gamemap -1;
    
    // wminfo.next is 0 biased, unlike gamemap
    if ( gamemode == commercial)
    {
	if (secretexit)
	    switch(gamemap)
	    {
	      case 15: wminfo.next = 30; break;
	      case 31: wminfo.next = 31; break;
	    }
	else
	    switch(gamemap)
	    {
	      case 31:
	      case 32: wminfo.next = 15; break;
	      default: wminfo.next = gamemap;
	    }
    }
    else
    {
	if (secretexit) 
	    wminfo.next = 8; 	// go to secret level 
	else if (gamemap == 9) 
	{
	    // returning from secret level 
	    switch (gameepisode) 
	    { 
	      case 1: 
		wminfo.next = 3; 
		break; 
	      case 2: 
		wminfo.next = 5; 
		break; 
	      case 3: 
		wminfo.next = 6; 
		break; 
	      case 4:
		wminfo.next = 2;
		break;
	    }                
	} 
	else 
	    wminfo.next = gamemap;          // go to next level 
    }
		 
    wminfo.maxkills = totalkills; 
    wminfo.maxitems = totalitems; 
    wminfo.maxsecret = totalsecret; 
    wminfo.maxfrags = 0; 
    if ( gamemode == commercial )
	wminfo.partime = 35*cpars[gamemap-1]; 
    else
	wminfo.partime = 35*pars[gameepisode][gamemap]; 
    wminfo.pnum = consoleplayer; 
 
    for (i=0 ; i<MAXPLAYERS ; i++) 
    { 
	wminfo.plyr[i].in = playeringame[i]; 
	wminfo.plyr[i].skills = players[i].killcount; 
	wminfo.plyr[i].sitems = players[i].itemcount; 
	wminfo.plyr[i].ssecret = players[i].secretcount; 
	wminfo.plyr[i].stime = leveltime; 
	memcpy (wminfo.plyr[i].frags, players[i].frags 
		, sizeof(wminfo.plyr[i].frags)); 
    } 
 
    gamestate = GS_INTERMISSION; 
    viewactive = false; 
    automapactive = false; 
 
    if (statcopy)
	memcpy (statcopy, &wminfo, sizeof(wminfo));
	
    WI_Start (&wminfo); 
} 

Share this post


Link to post
E.J. said:

Is there any way to allow creatures to ignore each other's attacks, regardless of whether they actually inflict damage? Any type creature, same type fighting, across type fighting, even with the differing attack types?

And of course, is it possible with dehacked?

I don't think so. There is a "Monsters Infight" setting in the Misc section, but all this lets you do is make the monsters infight with ones they wouldn't normally infight with.

http://www.doomworld.com/vb/showthread.php?s=&postid=570448#post570448

Share this post


Link to post
Gez said:

It is hardcoded.


You know what I mean - it doesn't require a certain map to take you to the secret level

Share this post


Link to post
Grazza said:

I don't think so. There is a "Monsters Infight" setting in the Misc section, but all this lets you do is make the monsters infight with ones they wouldn't normally infight with.

http://www.doomworld.com/vb/showthread.php?s=&postid=570448#post570448


Any idea how to implement this? Yes I saw the post, but I'm unsure of what lines to add to the DEH text file. For instance, how do I allow infighting between imps?

I found this dehacked tutorial, but haven't had a chance to read all the way through. If it even covers the particular setting that is...

Share this post


Link to post

KDiZD uses a dehacked lump to disable infighting (this has been a controversial move by the way). You can just look at it for an example. It is the only thing that lump does; everything else is handled through DECORATE and MAPINFO. (If it had been made later, even that would have been handled through MAPINFO, since new features have been added to it since. But at the time, DEHACKED was still needed for this, and only this.)

Share this post


Link to post

I believe Vanilla Dehacked only allowed you to make bad guys of the same type infight with each other; the monster infight field could be either 0 or 1?

The ability to disable monster infighting was a port extension to Dehacked. It did this by adding another option to Vanilla Dehacked' monster infight field (i.e. it added option 2).

Share this post


Link to post
E.J. said:

Any idea how to implement this? Yes I saw the post, but I'm unsure of what lines to add to the DEH text file. For instance, how do I allow infighting between imps?

Well, you could use dehacked.exe. Press F4 (for the Misc section), and you'll see the option for "Monsters Infight" with a toggle box. Move to it and press Return, and an X appears in it. Save. The resulting deh file is as follows:

Patch File for DeHackEd v3.0

# Note: Use the pound sign ('#') to start comment lines.

Doom version = 19
Patch format = 6


Misc 0
Monsters Infight = 221
So that's what you need in your deh file if you want to create or edit it manually. As fraggle said, the value to enable it is 221. Note that this enables all interspecies infighting (i.e. projectile attacks now always provoke a response). You can't enable it for just one type of monster.

This is supported in Chocolate-Doom and Prboom-plus. I don't know about other ports.

Share this post


Link to post
Guest
This topic is now closed to further replies.
×