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

Doom in Hexen Format, 2 quick questions.

Recommended Posts

As the title says:
Question 1:

How do you create a level exit (both switch and walk over)? I can't work it out and it seems like it should be so obvious.

Is it possible to have an exit switch that requires a key to activate?

Share this post


Link to post

Hexen format uses what's called linedef specials. You can specify the arguments for each special (like for doors, the speed, delay, etc). You then specify an activation type (walkover, shootable, use).

In Doom in Hexen, the exit special is called Exit_Normal. It's number is 243, and it doesn't have arguments you need to worry about.

About requiring the exit switch to directly require a key, you would have to use scripting. The script might look like:

Script 255 (void)
{
  If (CheckInventory("YellowCard"))
    Exit_Normal(0);
  Else
    Print(s:"You need a yellow keycard to exit...");
}
You'd then compile the script into your map, and use ACS_Execute (type 80) in your map to call the script, and set the "script" argument to 255, so it executes the correct script. Note that linedef specials can be set directly on lines in-game, or can be used in scripts. Usually when you want to do multiple actions at once or check for certain conditions, that's when you'd use a script.

You can learn all about this stuff on the ZDoom Wiki.

Share this post


Link to post

Of course, you could use a line type 83 (Script execute requiring keycard) and set the key argument to the appropriate value, thereby removing the need for the inventory check in the script.


[edit] Oh, and in case it isn't clear, all lindef specials in ZdoomHexen format can have their activation type set separately to their action. So, unlike Doom format with W1, WR, D1, DR, S1, SR etc actions tied to what the line does, the activation type and lindef special are set independently. So, both a switch and walk exit line would have the same special but would have different activation types. [/edit]

Share this post


Link to post
Enjay said:

Of course, you could use a line type 83 (Script execute requiring keycard) and set the key argument to the appropriate value, thereby removing the need for the inventory check in the script.


Haha, I forgot all about that. Thanks for mentioning it. :)

But yeah, the whole idea with linedef specials is that you have a small group of line types, with various options for "tweaking" them, instead of having thousands of specific ones to cover all the different combinations of "tweaks".

Share this post


Link to post

Script 255 (void)
{
If (CheckInventory("BlueCard"))
Exit_Normal(0);
Else
Print(s:"You need a blue keycard to start the boat...");
}

every time I try ro compile the above script in Doombuilder 2 I get the error:
Function: exit_normal is used but not defined.

what does this mean? and am I using the correct script if by pressing the button I want to exit to map31 (secret level, if that wasn't obvious).

Share this post


Link to post

Also, as I said, your script could be reduced:

#include "zcommon.acs"

Script 255 (void)
{
Exit_Normal(0);
}
Then run it with a line type 83 and the following arguments

first = 255 (script number)
second = 0
third = 0
fourth = 0
fifth = 2 (code for the blue card)

Share this post


Link to post

Thanks Enjay but to have the custom text string I think I need the longer script, anyway I have it working now except it takes me to MAP10 (from MAP09) rather than MAP31. What do I need to do to rectify this?
Current script:
#include "zcommon.acs"
Script 255 (void)
{
If (CheckInventory("BlueCard"))
Exit_Secret(31);
Else
Print(s:"You need a blue keycard to start the boat...");
}

Share this post


Link to post

Exit_Normal and Exit_Secret go to the maps specified in MAPINFO. If you want to go to a specific map you can use Teleport_NewMap instead. That one is basically the same but you can specify the map to go to as parameter.

Share this post


Link to post

Agent_Spork's "Ultimate Simplicity" has a good example of breaking glass on level 10, so have a look there maybe..

Also the first level of ZPACK has this effect also.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×